From d24c13843f1a225796c0590ae07ddb3843047471 Mon Sep 17 00:00:00 2001 From: "pydoc-zh-tw[bot]" <90344106+pydoc-zh-tw[bot]@users.noreply.github.com> Date: Sat, 14 Oct 2023 15:33:17 +0000 Subject: [PATCH] Sync with CPython 3.12 (#664) * sync with cpython c06ac1b4 * fix: resolve fuzzy entries * sync with cpython dbbe0eeb * sync with cpython 27d5ea29 * sync with cpython 0102faf0 * fix: resolve fuzzy entries --------- Co-authored-by: github-actions[bot] Co-authored-by: Matt Wang --- Makefile | 5 +- c-api/exceptions.po | 6 +- c-api/init_config.po | 2 +- c-api/intro.po | 231 +-- c-api/structures.po | 204 +-- c-api/type.po | 79 +- extending/windows.po | 4 +- howto/clinic.po | 2554 +-------------------------- howto/enum.po | 104 +- howto/instrumentation.po | 62 +- howto/logging-cookbook.po | 8 +- howto/logging.po | 4 +- howto/perf_profiling.po | 16 +- howto/urllib2.po | 43 +- library/__main__.po | 10 +- library/asyncio-llapi-index.po | 97 +- library/asyncio-protocol.po | 46 +- library/asyncio-task.po | 18 +- library/asyncio.po | 14 +- library/binascii.po | 56 +- library/cmdline.po | 226 +++ library/codecs.po | 994 +++++------ library/compileall.po | 120 +- library/concurrent.futures.po | 113 +- library/ctypes.po | 426 ++--- library/dataclasses.po | 140 +- library/devmode.po | 57 +- library/difflib.po | 26 +- library/dis.po | 669 +++---- library/ensurepip.po | 9 +- library/exceptions.po | 284 +-- library/functions.po | 4 +- library/gettext.po | 250 ++- library/gzip.po | 54 +- library/html.parser.po | 18 +- library/http.cookiejar.po | 13 +- library/http.server.po | 6 +- library/idle.po | 2 +- library/inspect.po | 86 +- library/json.po | 8 +- library/logging.po | 14 +- library/lzma.po | 67 +- library/multiprocessing.po | 1060 ++++++------ library/os.po | 596 ++++--- library/pickletools.po | 34 +- library/profile.po | 262 +-- library/py_compile.po | 23 +- library/re.po | 7 +- library/shutil.po | 167 +- library/site.po | 104 +- library/socket.po | 4 +- library/socketserver.po | 205 ++- library/sqlite3.po | 7 +- library/statistics.po | 387 +++-- library/symtable.po | 99 +- library/sys.monitoring.po | 4 +- library/sys.po | 8 +- library/sysconfig.po | 471 +++-- library/textwrap.po | 6 +- library/timeit.po | 4 +- library/tty.po | 12 +- library/typing.po | 552 +++--- library/urllib.error.po | 13 +- library/urllib.parse.po | 24 +- library/venv.po | 209 ++- library/weakref.po | 121 +- library/wsgiref.po | 87 +- library/xml.etree.elementtree.po | 198 +-- library/zipimport.po | 4 +- reference/compound_stmts.po | 378 ++-- reference/lexical_analysis.po | 54 +- tutorial/controlflow.po | 22 +- tutorial/floatingpoint.po | 6 +- tutorial/introduction.po | 20 +- using/cmdline.po | 131 +- using/configure.po | 103 +- using/unix.po | 25 +- using/windows.po | 72 +- whatsnew/2.0.po | 12 +- whatsnew/2.3.po | 6 +- whatsnew/2.6.po | 13 +- whatsnew/3.10.po | 30 +- whatsnew/3.11.po | 201 +-- whatsnew/3.12.po | 2792 ++++++++++++++++++------------ whatsnew/3.3.po | 17 +- whatsnew/3.4.po | 33 +- whatsnew/3.7.po | 4 +- whatsnew/3.8.po | 13 +- whatsnew/3.9.po | 773 ++++----- 89 files changed, 7549 insertions(+), 8973 deletions(-) create mode 100644 library/cmdline.po diff --git a/Makefile b/Makefile index 3f9c041ab0..4a097c90e9 100644 --- a/Makefile +++ b/Makefile @@ -105,10 +105,7 @@ endif mkdir -p "$$(dirname "$$PO")";\ if [ -f "$$PO" ];\ then\ - case "$$POT" in\ - *whatsnew*) msgmerge --lang=$(LANGUAGE) --backup=off --force-po --no-fuzzy-matching -U "$$PO" "$$POT" ;;\ - *) msgmerge --lang=$(LANGUAGE) --backup=off --force-po -U "$$PO" "$$POT" ;;\ - esac\ + msgmerge --lang=$(LANGUAGE) --backup=off --force-po -U "$$PO" "$$POT";\ else\ msgcat --lang=$(LANGUAGE) -o "$$PO" "$$POT";\ fi\ diff --git a/c-api/exceptions.po b/c-api/exceptions.po index 5a9c81c291..023dd83533 100644 --- a/c-api/exceptions.po +++ b/c-api/exceptions.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-23 00:03+0000\n" +"POT-Creation-Date: 2023-10-11 17:13+0000\n" "PO-Revision-Date: 2018-05-23 14:05+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -809,8 +809,8 @@ msgstr "" msgid "" "Implement part of the interpreter's implementation of :keyword:`!except*`. " "*orig* is the original exception that was caught, and *excs* is the list of " -"the exceptions that need to be raised. This list contains the the unhandled " -"part of *orig*, if any, as well as the exceptions that were raised from the :" +"the exceptions that need to be raised. This list contains the unhandled part " +"of *orig*, if any, as well as the exceptions that were raised from the :" "keyword:`!except*` clauses (so they have a different traceback from *orig*) " "and those that were reraised (and have the same traceback as *orig*). Return " "the :exc:`ExceptionGroup` that needs to be reraised in the end, or ``None`` " diff --git a/c-api/init_config.po b/c-api/init_config.po index ef69a88c37..b1f04e9889 100644 --- a/c-api/init_config.po +++ b/c-api/init_config.po @@ -662,7 +662,7 @@ msgstr "" #: ../../c-api/init_config.rst:548 msgid "Command line arguments: :data:`sys.argv`." -msgstr "" +msgstr "命令列引數::data:`sys.argv`。" #: ../../c-api/init_config.rst:550 msgid "" diff --git a/c-api/intro.po b/c-api/intro.po index 0808d31558..c755198b70 100644 --- a/c-api/intro.po +++ b/c-api/intro.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-09 00:03+0000\n" +"POT-Creation-Date: 2023-10-11 17:13+0000\n" "PO-Revision-Date: 2023-04-25 18:01+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -200,10 +200,25 @@ msgstr "" "macro:`Py_RETURN_NONE`),其他是更通用的工具程式。以下並不一定是完整的列表。" #: ../../c-api/intro.rst:110 +msgid "" +"Declare an extension module ``PyInit`` initialization function. The function " +"return type is :c:expr:`PyObject*`. The macro declares any special linkage " +"declarations required by the platform, and for C++ declares the function as " +"``extern \"C\"``." +msgstr "" + +#: ../../c-api/intro.rst:115 +msgid "" +"The initialization function must be named :samp:`PyInit_{name}`, where " +"*name* is the name of the module, and should be the only non-\\ ``static`` " +"item defined in the module file. Example::" +msgstr "" + +#: ../../c-api/intro.rst:134 msgid "Return the absolute value of ``x``." msgstr "回傳 ``x`` 的絕對值。" -#: ../../c-api/intro.rst:116 +#: ../../c-api/intro.rst:140 msgid "" "Ask the compiler to always inline a static inline function. The compiler can " "ignore it and decides to not inline the function." @@ -211,7 +226,7 @@ msgstr "" "要求編譯器總是嵌入靜態行內函式 (static inline function),編譯器可以忽略它並決" "定不嵌入該函式。" -#: ../../c-api/intro.rst:119 +#: ../../c-api/intro.rst:143 msgid "" "It can be used to inline performance critical static inline functions when " "building Python in debug mode with function inlining disabled. For example, " @@ -220,7 +235,7 @@ msgstr "" "在禁用函式嵌入的除錯模式下建置 Python 時,它可用於嵌入有性能要求的靜態行內函" "式。例如,MSC 在除錯模式下建置時禁用函式嵌入。" -#: ../../c-api/intro.rst:123 +#: ../../c-api/intro.rst:147 msgid "" "Marking blindly a static inline function with Py_ALWAYS_INLINE can result in " "worse performances (due to increased code size for example). The compiler is " @@ -229,7 +244,7 @@ msgstr "" "盲目地使用 Py_ALWAYS_INLINE 標記靜態行內函式可能會導致更差的性能(例如程式碼" "大小增加)。在成本/收益分析方面,編譯器通常比開發人員更聰明。" -#: ../../c-api/intro.rst:127 +#: ../../c-api/intro.rst:151 msgid "" "If Python is :ref:`built in debug mode ` (if the ``Py_DEBUG`` " "macro is defined), the :c:macro:`Py_ALWAYS_INLINE` macro does nothing." @@ -237,14 +252,14 @@ msgstr "" "如果 Python 是\\ :ref:`在除錯模式下建置 `\\ (如果 ``Py_DEBUG`` " "巨集有被定義),:c:macro:`Py_ALWAYS_INLINE` 巨集就什麼都不會做。" -#: ../../c-api/intro.rst:130 +#: ../../c-api/intro.rst:154 msgid "It must be specified before the function return type. Usage::" msgstr "" "它必須在函式回傳型別之前被指定。用法:\n" "\n" "::" -#: ../../c-api/intro.rst:138 +#: ../../c-api/intro.rst:162 msgid "" "Argument must be a character or an integer in the range [-128, 127] or [0, " "255]. This macro returns ``c`` cast to an ``unsigned char``." @@ -252,25 +267,25 @@ msgstr "" "引數必須是 [-128, 127] 或 [0, 255] 範圍內的字元或整數。這個巨集會將 ``c`` 轉" "換為 ``unsigned char`` 並回傳。" -#: ../../c-api/intro.rst:143 +#: ../../c-api/intro.rst:167 msgid "" "Use this for deprecated declarations. The macro must be placed before the " "symbol name." msgstr "將其用於已棄用的聲明。巨集必須放在符號名稱之前。" -#: ../../c-api/intro.rst:146 ../../c-api/intro.rst:232 -#: ../../c-api/intro.rst:250 +#: ../../c-api/intro.rst:170 ../../c-api/intro.rst:256 +#: ../../c-api/intro.rst:274 msgid "Example::" msgstr "" "範例:\n" "\n" "::" -#: ../../c-api/intro.rst:150 +#: ../../c-api/intro.rst:174 msgid "MSVC support was added." msgstr "新增了 MSVC 支援。" -#: ../../c-api/intro.rst:155 +#: ../../c-api/intro.rst:179 msgid "" "Like ``getenv(s)``, but returns ``NULL`` if :option:`-E` was passed on the " "command line (see :c:member:`PyConfig.use_environment`)." @@ -278,19 +293,19 @@ msgstr "" "類似於 ``getenv(s)``,但如果在命令列上傳遞了 :option:`-E` 則回傳 ``NULL`` " "(請見 :c:member:`PyConfig.use_environment`)。" -#: ../../c-api/intro.rst:160 +#: ../../c-api/intro.rst:184 msgid "Return the maximum value between ``x`` and ``y``." msgstr "回傳 ``x`` 和 ``y`` 之間的最大值。" -#: ../../c-api/intro.rst:166 +#: ../../c-api/intro.rst:190 msgid "Return the size of a structure (``type``) ``member`` in bytes." msgstr "以位元組為單位回傳結構 (``type``) ``member`` 的大小。" -#: ../../c-api/intro.rst:172 +#: ../../c-api/intro.rst:196 msgid "Return the minimum value between ``x`` and ``y``." msgstr "回傳 ``x`` 和 ``y`` 之間的最小值。" -#: ../../c-api/intro.rst:178 +#: ../../c-api/intro.rst:202 msgid "" "Disable inlining on a function. For example, it reduces the C stack " "consumption: useful on LTO+PGO builds which heavily inline code (see :issue:" @@ -299,20 +314,20 @@ msgstr "" "禁用函式的嵌入。例如,它減少了 C 堆疊的消耗:對大量嵌入程式碼的 LTO+PGO 建置" "很有用(請參閱 :issue:`33720`)。" -#: ../../c-api/intro.rst:182 +#: ../../c-api/intro.rst:206 msgid "Usage::" msgstr "" "用法:\n" "\n" "::" -#: ../../c-api/intro.rst:190 +#: ../../c-api/intro.rst:214 msgid "" "Convert ``x`` to a C string. E.g. ``Py_STRINGIFY(123)`` returns ``\"123\"``." msgstr "" "將 ``x`` 轉換為 C 字串。例如 ``Py_STRINGIFY(123)`` 會回傳 ``\"123\"``。" -#: ../../c-api/intro.rst:197 +#: ../../c-api/intro.rst:221 msgid "" "Use this when you have a code path that cannot be reached by design. For " "example, in the ``default:`` clause in a ``switch`` statement for which all " @@ -323,7 +338,7 @@ msgstr "" "蓋了所有可能值的 ``switch`` 陳述式中的 ``default:`` 子句。在你可能想要呼叫 " "``assert(0)`` 或 ``abort()`` 的地方使用它。" -#: ../../c-api/intro.rst:202 +#: ../../c-api/intro.rst:226 msgid "" "In release mode, the macro helps the compiler to optimize the code, and " "avoids a warning about unreachable code. For example, the macro is " @@ -333,7 +348,7 @@ msgstr "" "程式碼的警告。例如該巨集是在發布模式下於 GCC 使用 " "``__builtin_unreachable()`` 來實作。" -#: ../../c-api/intro.rst:206 +#: ../../c-api/intro.rst:230 msgid "" "A use for ``Py_UNREACHABLE()`` is following a call a function that never " "returns but that is not declared :c:macro:`_Py_NO_RETURN`." @@ -341,7 +356,7 @@ msgstr "" "``Py_UNREACHABLE()`` 的一個用途是,在對一個永不回傳但並未聲明為 :c:macro:" "`_Py_NO_RETURN` 的函式之呼叫後使用。" -#: ../../c-api/intro.rst:209 +#: ../../c-api/intro.rst:233 msgid "" "If a code path is very unlikely code but can be reached under exceptional " "case, this macro must not be used. For example, under low memory condition " @@ -353,7 +368,7 @@ msgstr "" "憶體條件下或系統呼叫回傳了超出預期範圍的值。在這種情況下,最好將錯誤回報給呼" "叫者。如果無法回報錯誤則可以使用 :c:func:`Py_FatalError`。" -#: ../../c-api/intro.rst:219 +#: ../../c-api/intro.rst:243 msgid "" "Use this for unused arguments in a function definition to silence compiler " "warnings. Example: ``int func(int a, int Py_UNUSED(b)) { return a; }``." @@ -361,7 +376,7 @@ msgstr "" "將此用於函式定義中未使用的參數以消除編譯器警告。例如:``int func(int a, int " "Py_UNUSED(b)) { return a; }``。" -#: ../../c-api/intro.rst:226 +#: ../../c-api/intro.rst:250 msgid "" "Creates a variable with name ``name`` that can be used in docstrings. If " "Python is built without docstrings, the value will be empty." @@ -369,7 +384,7 @@ msgstr "" "建立一個名為 ``name`` 的變數,可以在文件字串中使用。如果 Python 是在沒有文件" "字串的情況下建置,則該值將為空。" -#: ../../c-api/intro.rst:229 +#: ../../c-api/intro.rst:253 msgid "" "Use :c:macro:`PyDoc_STRVAR` for docstrings to support building Python " "without docstrings, as specified in :pep:`7`." @@ -377,13 +392,13 @@ msgstr "" "如 :pep:`7` 中所指明,使用 :c:macro:`PyDoc_STRVAR` 作為文件字串可以支援在沒有" "文件字串的情況下建置 Python。" -#: ../../c-api/intro.rst:244 +#: ../../c-api/intro.rst:268 msgid "" "Creates a docstring for the given input string or an empty string if " "docstrings are disabled." msgstr "為給定的輸入字串建立一個文件字串,如果文件字串被禁用則建立空字串。" -#: ../../c-api/intro.rst:247 +#: ../../c-api/intro.rst:271 msgid "" "Use :c:macro:`PyDoc_STR` in specifying docstrings to support building Python " "without docstrings, as specified in :pep:`7`." @@ -391,11 +406,11 @@ msgstr "" "如 :pep:`7` 中所指明,使用 :c:macro:`PyDoc_STR` 指定文件字串以支援在沒有文件" "字串下建置 Python。" -#: ../../c-api/intro.rst:262 +#: ../../c-api/intro.rst:286 msgid "Objects, Types and Reference Counts" msgstr "物件、型別和參照計數" -#: ../../c-api/intro.rst:266 +#: ../../c-api/intro.rst:290 msgid "" "Most Python/C API functions have one or more arguments as well as a return " "value of type :c:expr:`PyObject*`. This type is a pointer to an opaque data " @@ -418,7 +433,7 @@ msgstr "" "別物件;由於它們絕不能被釋放,因此它們通常是靜態 :c:type:`PyTypeObject` 物" "件。" -#: ../../c-api/intro.rst:277 +#: ../../c-api/intro.rst:301 msgid "" "All Python objects (even Python integers) have a :dfn:`type` and a :dfn:" "`reference count`. An object's type determines what kind of object it is (e." @@ -434,11 +449,11 @@ msgstr "" "`types`\\ )。對於每個眾所周知的型別,都有一個巨集來檢查物件是否屬於該型別;" "例如,若(且唯若)*a* 指向的物件是 Python list 時,``PyList_Check(a)`` 為真。" -#: ../../c-api/intro.rst:288 +#: ../../c-api/intro.rst:312 msgid "Reference Counts" msgstr "參照計數" -#: ../../c-api/intro.rst:290 +#: ../../c-api/intro.rst:314 msgid "" "The reference count is important because today's computers have a finite " "(and often severely limited) memory size; it counts how many different " @@ -461,7 +476,7 @@ msgstr "" "則可以依次為那些其他物件解除配置,依此類推。 (此處相互參照物件的存在是個明顯" "的問題;目前,解決方案是「就不要那樣做」。)" -#: ../../c-api/intro.rst:307 +#: ../../c-api/intro.rst:331 msgid "" "Reference counts are always manipulated explicitly. The normal way is to " "use the macro :c:func:`Py_INCREF` to take a new reference to an object (i.e. " @@ -489,7 +504,7 @@ msgstr "" "元會被使用(假設 ``sizeof(Py_ssize_t) >= sizeof(void*)``)。因此參照計數增加" "是一個簡單的操作。" -#: ../../c-api/intro.rst:323 +#: ../../c-api/intro.rst:347 msgid "" "It is not necessary to hold a :term:`strong reference` (i.e. increment the " "reference count) for every local variable that contains a pointer to an " @@ -515,7 +530,7 @@ msgstr "" "種情況的一個重要情況是在從 Python 呼叫的擴充模組中作為引數傳遞給 C 函式的物" "件;呼叫機制保證在呼叫期間保持對每個參數的參照。" -#: ../../c-api/intro.rst:339 +#: ../../c-api/intro.rst:363 msgid "" "However, a common pitfall is to extract an object from a list and hold on to " "it for a while without taking a new reference. Some other operation might " @@ -531,7 +546,7 @@ msgstr "" "程式碼路徑允許控制權從 :c:func:`Py_DECREF` 回歸使用者,因此幾乎任何操作都有潛" "在危險。" -#: ../../c-api/intro.rst:347 +#: ../../c-api/intro.rst:371 msgid "" "A safe approach is to always use the generic operations (functions whose " "name begins with ``PyObject_``, ``PyNumber_``, ``PySequence_`` or " @@ -546,11 +561,11 @@ msgstr "" "計數)。這讓呼叫者有責任在處理完結果後呼叫 :c:func:`Py_DECREF`;這就成為第二" "本質。" -#: ../../c-api/intro.rst:358 +#: ../../c-api/intro.rst:382 msgid "Reference Count Details" msgstr "參照計數詳細資訊" -#: ../../c-api/intro.rst:360 +#: ../../c-api/intro.rst:384 msgid "" "The reference count behavior of functions in the Python/C API is best " "explained in terms of *ownership of references*. Ownership pertains to " @@ -575,7 +590,7 @@ msgstr "" "照。當沒有所有權轉移時,呼叫者被稱為\\ *借用*\\ 參照。如果是\\ :term:`借用參" "照 `\\ 就不需要做任何事情。" -#: ../../c-api/intro.rst:373 +#: ../../c-api/intro.rst:397 msgid "" "Conversely, when a calling function passes in a reference to an object, " "there are two possibilities: the function *steals* a reference to the " @@ -587,7 +602,7 @@ msgstr "" "物件的參照,或者沒有。 *竊取參照*\\ 意味著當你將參照傳遞給函式時,該函式假定" "它現在擁有該參照,並且你不再對它負責。" -#: ../../c-api/intro.rst:383 +#: ../../c-api/intro.rst:407 msgid "" "Few functions steal references; the two notable exceptions are :c:func:" "`PyList_SetItem` and :c:func:`PyTuple_SetItem`, which steal a reference to " @@ -604,7 +619,7 @@ msgstr "" "慣,這些函式旨在竊取參照;例如,建立 tuple ``(1, 2, \"three\")`` 的程式碼可以" "如下所示(先暫時忘記錯誤處理;更好的編寫方式如下所示):" -#: ../../c-api/intro.rst:398 +#: ../../c-api/intro.rst:422 msgid "" "Here, :c:func:`PyLong_FromLong` returns a new reference which is immediately " "stolen by :c:func:`PyTuple_SetItem`. When you want to keep using an object " @@ -615,7 +630,7 @@ msgstr "" "`PyTuple_SetItem` 竊取。如果你想繼續使用一個物件,儘管對它的參照將被竊取,請" "在呼叫參照竊取函式之前使用 :c:func:`Py_INCREF` 來獲取另一個參照。" -#: ../../c-api/intro.rst:403 +#: ../../c-api/intro.rst:427 msgid "" "Incidentally, :c:func:`PyTuple_SetItem` is the *only* way to set tuple " "items; :c:func:`PySequence_SetItem` and :c:func:`PyObject_SetItem` refuse to " @@ -627,7 +642,7 @@ msgstr "" "tuple 是一種不可變 (immutable) 的資料型別。你應該只對你自己建立的 tuple 使" "用 :c:func:`PyTuple_SetItem`。" -#: ../../c-api/intro.rst:408 +#: ../../c-api/intro.rst:432 msgid "" "Equivalent code for populating a list can be written using :c:func:" "`PyList_New` and :c:func:`PyList_SetItem`." @@ -635,7 +650,7 @@ msgstr "" "可以使用 :c:func:`PyList_New` 和 :c:func:`PyList_SetItem` 編寫用於填充列表的" "等效程式碼。" -#: ../../c-api/intro.rst:411 +#: ../../c-api/intro.rst:435 msgid "" "However, in practice, you will rarely use these ways of creating and " "populating a tuple or list. There's a generic function, :c:func:" @@ -650,7 +665,7 @@ msgstr "" "\n" "::" -#: ../../c-api/intro.rst:422 +#: ../../c-api/intro.rst:446 msgid "" "It is much more common to use :c:func:`PyObject_SetItem` and friends with " "items whose references you are only borrowing, like arguments that were " @@ -665,7 +680,7 @@ msgstr "" "穩健,因為你不取得新的一個參照就可以放棄參照(「讓它被竊取」)。例如,此函式" "將 list(實際上是任何可變序列)的所有項目設定於給定項目:" -#: ../../c-api/intro.rst:452 +#: ../../c-api/intro.rst:476 msgid "" "The situation is slightly different for function return values. While " "passing a reference to most functions does not change your ownership " @@ -683,7 +698,7 @@ msgstr "" "照的通用函式,如 :c:func:`PyObject_GetItem` 和 :c:func:`PySequence_GetItem`," "總是回傳一個新的參照(呼叫者成為參照的所有者)。" -#: ../../c-api/intro.rst:461 +#: ../../c-api/intro.rst:485 msgid "" "It is important to realize that whether you own a reference returned by a " "function depends on which function you call only --- *the plumage* (the type " @@ -699,7 +714,7 @@ msgstr "" "如果你使用 :c:func:`PySequence_GetItem` 從同一 list 中獲取相同的項目(且恰好" "使用完全相同的引數),你確實會擁有對回傳物件的參照。" -#: ../../c-api/intro.rst:473 +#: ../../c-api/intro.rst:497 msgid "" "Here is an example of how you could write a function that computes the sum " "of the items in a list of integers; once using :c:func:`PyList_GetItem`, " @@ -710,11 +725,11 @@ msgstr "" "\n" "::" -#: ../../c-api/intro.rst:537 +#: ../../c-api/intro.rst:561 msgid "Types" msgstr "型別" -#: ../../c-api/intro.rst:539 +#: ../../c-api/intro.rst:563 msgid "" "There are few other data types that play a significant role in the Python/C " "API; most are simple C types such as :c:expr:`int`, :c:expr:`long`, :c:expr:" @@ -729,7 +744,7 @@ msgstr "" "一些結構型別被用於描述用於列出模組所匯出的函式或新物件型別的資料屬性的靜態" "表,其他則用於描述複數的值。這些將與使用它們的函式一起討論。" -#: ../../c-api/intro.rst:549 +#: ../../c-api/intro.rst:573 msgid "" "A signed integral type such that ``sizeof(Py_ssize_t) == sizeof(size_t)``. " "C99 doesn't define such a thing directly (size_t is an unsigned integral " @@ -740,11 +755,11 @@ msgstr "" "有直接定義這樣的東西(size_t 是無符號整數型別)。有關詳細資訊,請參閱 :pep:" "`353`。 ``PY_SSIZE_T_MAX`` 是 :c:type:`Py_ssize_t` 型別的最大正值。" -#: ../../c-api/intro.rst:558 +#: ../../c-api/intro.rst:582 msgid "Exceptions" msgstr "例外" -#: ../../c-api/intro.rst:560 +#: ../../c-api/intro.rst:584 msgid "" "The Python programmer only needs to deal with exceptions if specific error " "handling is required; unhandled exceptions are automatically propagated to " @@ -756,7 +771,7 @@ msgstr "" "給呼叫者,然後傳遞給呼叫者的呼叫者,依此類推,直到它們到達頂層直譯器,在那裡" "它們透過堆疊回溯 (stack trace) 回報給使用者。" -#: ../../c-api/intro.rst:568 +#: ../../c-api/intro.rst:592 msgid "" "For C programmers, however, error checking always has to be explicit. All " "functions in the Python/C API can raise exceptions, unless an explicit claim " @@ -778,7 +793,7 @@ msgstr "" "確的錯誤指示器或者有不明確的回傳值,而需要使用 :c:func:`PyErr_Occurred` 明確" "測試錯誤。這些例外都會被明確地記錄於文件。" -#: ../../c-api/intro.rst:583 +#: ../../c-api/intro.rst:607 msgid "" "Exception state is maintained in per-thread storage (this is equivalent to " "using global storage in an unthreaded application). A thread can be in one " @@ -797,7 +812,7 @@ msgstr "" "func:`PyErr_SetString` 是最常見的(儘管不是最通用的)設定例外狀態的函式,而 :" "c:func:`PyErr_Clear` 是用來清除例外狀態。" -#: ../../c-api/intro.rst:593 +#: ../../c-api/intro.rst:617 msgid "" "The full exception state consists of three objects (all of which can be " "``NULL``): the exception type, the corresponding exception value, and the " @@ -816,7 +831,7 @@ msgstr "" "達 Python 位元組碼直譯器的主迴圈,該迴圈負責將它傳遞給 ``sys.exc_info()`` 和" "其系列函式。" -#: ../../c-api/intro.rst:605 +#: ../../c-api/intro.rst:629 msgid "" "Note that starting with Python 1.5, the preferred, thread-safe way to access " "the exception state from Python code is to call the function :func:`sys." @@ -836,7 +851,7 @@ msgstr "" "式碼中的常見錯誤,這些錯誤是由看似無辜的函式覆蓋了正在處理的例外而引起的;它" "還替回溯中被堆疊幀 (stack frame) 參照的物件減少了通常不需要的生命週期延長。" -#: ../../c-api/intro.rst:616 +#: ../../c-api/intro.rst:640 msgid "" "As a general principle, a function that calls another function to perform " "some task should check whether the called function raised an exception, and " @@ -851,7 +866,7 @@ msgstr "" "並回傳一個錯誤指示符,但它\\ *不應該*\\ 設定另一個例外 --- 這將覆蓋剛剛引發的" "例外,並丟失關於錯誤確切原因的重要資訊。" -#: ../../c-api/intro.rst:625 +#: ../../c-api/intro.rst:649 msgid "" "A simple example of detecting exceptions and passing them on is shown in " "the :c:func:`!sum_sequence` example above. It so happens that this example " @@ -865,11 +880,11 @@ msgstr "" "\n" "::" -#: ../../c-api/intro.rst:640 +#: ../../c-api/intro.rst:664 msgid "Here is the corresponding C code, in all its glory::" msgstr "這是相應的 C 程式碼:" -#: ../../c-api/intro.rst:692 +#: ../../c-api/intro.rst:716 msgid "" "This example represents an endorsed use of the ``goto`` statement in C! It " "illustrates the use of :c:func:`PyErr_ExceptionMatches` and :c:func:" @@ -888,11 +903,11 @@ msgstr "" "於保存擁有的參照的變數被初始化為 ``NULL`` 以使其能夠順利作用;同樣地,回傳值" "被初始化為 ``-1``\\ (失敗),並且僅在最後一次呼叫成功後才設定為成功。" -#: ../../c-api/intro.rst:706 +#: ../../c-api/intro.rst:730 msgid "Embedding Python" msgstr "嵌入式Python" -#: ../../c-api/intro.rst:708 +#: ../../c-api/intro.rst:732 msgid "" "The one important task that only embedders (as opposed to extension writers) " "of the Python interpreter have to worry about is the initialization, and " @@ -902,7 +917,7 @@ msgstr "" "只有 Python 直譯器的嵌入者(而不是擴充編寫者)需要擔心的一項重要任務是 " "Python 直譯器的初始化與完成階段。直譯器的大部分功能只能在直譯器初始化後使用。" -#: ../../c-api/intro.rst:721 +#: ../../c-api/intro.rst:745 msgid "" "The basic initialization function is :c:func:`Py_Initialize`. This " "initializes the table of loaded modules, and creates the fundamental " @@ -913,7 +928,7 @@ msgstr "" "立基礎模組 :mod:`builtins`、:mod:`__main__` 和 :mod:`sys`。它還會初始化模組搜" "索路徑 (``sys.path``)。" -#: ../../c-api/intro.rst:726 +#: ../../c-api/intro.rst:750 msgid "" ":c:func:`Py_Initialize` does not set the \"script argument list\" (``sys." "argv``). If this variable is needed by Python code that will be executed " @@ -925,7 +940,7 @@ msgstr "" "`PyConfig.argv` 和 :c:member:`PyConfig.parse_argv`,請見 :ref:`Python 初始化" "配置 `。" -#: ../../c-api/intro.rst:731 +#: ../../c-api/intro.rst:755 msgid "" "On most systems (in particular, on Unix and Windows, although the details " "are slightly different), :c:func:`Py_Initialize` calculates the module " @@ -943,7 +958,7 @@ msgstr "" "file:`python` 的可執行檔案,並在其父目錄中查找一個名為 :file:`lib/python{X.Y}" "` 的目錄的相對位置。" -#: ../../c-api/intro.rst:740 +#: ../../c-api/intro.rst:764 msgid "" "For instance, if the Python executable is found in :file:`/usr/local/bin/" "python`, it will assume that the libraries are in :file:`/usr/local/lib/" @@ -960,7 +975,7 @@ msgstr "" "`PYTHONHOME`,或者透過設定 :envvar:`PYTHONPATH` 在標準路徑前面插入額外的目" "錄。" -#: ../../c-api/intro.rst:755 +#: ../../c-api/intro.rst:779 msgid "" "The embedding application can steer the search by calling " "``Py_SetProgramName(file)`` *before* calling :c:func:`Py_Initialize`. Note " @@ -977,7 +992,7 @@ msgstr "" "`Py_GetExecPrefix` 和 :c:func:`Py_GetProgramFullPath`\\(全部定義在 :file:" "`Modules/getpath.c`)。" -#: ../../c-api/intro.rst:765 +#: ../../c-api/intro.rst:789 msgid "" "Sometimes, it is desirable to \"uninitialize\" Python. For instance, the " "application may want to start over (make another call to :c:func:" @@ -998,11 +1013,11 @@ msgstr "" "`Py_FinalizeEx` *不會*\\ 釋放由 Python 直譯器分配的所有記憶體,例如目前無法釋" "放被擴充模組所分配的記憶體。" -#: ../../c-api/intro.rst:779 +#: ../../c-api/intro.rst:803 msgid "Debugging Builds" msgstr "除錯建置" -#: ../../c-api/intro.rst:781 +#: ../../c-api/intro.rst:805 msgid "" "Python can be built with several macros to enable extra checks of the " "interpreter and extension modules. These checks tend to add a large amount " @@ -1011,7 +1026,7 @@ msgstr "" "Python 可以在建置時使用多個巨集來啟用對直譯器和擴充模組的額外檢查,這些檢查往" "往會在執行環境 (runtime) 增加大量開銷 (overhead),因此預設情況下不啟用它們。" -#: ../../c-api/intro.rst:785 +#: ../../c-api/intro.rst:809 msgid "" "A full list of the various types of debugging builds is in the file :file:" "`Misc/SpecialBuilds.txt` in the Python source distribution. Builds are " @@ -1024,7 +1039,7 @@ msgstr "" "錯構置的完整列表,為支援追蹤參照計數、為記憶體分配器除錯或對主直譯器迴圈進行" "低階分析的建置。本節的其餘部分將僅描述最常用的建置。" -#: ../../c-api/intro.rst:791 +#: ../../c-api/intro.rst:815 msgid "" "Compiling the interpreter with the :c:macro:`Py_DEBUG` macro defined " "produces what is generally meant by :ref:`a debug build of Python `." @@ -1048,7 +1063,7 @@ msgstr "" "除了下面描述的參照計數除錯之外,還會執行額外的檢查,請參閱 :ref:`Python 除錯" "建置 `。" -#: ../../c-api/intro.rst:802 +#: ../../c-api/intro.rst:826 msgid "" "Defining :c:macro:`Py_TRACE_REFS` enables reference tracing (see the :option:" "`configure --with-trace-refs option <--with-trace-refs>`). When defined, a " @@ -1063,7 +1078,7 @@ msgstr "" "linked list)。全體分配也有被追蹤。退出時將印出所有現行參照。(在交互模式下," "這發生在直譯器運行的每個陳述句之後。)" -#: ../../c-api/intro.rst:809 +#: ../../c-api/intro.rst:833 msgid "" "Please refer to :file:`Misc/SpecialBuilds.txt` in the Python source " "distribution for more detailed information." @@ -1071,130 +1086,130 @@ msgstr "" "有關更多詳細資訊,請參閱 Python 原始碼發布版中的 :file:`Misc/SpecialBuilds." "txt`。" -#: ../../c-api/intro.rst:264 +#: ../../c-api/intro.rst:288 msgid "object" msgstr "object(物件)" -#: ../../c-api/intro.rst:264 +#: ../../c-api/intro.rst:288 msgid "type" msgstr "type(型別)" -#: ../../c-api/intro.rst:303 +#: ../../c-api/intro.rst:327 msgid "Py_INCREF()" msgstr "Py_INCREF()" -#: ../../c-api/intro.rst:303 +#: ../../c-api/intro.rst:327 msgid "Py_DECREF()" msgstr "Py_DECREF()" -#: ../../c-api/intro.rst:379 +#: ../../c-api/intro.rst:403 msgid "PyList_SetItem()" msgstr "PyList_SetItem()" -#: ../../c-api/intro.rst:379 +#: ../../c-api/intro.rst:403 msgid "PyTuple_SetItem()" msgstr "PyTuple_SetItem()" -#: ../../c-api/intro.rst:450 +#: ../../c-api/intro.rst:474 msgid "set_all()" msgstr "set_all()" -#: ../../c-api/intro.rst:469 +#: ../../c-api/intro.rst:493 msgid "PyList_GetItem()" msgstr "PyList_GetItem()" -#: ../../c-api/intro.rst:469 +#: ../../c-api/intro.rst:493 msgid "PySequence_GetItem()" msgstr "PySequence_GetItem()" -#: ../../c-api/intro.rst:499 +#: ../../c-api/intro.rst:523 msgid "sum_list()" msgstr "sum_list()" -#: ../../c-api/intro.rst:531 ../../c-api/intro.rst:623 +#: ../../c-api/intro.rst:555 ../../c-api/intro.rst:647 msgid "sum_sequence()" msgstr "sum_sequence()" -#: ../../c-api/intro.rst:566 +#: ../../c-api/intro.rst:590 msgid "PyErr_Occurred()" msgstr "PyErr_Occurred()" -#: ../../c-api/intro.rst:579 +#: ../../c-api/intro.rst:603 msgid "PyErr_SetString()" msgstr "PyErr_SetString()" -#: ../../c-api/intro.rst:579 ../../c-api/intro.rst:687 +#: ../../c-api/intro.rst:603 ../../c-api/intro.rst:711 msgid "PyErr_Clear()" msgstr "PyErr_Clear()" -#: ../../c-api/intro.rst:603 +#: ../../c-api/intro.rst:627 msgid "exc_info() (in module sys)" msgstr "exc_info() (sys 模組中)" -#: ../../c-api/intro.rst:638 ../../c-api/intro.rst:685 +#: ../../c-api/intro.rst:662 ../../c-api/intro.rst:709 msgid "incr_item()" msgstr "incr_item()" -#: ../../c-api/intro.rst:687 +#: ../../c-api/intro.rst:711 msgid "PyErr_ExceptionMatches()" msgstr "PyErr_ExceptionMatches()" -#: ../../c-api/intro.rst:687 +#: ../../c-api/intro.rst:711 msgid "Py_XDECREF()" msgstr "Py_XDECREF()" -#: ../../c-api/intro.rst:713 +#: ../../c-api/intro.rst:737 msgid "Py_Initialize()" msgstr "Py_Initialize()" -#: ../../c-api/intro.rst:713 +#: ../../c-api/intro.rst:737 msgid "module" msgstr "module(模組)" -#: ../../c-api/intro.rst:713 +#: ../../c-api/intro.rst:737 msgid "builtins" msgstr "builtins(內建)" -#: ../../c-api/intro.rst:713 +#: ../../c-api/intro.rst:737 msgid "__main__" msgstr "__main__" -#: ../../c-api/intro.rst:713 +#: ../../c-api/intro.rst:737 msgid "sys" msgstr "sys" -#: ../../c-api/intro.rst:713 +#: ../../c-api/intro.rst:737 msgid "search" msgstr "search(搜尋)" -#: ../../c-api/intro.rst:713 +#: ../../c-api/intro.rst:737 msgid "path" msgstr "path(路徑)" -#: ../../c-api/intro.rst:713 +#: ../../c-api/intro.rst:737 msgid "path (in module sys)" msgstr "path(sys 模組中)" -#: ../../c-api/intro.rst:748 +#: ../../c-api/intro.rst:772 msgid "Py_SetProgramName()" msgstr "Py_SetProgramName()" -#: ../../c-api/intro.rst:748 +#: ../../c-api/intro.rst:772 msgid "Py_GetPath()" msgstr "Py_GetPath()" -#: ../../c-api/intro.rst:748 +#: ../../c-api/intro.rst:772 msgid "Py_GetPrefix()" msgstr "Py_GetPrefix()" -#: ../../c-api/intro.rst:748 +#: ../../c-api/intro.rst:772 msgid "Py_GetExecPrefix()" msgstr "Py_GetExecPrefix()" -#: ../../c-api/intro.rst:748 +#: ../../c-api/intro.rst:772 msgid "Py_GetProgramFullPath()" msgstr "Py_GetProgramFullPath()" -#: ../../c-api/intro.rst:763 +#: ../../c-api/intro.rst:787 msgid "Py_IsInitialized()" msgstr "Py_IsInitialized()" diff --git a/c-api/structures.po b/c-api/structures.po index 5eb3082c9e..d4029f1aec 100644 --- a/c-api/structures.po +++ b/c-api/structures.po @@ -1,5 +1,4 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2022, Python Software Foundation +# Copyright (C) 2001-2023, Python Software Foundation # This file is distributed under the same license as the Python package. # # Translators: @@ -8,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-29 00:03+0000\n" +"POT-Creation-Date: 2023-10-14 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-" @@ -414,41 +413,46 @@ msgstr "" #: ../../c-api/structures.rst:408 msgid "" "Structure which describes an attribute of a type which corresponds to a C " -"struct member. Its fields are, in order:" +"struct member. When defining a class, put a NULL-terminated array of these " +"structures in the :c:member:`~PyTypeObject.tp_members` slot." msgstr "" #: ../../c-api/structures.rst:413 +msgid "Its fields are, in order:" +msgstr "" + +#: ../../c-api/structures.rst:417 msgid "" "Name of the member. A NULL value marks the end of a ``PyMemberDef[]`` array." msgstr "" -#: ../../c-api/structures.rst:416 +#: ../../c-api/structures.rst:420 msgid "The string should be static, no copy is made of it." msgstr "" -#: ../../c-api/structures.rst:420 +#: ../../c-api/structures.rst:424 msgid "" "The offset in bytes that the member is located on the type’s object struct." msgstr "" -#: ../../c-api/structures.rst:424 +#: ../../c-api/structures.rst:428 msgid "" "The type of the member in the C struct. See :ref:`PyMemberDef-types` for the " "possible values." msgstr "" -#: ../../c-api/structures.rst:429 +#: ../../c-api/structures.rst:433 msgid "" "Zero or more of the :ref:`PyMemberDef-flags`, combined using bitwise OR." msgstr "" -#: ../../c-api/structures.rst:433 +#: ../../c-api/structures.rst:437 msgid "" "The docstring, or NULL. The string should be static, no copy is made of it. " "Typically, it is defined using :c:macro:`PyDoc_STR`." msgstr "" -#: ../../c-api/structures.rst:437 +#: ../../c-api/structures.rst:441 msgid "" "By default (when :c:member:`~PyMemberDef.flags` is ``0``), members allow " "both read and write access. Use the :c:macro:`Py_READONLY` flag for read-" @@ -457,7 +461,7 @@ msgid "" "`T_OBJECT`) members can be deleted." msgstr "" -#: ../../c-api/structures.rst:446 +#: ../../c-api/structures.rst:450 msgid "" "For heap-allocated types (created using :c:func:`PyType_FromSpec` or " "similar), ``PyMemberDef`` may contain a definition for the special member " @@ -466,11 +470,11 @@ msgid "" "``Py_T_PYSSIZET`` and ``Py_READONLY``, for example::" msgstr "" -#: ../../c-api/structures.rst:458 +#: ../../c-api/structures.rst:462 msgid "(You may need to ``#include `` for :c:func:`!offsetof`.)" msgstr "" -#: ../../c-api/structures.rst:460 +#: ../../c-api/structures.rst:464 msgid "" "The legacy offsets :c:member:`~PyTypeObject.tp_dictoffset` and :c:member:" "`~PyTypeObject.tp_weaklistoffset` can be defined similarly using " @@ -479,77 +483,77 @@ msgid "" "and :c:macro:`Py_TPFLAGS_MANAGED_WEAKREF` instead." msgstr "" -#: ../../c-api/structures.rst:468 +#: ../../c-api/structures.rst:472 msgid "" "``PyMemberDef`` is always available. Previously, it required including " "``\"structmember.h\"``." msgstr "" -#: ../../c-api/structures.rst:473 +#: ../../c-api/structures.rst:477 msgid "" "Get an attribute belonging to the object at address *obj_addr*. The " "attribute is described by ``PyMemberDef`` *m*. Returns ``NULL`` on error." msgstr "" -#: ../../c-api/structures.rst:479 +#: ../../c-api/structures.rst:483 msgid "" "``PyMember_GetOne`` is always available. Previously, it required including " "``\"structmember.h\"``." msgstr "" -#: ../../c-api/structures.rst:484 +#: ../../c-api/structures.rst:488 msgid "" "Set an attribute belonging to the object at address *obj_addr* to object " "*o*. The attribute to set is described by ``PyMemberDef`` *m*. Returns " "``0`` if successful and a negative value on failure." msgstr "" -#: ../../c-api/structures.rst:490 +#: ../../c-api/structures.rst:494 msgid "" "``PyMember_SetOne`` is always available. Previously, it required including " "``\"structmember.h\"``." msgstr "" -#: ../../c-api/structures.rst:496 +#: ../../c-api/structures.rst:500 msgid "Member flags" msgstr "" -#: ../../c-api/structures.rst:498 +#: ../../c-api/structures.rst:502 msgid "The following flags can be used with :c:member:`PyMemberDef.flags`:" msgstr "" -#: ../../c-api/structures.rst:502 +#: ../../c-api/structures.rst:506 msgid "Not writable." msgstr "" -#: ../../c-api/structures.rst:506 +#: ../../c-api/structures.rst:510 msgid "" "Emit an ``object.__getattr__`` :ref:`audit event ` before " "reading." msgstr "" -#: ../../c-api/structures.rst:511 +#: ../../c-api/structures.rst:515 msgid "" "Indicates that the :c:member:`~PyMemberDef.offset` of this ``PyMemberDef`` " "entry indicates an offset from the subclass-specific data, rather than from " "``PyObject``." msgstr "" -#: ../../c-api/structures.rst:515 +#: ../../c-api/structures.rst:519 msgid "" "Can only be used as part of :c:member:`Py_tp_members ` :c:type:`slot ` when creating a class using " "negative :c:member:`~PyType_Spec.basicsize`. It is mandatory in that case." msgstr "" -#: ../../c-api/structures.rst:520 +#: ../../c-api/structures.rst:524 msgid "" "This flag is only used in :c:type:`PyTypeSlot`. When setting :c:member:" "`~PyTypeObject.tp_members` during class creation, Python clears it and sets :" "c:member:`PyMemberDef.offset` to the offset from the ``PyObject`` struct." msgstr "" -#: ../../c-api/structures.rst:532 +#: ../../c-api/structures.rst:536 msgid "" "The :c:macro:`!RESTRICTED`, :c:macro:`!READ_RESTRICTED` and :c:macro:`!" "WRITE_RESTRICTED` macros available with ``#include \"structmember.h\"`` are " @@ -558,7 +562,7 @@ msgid "" "nothing." msgstr "" -#: ../../c-api/structures.rst:543 +#: ../../c-api/structures.rst:547 msgid "" "The :c:macro:`!READONLY` macro was renamed to :c:macro:`Py_READONLY`. The :c:" "macro:`!PY_AUDIT_READ` macro was renamed with the ``Py_`` prefix. The new " @@ -567,11 +571,11 @@ msgid "" "names." msgstr "" -#: ../../c-api/structures.rst:552 +#: ../../c-api/structures.rst:556 msgid "Member types" msgstr "" -#: ../../c-api/structures.rst:554 +#: ../../c-api/structures.rst:558 msgid "" ":c:member:`PyMemberDef.type` can be one of the following macros " "corresponding to various C types. When the member is accessed in Python, it " @@ -580,147 +584,147 @@ msgid "" "exception such as :exc:`TypeError` or :exc:`ValueError` is raised." msgstr "" -#: ../../c-api/structures.rst:562 +#: ../../c-api/structures.rst:566 msgid "" "Unless marked (D), attributes defined this way cannot be deleted using e.g. :" "keyword:`del` or :py:func:`delattr`." msgstr "" -#: ../../c-api/structures.rst:566 +#: ../../c-api/structures.rst:570 msgid "Macro name" msgstr "" -#: ../../c-api/structures.rst:566 +#: ../../c-api/structures.rst:570 msgid "C type" msgstr "" -#: ../../c-api/structures.rst:566 +#: ../../c-api/structures.rst:570 msgid "Python type" msgstr "" -#: ../../c-api/structures.rst:568 +#: ../../c-api/structures.rst:572 msgid ":c:expr:`char`" msgstr "" -#: ../../c-api/structures.rst:568 ../../c-api/structures.rst:569 -#: ../../c-api/structures.rst:570 ../../c-api/structures.rst:571 #: ../../c-api/structures.rst:572 ../../c-api/structures.rst:573 #: ../../c-api/structures.rst:574 ../../c-api/structures.rst:575 #: ../../c-api/structures.rst:576 ../../c-api/structures.rst:577 -#: ../../c-api/structures.rst:578 +#: ../../c-api/structures.rst:578 ../../c-api/structures.rst:579 +#: ../../c-api/structures.rst:580 ../../c-api/structures.rst:581 +#: ../../c-api/structures.rst:582 msgid ":py:class:`int`" msgstr ":py:class:`int`" -#: ../../c-api/structures.rst:569 +#: ../../c-api/structures.rst:573 msgid ":c:expr:`short`" msgstr ":c:expr:`short`" -#: ../../c-api/structures.rst:570 +#: ../../c-api/structures.rst:574 msgid ":c:expr:`int`" msgstr ":c:expr:`int`" -#: ../../c-api/structures.rst:571 +#: ../../c-api/structures.rst:575 msgid ":c:expr:`long`" msgstr ":c:expr:`long`" -#: ../../c-api/structures.rst:572 +#: ../../c-api/structures.rst:576 msgid ":c:expr:`long long`" msgstr ":c:expr:`long long`" -#: ../../c-api/structures.rst:573 +#: ../../c-api/structures.rst:577 msgid ":c:expr:`unsigned char`" msgstr ":c:expr:`unsigned char`" -#: ../../c-api/structures.rst:574 +#: ../../c-api/structures.rst:578 msgid ":c:expr:`unsigned int`" msgstr ":c:expr:`unsigned int`" -#: ../../c-api/structures.rst:575 +#: ../../c-api/structures.rst:579 msgid ":c:expr:`unsigned short`" msgstr ":c:expr:`unsigned short`" -#: ../../c-api/structures.rst:576 +#: ../../c-api/structures.rst:580 msgid ":c:expr:`unsigned long`" msgstr ":c:expr:`unsigned long`" -#: ../../c-api/structures.rst:577 +#: ../../c-api/structures.rst:581 msgid ":c:expr:`unsigned long long`" msgstr ":c:expr:`unsigned long long`" -#: ../../c-api/structures.rst:578 +#: ../../c-api/structures.rst:582 msgid ":c:expr:`Py_ssize_t`" msgstr ":c:expr:`Py_ssize_t`" -#: ../../c-api/structures.rst:579 +#: ../../c-api/structures.rst:583 msgid ":c:expr:`float`" msgstr ":c:expr:`float`" -#: ../../c-api/structures.rst:579 ../../c-api/structures.rst:580 +#: ../../c-api/structures.rst:583 ../../c-api/structures.rst:584 msgid ":py:class:`float`" msgstr ":py:class:`float`" -#: ../../c-api/structures.rst:580 +#: ../../c-api/structures.rst:584 msgid ":c:expr:`double`" msgstr ":c:expr:`double`" -#: ../../c-api/structures.rst:581 +#: ../../c-api/structures.rst:585 msgid ":c:expr:`char` (written as 0 or 1)" msgstr ":c:expr:`char` (寫成 0 或 1)" -#: ../../c-api/structures.rst:581 +#: ../../c-api/structures.rst:585 msgid ":py:class:`bool`" msgstr ":py:class:`bool`" -#: ../../c-api/structures.rst:583 +#: ../../c-api/structures.rst:587 msgid ":c:expr:`const char *` (*)" msgstr ":c:expr:`const char *` (*)" -#: ../../c-api/structures.rst:583 ../../c-api/structures.rst:584 +#: ../../c-api/structures.rst:587 ../../c-api/structures.rst:588 msgid ":py:class:`str` (RO)" msgstr ":py:class:`str` (RO)" -#: ../../c-api/structures.rst:584 +#: ../../c-api/structures.rst:588 msgid ":c:expr:`const char[]` (*)" msgstr ":c:expr:`const char[]` (*)" -#: ../../c-api/structures.rst:585 +#: ../../c-api/structures.rst:589 msgid ":c:expr:`char` (0-127)" msgstr ":c:expr:`char` (0-127)" -#: ../../c-api/structures.rst:585 +#: ../../c-api/structures.rst:589 msgid ":py:class:`str` (**)" msgstr ":py:class:`str` (**)" -#: ../../c-api/structures.rst:586 +#: ../../c-api/structures.rst:590 msgid ":c:expr:`PyObject *`" msgstr ":c:expr:`PyObject *`" -#: ../../c-api/structures.rst:586 +#: ../../c-api/structures.rst:590 msgid ":py:class:`object` (D)" msgstr ":py:class:`object` (D)" -#: ../../c-api/structures.rst:589 +#: ../../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 " "string is stored directly in the structure." msgstr "" -#: ../../c-api/structures.rst:594 +#: ../../c-api/structures.rst:598 msgid "(**): String of length 1. Only ASCII is accepted." msgstr "" -#: ../../c-api/structures.rst:596 +#: ../../c-api/structures.rst:600 msgid "(RO): Implies :c:macro:`Py_READONLY`." msgstr "" -#: ../../c-api/structures.rst:598 +#: ../../c-api/structures.rst:602 msgid "" "(D): Can be deleted, in which case the pointer is set to ``NULL``. Reading a " "``NULL`` pointer raises :py:exc:`AttributeError`." msgstr "" -#: ../../c-api/structures.rst:624 +#: ../../c-api/structures.rst:628 msgid "" "In previous versions, the macros were only available with ``#include " "\"structmember.h\"`` and were named without the ``Py_`` prefix (e.g. as " @@ -728,69 +732,69 @@ msgid "" "with the following deprecated types:" msgstr "" -#: ../../c-api/structures.rst:632 +#: ../../c-api/structures.rst:636 msgid "" "Like ``Py_T_OBJECT_EX``, but ``NULL`` is converted to ``None``. This results " "in surprising behavior in Python: deleting the attribute effectively sets it " "to ``None``." msgstr "" -#: ../../c-api/structures.rst:638 +#: ../../c-api/structures.rst:642 msgid "Always ``None``. Must be used with :c:macro:`Py_READONLY`." msgstr "" -#: ../../c-api/structures.rst:641 +#: ../../c-api/structures.rst:645 msgid "Defining Getters and Setters" msgstr "" -#: ../../c-api/structures.rst:645 +#: ../../c-api/structures.rst:649 msgid "" "Structure to define property-like access for a type. See also description of " "the :c:member:`PyTypeObject.tp_getset` slot." msgstr "" -#: ../../c-api/structures.rst:650 +#: ../../c-api/structures.rst:654 msgid "attribute name" msgstr "" -#: ../../c-api/structures.rst:654 +#: ../../c-api/structures.rst:658 msgid "C function to get the attribute." msgstr "" -#: ../../c-api/structures.rst:658 +#: ../../c-api/structures.rst:662 msgid "" "Optional C function to set or delete the attribute, if omitted the attribute " "is readonly." msgstr "" -#: ../../c-api/structures.rst:662 +#: ../../c-api/structures.rst:666 msgid "optional docstring" msgstr "" -#: ../../c-api/structures.rst:666 +#: ../../c-api/structures.rst:670 msgid "" "Optional function pointer, providing additional data for getter and setter." msgstr "" -#: ../../c-api/structures.rst:668 +#: ../../c-api/structures.rst:672 msgid "" "The ``get`` function takes one :c:expr:`PyObject*` parameter (the instance) " "and a function pointer (the associated ``closure``)::" msgstr "" -#: ../../c-api/structures.rst:673 +#: ../../c-api/structures.rst:677 msgid "" "It should return a new reference on success or ``NULL`` with a set exception " "on failure." msgstr "" -#: ../../c-api/structures.rst:676 +#: ../../c-api/structures.rst:680 msgid "" "``set`` functions take two :c:expr:`PyObject*` parameters (the instance and " "the value to be set) and a function pointer (the associated ``closure``)::" msgstr "" -#: ../../c-api/structures.rst:681 +#: ../../c-api/structures.rst:685 msgid "" "In case the attribute should be deleted the second parameter is ``NULL``. " "Should return ``0`` on success or ``-1`` with a set exception on failure." @@ -808,94 +812,94 @@ msgstr "classmethod" msgid "staticmethod" msgstr "staticmethod" -#: ../../c-api/structures.rst:525 +#: ../../c-api/structures.rst:529 msgid "READ_RESTRICTED" msgstr "READ_RESTRICTED" -#: ../../c-api/structures.rst:525 +#: ../../c-api/structures.rst:529 msgid "WRITE_RESTRICTED" msgstr "WRITE_RESTRICTED" -#: ../../c-api/structures.rst:525 +#: ../../c-api/structures.rst:529 msgid "RESTRICTED" msgstr "RESTRICTED" -#: ../../c-api/structures.rst:538 +#: ../../c-api/structures.rst:542 msgid "READONLY" msgstr "READONLY" -#: ../../c-api/structures.rst:601 +#: ../../c-api/structures.rst:605 msgid "T_BYTE" msgstr "T_BYTE" -#: ../../c-api/structures.rst:601 +#: ../../c-api/structures.rst:605 msgid "T_SHORT" msgstr "T_SHORT" -#: ../../c-api/structures.rst:601 +#: ../../c-api/structures.rst:605 msgid "T_INT" msgstr "T_INT" -#: ../../c-api/structures.rst:601 +#: ../../c-api/structures.rst:605 msgid "T_LONG" msgstr "T_LONG" -#: ../../c-api/structures.rst:601 +#: ../../c-api/structures.rst:605 msgid "T_LONGLONG" msgstr "T_LONGLONG" -#: ../../c-api/structures.rst:601 +#: ../../c-api/structures.rst:605 msgid "T_UBYTE" msgstr "T_UBYTE" -#: ../../c-api/structures.rst:601 +#: ../../c-api/structures.rst:605 msgid "T_USHORT" msgstr "T_USHORT" -#: ../../c-api/structures.rst:601 +#: ../../c-api/structures.rst:605 msgid "T_UINT" msgstr "T_UINT" -#: ../../c-api/structures.rst:601 +#: ../../c-api/structures.rst:605 msgid "T_ULONG" msgstr "T_ULONG" -#: ../../c-api/structures.rst:601 +#: ../../c-api/structures.rst:605 msgid "T_ULONGULONG" msgstr "T_ULONGULONG" -#: ../../c-api/structures.rst:601 +#: ../../c-api/structures.rst:605 msgid "T_PYSSIZET" msgstr "T_PYSSIZET" -#: ../../c-api/structures.rst:601 +#: ../../c-api/structures.rst:605 msgid "T_FLOAT" msgstr "T_FLOAT" -#: ../../c-api/structures.rst:601 +#: ../../c-api/structures.rst:605 msgid "T_DOUBLE" msgstr "T_DOUBLE" -#: ../../c-api/structures.rst:601 +#: ../../c-api/structures.rst:605 msgid "T_BOOL" msgstr "T_BOOL" -#: ../../c-api/structures.rst:601 +#: ../../c-api/structures.rst:605 msgid "T_CHAR" msgstr "T_CHAR" -#: ../../c-api/structures.rst:601 +#: ../../c-api/structures.rst:605 msgid "T_STRING" msgstr "T_STRING" -#: ../../c-api/structures.rst:601 +#: ../../c-api/structures.rst:605 msgid "T_STRING_INPLACE" msgstr "T_STRING_INPLACE" -#: ../../c-api/structures.rst:601 +#: ../../c-api/structures.rst:605 msgid "T_OBJECT_EX" msgstr "T_OBJECT_EX" -#: ../../c-api/structures.rst:601 +#: ../../c-api/structures.rst:605 msgid "structmember.h" msgstr "structmember.h" diff --git a/c-api/type.po b/c-api/type.po index a9f1005b76..124180d16e 100644 --- a/c-api/type.po +++ b/c-api/type.po @@ -1,5 +1,4 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2022, Python Software Foundation +# Copyright (C) 2001-2023, Python Software Foundation # This file is distributed under the same license as the Python package. # # Translators: @@ -7,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-29 00:03+0000\n" +"POT-Creation-Date: 2023-10-14 00:03+0000\n" "PO-Revision-Date: 2015-12-09 17:51+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -533,77 +532,81 @@ msgstr "" #: ../../c-api/type.rst:464 msgid "" -"The following fields cannot be set at all using :c:type:`PyType_Spec` and :c:" -"type:`PyType_Slot`:" +"The following “offset” fields cannot be set using :c:type:`PyType_Slot`:" msgstr "" -#: ../../c-api/type.rst:467 -msgid ":c:member:`~PyTypeObject.tp_dict`" -msgstr ":c:member:`~PyTypeObject.tp_dict`" +#: ../../c-api/type.rst:466 +msgid "" +":c:member:`~PyTypeObject.tp_weaklistoffset` (use :c:macro:" +"`Py_TPFLAGS_MANAGED_WEAKREF` instead if possible)" +msgstr "" #: ../../c-api/type.rst:468 -msgid ":c:member:`~PyTypeObject.tp_mro`" -msgstr ":c:member:`~PyTypeObject.tp_mro`" - -#: ../../c-api/type.rst:469 -msgid ":c:member:`~PyTypeObject.tp_cache`" -msgstr ":c:member:`~PyTypeObject.tp_cache`" +msgid "" +":c:member:`~PyTypeObject.tp_dictoffset` (use :c:macro:" +"`Py_TPFLAGS_MANAGED_DICT` instead if possible)" +msgstr "" +":c:member:`~PyTypeObject.tp_dictoffset`\\ (如果可能,請改用 :c:macro:" +"`Py_TPFLAGS_MANAGED_DICT`)" #: ../../c-api/type.rst:470 -msgid ":c:member:`~PyTypeObject.tp_subclasses`" -msgstr ":c:member:`~PyTypeObject.tp_subclasses`" - -#: ../../c-api/type.rst:471 -msgid ":c:member:`~PyTypeObject.tp_weaklist`" -msgstr ":c:member:`~PyTypeObject.tp_weaklist`" - -#: ../../c-api/type.rst:472 -msgid ":c:member:`~PyTypeObject.tp_vectorcall`" -msgstr ":c:member:`~PyTypeObject.tp_vectorcall`" +msgid "" +":c:member:`~PyTypeObject.tp_vectorcall_offset` (use " +"``\"__vectorcalloffset__\"`` in :ref:`PyMemberDef `)" +msgstr "" +":c:member:`~PyTypeObject.tp_vectorcall_offset`\\ (請用 :ref:`PyMemberDef " +"` 中的 ``\"__vectorcalloffset__\"``)" -#: ../../c-api/type.rst:473 +#: ../../c-api/type.rst:474 msgid "" -":c:member:`~PyTypeObject.tp_weaklistoffset` (use :c:macro:" -"`Py_TPFLAGS_MANAGED_WEAKREF` instead)" +"If it is not possible to switch to a ``MANAGED`` flag (for example, for " +"vectorcall or to support Python older than 3.12), specify the offset in :c:" +"member:`Py_tp_members `. See :ref:`PyMemberDef " +"documentation ` for details." +msgstr "" + +#: ../../c-api/type.rst:480 +msgid "The following fields cannot be set at all when creating a heap type:" msgstr "" -#: ../../c-api/type.rst:475 +#: ../../c-api/type.rst:482 msgid "" -":c:member:`~PyTypeObject.tp_dictoffset` (use :c:macro:" -"`Py_TPFLAGS_MANAGED_DICT` instead)" +":c:member:`~PyTypeObject.tp_vectorcall` (use :c:member:`~PyTypeObject." +"tp_new` and/or :c:member:`~PyTypeObject.tp_init`)" msgstr "" -#: ../../c-api/type.rst:477 +#: ../../c-api/type.rst:486 msgid "" -":c:member:`~PyTypeObject.tp_vectorcall_offset` (see :ref:`PyMemberDef " -"`)" +"Internal fields: :c:member:`~PyTypeObject.tp_dict`, :c:member:`~PyTypeObject." +"tp_mro`, :c:member:`~PyTypeObject.tp_cache`, :c:member:`~PyTypeObject." +"tp_subclasses`, and :c:member:`~PyTypeObject.tp_weaklist`." msgstr "" -#: ../../c-api/type.rst:480 +#: ../../c-api/type.rst:493 msgid "" "Setting :c:data:`Py_tp_bases` or :c:data:`Py_tp_base` may be problematic on " "some platforms. To avoid issues, use the *bases* argument of :c:func:" "`PyType_FromSpecWithBases` instead." msgstr "" -#: ../../c-api/type.rst:487 +#: ../../c-api/type.rst:500 msgid "Slots in :c:type:`PyBufferProcs` may be set in the unlimited API." msgstr "" -#: ../../c-api/type.rst:489 +#: ../../c-api/type.rst:502 msgid "" ":c:member:`~PyBufferProcs.bf_getbuffer` and :c:member:`~PyBufferProcs." "bf_releasebuffer` are now available under the :ref:`limited API `." msgstr "" -#: ../../c-api/type.rst:496 +#: ../../c-api/type.rst:509 msgid "" "The desired value of the slot. In most cases, this is a pointer to a " "function." msgstr "" -#: ../../c-api/type.rst:499 +#: ../../c-api/type.rst:512 msgid "Slots other than ``Py_tp_doc`` may not be ``NULL``." msgstr "" diff --git a/extending/windows.po b/extending/windows.po index 5e2c101fb5..24a09caf88 100644 --- a/extending/windows.po +++ b/extending/windows.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-10-11 17:13+0000\n" "PO-Revision-Date: 2015-12-09 17:51+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -185,5 +185,5 @@ msgid "" "Developer Studio will throw in a lot of import libraries that you do not " "really need, adding about 100K to your executable. To get rid of them, use " "the Project Settings dialog, Link tab, to specify *ignore default " -"libraries*. Add the correct :file:`msvcrtxx.lib` to the list of libraries." +"libraries*. Add the correct :file:`msvcrt{xx}.lib` to the list of libraries." msgstr "" diff --git a/howto/clinic.po b/howto/clinic.po index 469e7f45c1..c039a32a4c 100644 --- a/howto/clinic.po +++ b/howto/clinic.po @@ -1,5 +1,5 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2022, Python Software Foundation +# Copyright (C) 2001-2023, Python Software Foundation # This file is distributed under the same license as the Python package. # # Translators: @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-08 00:03+0000\n" +"POT-Creation-Date: 2023-10-13 00:03+0000\n" "PO-Revision-Date: 2018-05-23 14:36+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -18,2550 +18,14 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -#: ../../howto/clinic.rst:7 +#: ../../howto/clinic.rst:8 msgid "Argument Clinic How-To" -msgstr "" - -#: ../../howto/clinic.rst:0 -msgid "author" -msgstr "作者" - -#: ../../howto/clinic.rst:9 -msgid "Larry Hastings" -msgstr "Larry Hastings" - -#: ../../howto/clinic.rst:11 -msgid "**Source code:** :source:`Tools/clinic/clinic.py`." -msgstr "**原始碼:** :source:`Tools/clinic/clinic.py`。" - -#: ../../howto/clinic.rst:7 -msgid "Abstract" -msgstr "摘要" - -#: ../../howto/clinic.rst:15 -msgid "" -"Argument Clinic is a preprocessor for CPython C files. It was introduced in " -"Python 3.4 with :pep:`436`, in order to provide introspection signatures, " -"and to generate performant and tailor-made boilerplate code for argument " -"parsing in CPython builtins, module level functions, and class methods. This " -"document is divided in four major sections:" -msgstr "" - -#: ../../howto/clinic.rst:23 -msgid "" -":ref:`clinic-background` talks about the basic concepts and goals of " -"Argument Clinic." -msgstr "" - -#: ../../howto/clinic.rst:25 -msgid "" -":ref:`clinic-reference` describes the command-line interface and Argument " -"Clinic terminology." -msgstr "" - -#: ../../howto/clinic.rst:27 -msgid "" -":ref:`clinic-tutorial` guides you through all the steps required to adapt an " -"existing C function to Argument Clinic." -msgstr "" - -#: ../../howto/clinic.rst:29 -msgid ":ref:`clinic-howtos` details how to handle specific tasks." -msgstr "" - -#: ../../howto/clinic.rst:34 -msgid "" -"Argument Clinic is considered internal-only for CPython. Its use is not " -"supported for files outside CPython, and no guarantees are made regarding " -"backwards compatibility for future versions. In other words: if you " -"maintain an external C extension for CPython, you're welcome to experiment " -"with Argument Clinic in your own code. But the version of Argument Clinic " -"that ships with the next version of CPython *could* be totally incompatible " -"and break all your code." -msgstr "" - -#: ../../howto/clinic.rst:47 -msgid "Background" -msgstr "" - -#: ../../howto/clinic.rst:50 -msgid "Basic concepts" -msgstr "" - -#: ../../howto/clinic.rst:52 -msgid "" -"When Argument Clinic is run on a file, either via the :ref:`clinic-cli` or " -"via ``make clinic``, it will scan over the input files looking for :term:" -"`start lines `:" -msgstr "" - -#: ../../howto/clinic.rst:60 -msgid "When it finds one, it reads everything up to the :term:`end line`:" -msgstr "" - -#: ../../howto/clinic.rst:66 -msgid "" -"Everything in between these two lines is Argument Clinic :term:`input`. When " -"Argument Clinic parses input, it generates :term:`output`. The output is " -"rewritten into the C file immediately after the input, followed by a :term:" -"`checksum line`. All of these lines, including the :term:`start line` and :" -"term:`checksum line`, are collectively called an Argument Clinic :term:" -"`block`:" -msgstr "" - -#: ../../howto/clinic.rst:81 -msgid "" -"If you run Argument Clinic on the same file a second time, Argument Clinic " -"will discard the old :term:`output` and write out the new output with a " -"fresh :term:`checksum line`. If the :term:`input` hasn't changed, the output " -"won't change either." -msgstr "" - -#: ../../howto/clinic.rst:88 -msgid "" -"You should never modify the output of an Argument Clinic block, as any " -"change will be lost in future Argument Clinic runs; Argument Clinic will " -"detect an output checksum mismatch and regenerate the correct output. If you " -"are not happy with the generated output, you should instead change the input " -"until it produces the output you want." -msgstr "" - -#: ../../howto/clinic.rst:99 -msgid "Reference" -msgstr "" - -#: ../../howto/clinic.rst:105 -msgid "Terminology" -msgstr "" - -#: ../../howto/clinic.rst:108 -msgid "start line" -msgstr "" - -#: ../../howto/clinic.rst:110 -msgid "" -"The line ``/*[clinic input]``. This line marks the beginning of Argument " -"Clinic input. Note that the *start line* opens a C block comment." -msgstr "" - -#: ../../howto/clinic.rst:113 -msgid "end line" -msgstr "" - -#: ../../howto/clinic.rst:115 -msgid "" -"The line ``[clinic start generated code]*/``. The *end line* marks the _end_ " -"of Argument Clinic :term:`input`, but at the same time marks the _start_ of " -"Argument Clinic :term:`output`, thus the text *\"clinic start start " -"generated code\"* Note that the *end line* closes the C block comment opened " -"by the *start line*." -msgstr "" - -#: ../../howto/clinic.rst:121 -msgid "checksum" -msgstr "" - -#: ../../howto/clinic.rst:123 -msgid "" -"A hash to distinguish unique :term:`inputs ` and :term:`outputs " -"`." -msgstr "" - -#: ../../howto/clinic.rst:125 -msgid "checksum line" -msgstr "" - -#: ../../howto/clinic.rst:127 -msgid "" -"A line that looks like ``/*[clinic end generated code: ...]*/``. The three " -"dots will be replaced by a :term:`checksum` generated from the :term:" -"`input`, and a :term:`checksum` generated from the :term:`output`. The " -"checksum line marks the end of Argument Clinic generated code, and is used " -"by Argument Clinic to determine if it needs to regenerate output." -msgstr "" - -#: ../../howto/clinic.rst:133 -msgid "input" -msgstr "" - -#: ../../howto/clinic.rst:135 -msgid "" -"The text between the :term:`start line` and the :term:`end line`. Note that " -"the start and end lines open and close a C block comment; the *input* is " -"thus a part of that same C block comment." -msgstr "" - -#: ../../howto/clinic.rst:138 -msgid "output" -msgstr "" - -#: ../../howto/clinic.rst:140 -msgid "The text between the :term:`end line` and the :term:`checksum line`." -msgstr "" - -#: ../../howto/clinic.rst:141 -msgid "block" -msgstr "" - -#: ../../howto/clinic.rst:143 -msgid "" -"All text from the :term:`start line` to the :term:`checksum line` " -"inclusively." -msgstr "" - -#: ../../howto/clinic.rst:149 -msgid "Command-line interface" -msgstr "" - -#: ../../howto/clinic.rst:151 -msgid "" -"The Argument Clinic :abbr:`CLI (Command-Line Interface)` is typically used " -"to process a single source file, like this:" -msgstr "" - -#: ../../howto/clinic.rst:158 -msgid "The CLI supports the following options:" -msgstr "" - -#: ../../howto/clinic.rst:165 -msgid "Print CLI usage." -msgstr "" - -#: ../../howto/clinic.rst:169 -msgid "Force output regeneration." -msgstr "" - -#: ../../howto/clinic.rst:173 -msgid "Redirect file output to OUTPUT" -msgstr "" - -#: ../../howto/clinic.rst:177 -msgid "Enable verbose mode." -msgstr "" - -#: ../../howto/clinic.rst:181 -msgid "Print a list of all supported converters and return converters." -msgstr "" - -#: ../../howto/clinic.rst:185 -msgid "Walk :option:`--srcdir` to run over all relevant files." -msgstr "" - -#: ../../howto/clinic.rst:189 -msgid "The directory tree to walk in :option:`--make` mode." -msgstr "" - -#: ../../howto/clinic.rst:193 -msgid "The list of files to process." -msgstr "" - -#: ../../howto/clinic.rst:199 -msgid "Classes for extending Argument Clinic" -msgstr "" - -#: ../../howto/clinic.rst:205 -msgid "" -"The base class for all converters. See :ref:`clinic-howto-custom-converter` " -"for how to subclass this class." -msgstr "" - -#: ../../howto/clinic.rst:210 -msgid "" -"The C type to use for this variable. :attr:`!type` should be a Python string " -"specifying the type, e.g. ``'int'``. If this is a pointer type, the type " -"string should end with ``' *'``." -msgstr "" - -#: ../../howto/clinic.rst:217 -msgid "" -"The Python default value for this parameter, as a Python value. Or the magic " -"value ``unspecified`` if there is no default." -msgstr "" - -#: ../../howto/clinic.rst:222 -msgid "" -":attr:`!default` as it should appear in Python code, as a string. Or " -"``None`` if there is no default." -msgstr "" - -#: ../../howto/clinic.rst:228 -msgid "" -":attr:`!default` as it should appear in C code, as a string. Or ``None`` if " -"there is no default." -msgstr "" - -#: ../../howto/clinic.rst:234 -msgid "" -"The default value used to initialize the C variable when there is no " -"default, but not specifying a default may result in an \"uninitialized " -"variable\" warning. This can easily happen when using option groups—" -"although properly written code will never actually use this value, the " -"variable does get passed in to the impl, and the C compiler will complain " -"about the \"use\" of the uninitialized value. This value should always be a " -"non-empty string." -msgstr "" - -#: ../../howto/clinic.rst:246 -msgid "The name of the C converter function, as a string." -msgstr "" - -#: ../../howto/clinic.rst:250 -msgid "" -"A boolean value. If true, Argument Clinic will add a ``&`` in front of the " -"name of the variable when passing it into the impl function." -msgstr "" - -#: ../../howto/clinic.rst:256 -msgid "" -"A boolean value. If true, Argument Clinic will add a ``&`` in front of the " -"name of the variable when passing it into :c:func:`PyArg_ParseTuple`." -msgstr "" - -#: ../../howto/clinic.rst:264 -msgid "Tutorial" -msgstr "" - -#: ../../howto/clinic.rst:266 -msgid "" -"The best way to get a sense of how Argument Clinic works is to convert a " -"function to work with it. Here, then, are the bare minimum steps you'd need " -"to follow to convert a function to work with Argument Clinic. Note that for " -"code you plan to check in to CPython, you really should take the conversion " -"farther, using some of the :ref:`advanced concepts ` you'll " -"see later on in the document, like :ref:`clinic-howto-return-converters` " -"and :ref:`clinic-howto-self-converter`. But we'll keep it simple for this " -"walkthrough so you can learn." -msgstr "" - -#: ../../howto/clinic.rst:277 -msgid "" -"First, make sure you're working with a freshly updated checkout of the " -"CPython trunk." -msgstr "" - -#: ../../howto/clinic.rst:280 -msgid "" -"Next, find a Python builtin that calls either :c:func:`PyArg_ParseTuple` or :" -"c:func:`PyArg_ParseTupleAndKeywords`, and hasn't been converted to work with " -"Argument Clinic yet. For this tutorial, we'll be using :py:meth:`_pickle." -"Pickler.dump `." -msgstr "" - -#: ../../howto/clinic.rst:286 -msgid "" -"If the call to the :c:func:`!PyArg_Parse*` function uses any of the " -"following format units...:" -msgstr "" - -#: ../../howto/clinic.rst:298 -msgid "" -"... or if it has multiple calls to :c:func:`PyArg_ParseTuple`, you should " -"choose a different function. (See :ref:`clinic-howto-advanced-converters` " -"for those scenarios.)" -msgstr "" - -#: ../../howto/clinic.rst:302 -msgid "" -"Also, if the function has multiple calls to :c:func:`!PyArg_ParseTuple` or :" -"c:func:`PyArg_ParseTupleAndKeywords` where it supports different types for " -"the same argument, or if the function uses something besides :c:func:`!" -"PyArg_Parse*` functions to parse its arguments, it probably isn't suitable " -"for conversion to Argument Clinic. Argument Clinic doesn't support generic " -"functions or polymorphic parameters." -msgstr "" - -#: ../../howto/clinic.rst:309 -msgid "" -"Next, add the following boilerplate above the function, creating our input " -"block::" -msgstr "" - -#: ../../howto/clinic.rst:315 -msgid "" -"Cut the docstring and paste it in between the ``[clinic]`` lines, removing " -"all the junk that makes it a properly quoted C string. When you're done you " -"should have just the text, based at the left margin, with no line wider than " -"80 characters. Argument Clinic will preserve indents inside the docstring." -msgstr "" - -#: ../../howto/clinic.rst:321 -msgid "" -"If the old docstring had a first line that looked like a function signature, " -"throw that line away; The docstring doesn't need it anymore --- when you " -"use :py:func:`help` on your builtin in the future, the first line will be " -"built automatically based on the function's signature." -msgstr "" - -#: ../../howto/clinic.rst:326 -msgid "Example docstring summary line::" -msgstr "" - -#: ../../howto/clinic.rst:332 -msgid "" -"If your docstring doesn't have a \"summary\" line, Argument Clinic will " -"complain, so let's make sure it has one. The \"summary\" line should be a " -"paragraph consisting of a single 80-column line at the beginning of the " -"docstring. (See :pep:`257` regarding docstring conventions.)" -msgstr "" - -#: ../../howto/clinic.rst:338 -msgid "" -"Our example docstring consists solely of a summary line, so the sample code " -"doesn't have to change for this step." -msgstr "" - -#: ../../howto/clinic.rst:341 -msgid "" -"Now, above the docstring, enter the name of the function, followed by a " -"blank line. This should be the Python name of the function, and should be " -"the full dotted path to the function --- it should start with the name of " -"the module, include any sub-modules, and if the function is a method on a " -"class it should include the class name too." -msgstr "" - -#: ../../howto/clinic.rst:348 -msgid "" -"In our example, :mod:`!_pickle` is the module, :py:class:`!Pickler` is the " -"class, and :py:meth:`!dump` is the method, so the name becomes :py:meth:`!" -"_pickle.Pickler.dump`::" -msgstr "" - -#: ../../howto/clinic.rst:358 -msgid "" -"If this is the first time that module or class has been used with Argument " -"Clinic in this C file, you must declare the module and/or class. Proper " -"Argument Clinic hygiene prefers declaring these in a separate block " -"somewhere near the top of the C file, in the same way that include files and " -"statics go at the top. In our sample code we'll just show the two blocks " -"next to each other." -msgstr "" - -#: ../../howto/clinic.rst:366 -msgid "" -"The name of the class and module should be the same as the one seen by " -"Python. Check the name defined in the :c:type:`PyModuleDef` or :c:type:" -"`PyTypeObject` as appropriate." -msgstr "" - -#: ../../howto/clinic.rst:370 -msgid "" -"When you declare a class, you must also specify two aspects of its type in " -"C: the type declaration you'd use for a pointer to an instance of this " -"class, and a pointer to the :c:type:`!PyTypeObject` for this class::" -msgstr "" - -#: ../../howto/clinic.rst:385 -msgid "" -"Declare each of the parameters to the function. Each parameter should get " -"its own line. All the parameter lines should be indented from the function " -"name and the docstring. The general form of these parameter lines is as " -"follows:" -msgstr "" - -#: ../../howto/clinic.rst:394 -msgid "If the parameter has a default value, add that after the converter:" -msgstr "" - -#: ../../howto/clinic.rst:401 -msgid "" -"Argument Clinic's support for \"default values\" is quite sophisticated; " -"see :ref:`clinic-howto-default-values` for more information." -msgstr "" - -#: ../../howto/clinic.rst:404 -msgid "Next, add a blank line below the parameters." -msgstr "" - -#: ../../howto/clinic.rst:406 -msgid "" -"What's a \"converter\"? It establishes both the type of the variable used in " -"C, and the method to convert the Python value into a C value at runtime. For " -"now you're going to use what's called a \"legacy converter\" --- a " -"convenience syntax intended to make porting old code into Argument Clinic " -"easier." -msgstr "" - -#: ../../howto/clinic.rst:413 -msgid "" -"For each parameter, copy the \"format unit\" for that parameter from the :c:" -"func:`PyArg_Parse` format argument and specify *that* as its converter, as a " -"quoted string. The \"format unit\" is the formal name for the one-to-three " -"character substring of the *format* parameter that tells the argument " -"parsing function what the type of the variable is and how to convert it. For " -"more on format units please see :ref:`arg-parsing`." -msgstr "" - -#: ../../howto/clinic.rst:422 -msgid "" -"For multicharacter format units like ``z#``, use the entire two-or-three " -"character string." -msgstr "" - -#: ../../howto/clinic.rst:425 ../../howto/clinic.rst:460 -#: ../../howto/clinic.rst:488 ../../howto/clinic.rst:594 -#: ../../howto/clinic.rst:647 -msgid "Sample::" -msgstr "" - -#: ../../howto/clinic.rst:440 -msgid "" -"If your function has ``|`` in the format string, meaning some parameters " -"have default values, you can ignore it. Argument Clinic infers which " -"parameters are optional based on whether or not they have default values." -msgstr "" - -#: ../../howto/clinic.rst:445 -msgid "" -"If your function has ``$`` in the format string, meaning it takes keyword-" -"only arguments, specify ``*`` on a line by itself before the first keyword-" -"only argument, indented the same as the parameter lines." -msgstr "" - -#: ../../howto/clinic.rst:450 -msgid "" -":py:meth:`!_pickle.Pickler.dump` has neither, so our sample is unchanged." -msgstr "" - -#: ../../howto/clinic.rst:452 -msgid "" -"Next, if the existing C function calls :c:func:`PyArg_ParseTuple` (as " -"opposed to :c:func:`PyArg_ParseTupleAndKeywords`), then all its arguments " -"are positional-only." -msgstr "" - -#: ../../howto/clinic.rst:456 -msgid "" -"To mark parameters as positional-only in Argument Clinic, add a ``/`` on a " -"line by itself after the last positional-only parameter, indented the same " -"as the parameter lines." -msgstr "" - -#: ../../howto/clinic.rst:476 -msgid "" -"It can be helpful to write a per-parameter docstring for each parameter. " -"Since per-parameter docstrings are optional, you can skip this step if you " -"prefer." -msgstr "" - -#: ../../howto/clinic.rst:480 -msgid "" -"Nevertheless, here's how to add a per-parameter docstring. The first line of " -"the per-parameter docstring must be indented further than the parameter " -"definition. The left margin of this first line establishes the left margin " -"for the whole per-parameter docstring; all the text you write will be " -"outdented by this amount. You can write as much text as you like, across " -"multiple lines if you wish." -msgstr "" - -#: ../../howto/clinic.rst:505 -msgid "" -"Save and close the file, then run ``Tools/clinic/clinic.py`` on it. With " -"luck everything worked---your block now has output, and a :file:`.c.h` file " -"has been generated! Reload the file in your text editor to see the generated " -"code::" -msgstr "" - -#: ../../howto/clinic.rst:524 -msgid "" -"Obviously, if Argument Clinic didn't produce any output, it's because it " -"found an error in your input. Keep fixing your errors and retrying until " -"Argument Clinic processes your file without complaint." -msgstr "" - -#: ../../howto/clinic.rst:529 -msgid "" -"For readability, most of the glue code has been generated to a :file:`.c.h` " -"file. You'll need to include that in your original :file:`.c` file, " -"typically right after the clinic module block::" -msgstr "" - -#: ../../howto/clinic.rst:535 -msgid "" -"Double-check that the argument-parsing code Argument Clinic generated looks " -"basically the same as the existing code." -msgstr "" - -#: ../../howto/clinic.rst:538 -msgid "" -"First, ensure both places use the same argument-parsing function. The " -"existing code must call either :c:func:`PyArg_ParseTuple` or :c:func:" -"`PyArg_ParseTupleAndKeywords`; ensure that the code generated by Argument " -"Clinic calls the *exact* same function." -msgstr "" - -#: ../../howto/clinic.rst:544 -msgid "" -"Second, the format string passed in to :c:func:`!PyArg_ParseTuple` or :c:" -"func:`!PyArg_ParseTupleAndKeywords` should be *exactly* the same as the hand-" -"written one in the existing function, up to the colon or semi-colon." -msgstr "" - -#: ../../howto/clinic.rst:549 -msgid "" -"Argument Clinic always generates its format strings with a ``:`` followed by " -"the name of the function. If the existing code's format string ends with ``;" -"``, to provide usage help, this change is harmless --- don't worry about it." -msgstr "" - -#: ../../howto/clinic.rst:554 -msgid "" -"Third, for parameters whose format units require two arguments, like a " -"length variable, an encoding string, or a pointer to a conversion function, " -"ensure that the second argument is *exactly* the same between the two " -"invocations." -msgstr "" - -#: ../../howto/clinic.rst:559 -msgid "" -"Fourth, inside the output portion of the block, you'll find a preprocessor " -"macro defining the appropriate static :c:type:`PyMethodDef` structure for " -"this builtin::" -msgstr "" - -#: ../../howto/clinic.rst:566 -msgid "" -"This static structure should be *exactly* the same as the existing static :c:" -"type:`!PyMethodDef` structure for this builtin." -msgstr "" - -#: ../../howto/clinic.rst:569 -msgid "" -"If any of these items differ in *any way*, adjust your Argument Clinic " -"function specification and rerun ``Tools/clinic/clinic.py`` until they *are* " -"the same." -msgstr "" - -#: ../../howto/clinic.rst:573 -msgid "" -"Notice that the last line of its output is the declaration of your \"impl\" " -"function. This is where the builtin's implementation goes. Delete the " -"existing prototype of the function you're modifying, but leave the opening " -"curly brace. Now delete its argument parsing code and the declarations of " -"all the variables it dumps the arguments into. Notice how the Python " -"arguments are now arguments to this impl function; if the implementation " -"used different names for these variables, fix it." -msgstr "" - -#: ../../howto/clinic.rst:581 -msgid "" -"Let's reiterate, just because it's kind of weird. Your code should now look " -"like this::" -msgstr "" - -#: ../../howto/clinic.rst:590 -msgid "" -"Argument Clinic generated the checksum line and the function prototype just " -"above it. You should write the opening and closing curly braces for the " -"function, and the implementation inside." -msgstr "" - -#: ../../howto/clinic.rst:636 -msgid "" -"Remember the macro with the :c:type:`PyMethodDef` structure for this " -"function? Find the existing :c:type:`!PyMethodDef` structure for this " -"function and replace it with a reference to the macro. If the builtin is at " -"module scope, this will probably be very near the end of the file; if the " -"builtin is a class method, this will probably be below but relatively near " -"to the implementation." -msgstr "" - -#: ../../howto/clinic.rst:643 -msgid "" -"Note that the body of the macro contains a trailing comma; when you replace " -"the existing static :c:type:`!PyMethodDef` structure with the macro, *don't* " -"add a comma to the end." -msgstr "" - -#: ../../howto/clinic.rst:655 -msgid "Argument Clinic may generate new instances of ``_Py_ID``. For example::" -msgstr "" - -#: ../../howto/clinic.rst:659 -msgid "" -"If it does, you'll have to run ``make regen-global-objects`` to regenerate " -"the list of precompiled identifiers at this point." -msgstr "" - -#: ../../howto/clinic.rst:662 -msgid "" -"Finally, compile, then run the relevant portions of the regression-test " -"suite. This change should not introduce any new compile-time warnings or " -"errors, and there should be no externally visible change to Python's " -"behavior, except for one difference: :py:func:`inspect.signature` run on " -"your function should now provide a valid signature!" -msgstr "" - -#: ../../howto/clinic.rst:668 -msgid "" -"Congratulations, you've ported your first function to work with Argument " -"Clinic!" -msgstr "" - -#: ../../howto/clinic.rst:674 -msgid "How-to guides" -msgstr "" - -#: ../../howto/clinic.rst:678 -msgid "How to rename C functions and variables generated by Argument Clinic" -msgstr "" - -#: ../../howto/clinic.rst:680 -msgid "" -"Argument Clinic automatically names the functions it generates for you. " -"Occasionally this may cause a problem, if the generated name collides with " -"the name of an existing C function. There's an easy solution: override the " -"names used for the C functions. Just add the keyword ``\"as\"`` to your " -"function declaration line, followed by the function name you wish to use. " -"Argument Clinic will use that function name for the base (generated) " -"function, then add ``\"_impl\"`` to the end and use that for the name of the " -"impl function." -msgstr "" - -#: ../../howto/clinic.rst:688 -msgid "" -"For example, if we wanted to rename the C function names generated for :py:" -"meth:`pickle.Pickler.dump`, it'd look like this::" -msgstr "" - -#: ../../howto/clinic.rst:696 -msgid "" -"The base function would now be named :c:func:`!pickler_dumper`, and the impl " -"function would now be named :c:func:`!pickler_dumper_impl`." -msgstr "" - -#: ../../howto/clinic.rst:700 -msgid "" -"Similarly, you may have a problem where you want to give a parameter a " -"specific Python name, but that name may be inconvenient in C. Argument " -"Clinic allows you to give a parameter different names in Python and in C, " -"using the same ``\"as\"`` syntax::" -msgstr "" - -#: ../../howto/clinic.rst:714 -msgid "" -"Here, the name used in Python (in the signature and the ``keywords`` array) " -"would be *file*, but the C variable would be named ``file_obj``." -msgstr "" - -#: ../../howto/clinic.rst:717 -msgid "You can use this to rename the *self* parameter too!" -msgstr "" - -#: ../../howto/clinic.rst:721 -msgid "How to convert functions using ``PyArg_UnpackTuple``" -msgstr "" - -#: ../../howto/clinic.rst:723 -msgid "" -"To convert a function parsing its arguments with :c:func:" -"`PyArg_UnpackTuple`, simply write out all the arguments, specifying each as " -"an ``object``. You may specify the *type* argument to cast the type as " -"appropriate. All arguments should be marked positional-only (add a ``/`` on " -"a line by itself after the last argument)." -msgstr "" - -#: ../../howto/clinic.rst:729 -msgid "" -"Currently the generated code will use :c:func:`PyArg_ParseTuple`, but this " -"will change soon." -msgstr "" - -#: ../../howto/clinic.rst:734 -msgid "How to use optional groups" -msgstr "" - -#: ../../howto/clinic.rst:736 -msgid "" -"Some legacy functions have a tricky approach to parsing their arguments: " -"they count the number of positional arguments, then use a ``switch`` " -"statement to call one of several different :c:func:`PyArg_ParseTuple` calls " -"depending on how many positional arguments there are. (These functions " -"cannot accept keyword-only arguments.) This approach was used to simulate " -"optional arguments back before :c:func:`PyArg_ParseTupleAndKeywords` was " -"created." -msgstr "" - -#: ../../howto/clinic.rst:743 -msgid "" -"While functions using this approach can often be converted to use :c:func:`!" -"PyArg_ParseTupleAndKeywords`, optional arguments, and default values, it's " -"not always possible. Some of these legacy functions have behaviors :c:func:" -"`!PyArg_ParseTupleAndKeywords` doesn't directly support. The most obvious " -"example is the builtin function :py:func:`range`, which has an optional " -"argument on the *left* side of its required argument! Another example is :py:" -"meth:`curses.window.addch`, which has a group of two arguments that must " -"always be specified together. (The arguments are called *x* and *y*; if you " -"call the function passing in *x*, you must also pass in *y* — and if you " -"don't pass in *x* you may not pass in *y* either.)" -msgstr "" - -#: ../../howto/clinic.rst:755 -msgid "" -"In any case, the goal of Argument Clinic is to support argument parsing for " -"all existing CPython builtins without changing their semantics. Therefore " -"Argument Clinic supports this alternate approach to parsing, using what are " -"called *optional groups*. Optional groups are groups of arguments that must " -"all be passed in together. They can be to the left or the right of the " -"required arguments. They can *only* be used with positional-only parameters." -msgstr "" - -#: ../../howto/clinic.rst:763 -msgid "" -"Optional groups are *only* intended for use when converting functions that " -"make multiple calls to :c:func:`PyArg_ParseTuple`! Functions that use *any* " -"other approach for parsing arguments should *almost never* be converted to " -"Argument Clinic using optional groups. Functions using optional groups " -"currently cannot have accurate signatures in Python, because Python just " -"doesn't understand the concept. Please avoid using optional groups wherever " -"possible." -msgstr "" - -#: ../../howto/clinic.rst:772 -msgid "" -"To specify an optional group, add a ``[`` on a line by itself before the " -"parameters you wish to group together, and a ``]`` on a line by itself after " -"these parameters. As an example, here's how :py:meth:`curses.window.addch` " -"uses optional groups to make the first two parameters and the last parameter " -"optional::" -msgstr "" - -#: ../../howto/clinic.rst:801 -msgid "Notes:" -msgstr "註解:" - -#: ../../howto/clinic.rst:803 -msgid "" -"For every optional group, one additional parameter will be passed into the " -"impl function representing the group. The parameter will be an int named " -"``group_{direction}_{number}``, where ``{direction}`` is either ``right`` or " -"``left`` depending on whether the group is before or after the required " -"parameters, and ``{number}`` is a monotonically increasing number (starting " -"at 1) indicating how far away the group is from the required parameters. " -"When the impl is called, this parameter will be set to zero if this group " -"was unused, and set to non-zero if this group was used. (By used or unused, " -"I mean whether or not the parameters received arguments in this invocation.)" -msgstr "" - -#: ../../howto/clinic.rst:814 -msgid "" -"If there are no required arguments, the optional groups will behave as if " -"they're to the right of the required arguments." -msgstr "" - -#: ../../howto/clinic.rst:817 -msgid "" -"In the case of ambiguity, the argument parsing code favors parameters on the " -"left (before the required parameters)." -msgstr "" - -#: ../../howto/clinic.rst:820 -msgid "Optional groups can only contain positional-only parameters." -msgstr "" - -#: ../../howto/clinic.rst:822 -msgid "" -"Optional groups are *only* intended for legacy code. Please do not use " -"optional groups for new code." -msgstr "" - -#: ../../howto/clinic.rst:827 -msgid "" -"How to use real Argument Clinic converters, instead of \"legacy converters\"" -msgstr "" - -#: ../../howto/clinic.rst:829 -msgid "" -"To save time, and to minimize how much you need to learn to achieve your " -"first port to Argument Clinic, the walkthrough above tells you to use " -"\"legacy converters\". \"Legacy converters\" are a convenience, designed " -"explicitly to make porting existing code to Argument Clinic easier. And to " -"be clear, their use is acceptable when porting code for Python 3.4." -msgstr "" - -#: ../../howto/clinic.rst:836 -msgid "" -"However, in the long term we probably want all our blocks to use Argument " -"Clinic's real syntax for converters. Why? A couple reasons:" -msgstr "" - -#: ../../howto/clinic.rst:840 -msgid "" -"The proper converters are far easier to read and clearer in their intent." -msgstr "" - -#: ../../howto/clinic.rst:841 -msgid "" -"There are some format units that are unsupported as \"legacy converters\", " -"because they require arguments, and the legacy converter syntax doesn't " -"support specifying arguments." -msgstr "" - -#: ../../howto/clinic.rst:844 -msgid "" -"In the future we may have a new argument parsing library that isn't " -"restricted to what :c:func:`PyArg_ParseTuple` supports; this flexibility " -"won't be available to parameters using legacy converters." -msgstr "" - -#: ../../howto/clinic.rst:848 -msgid "" -"Therefore, if you don't mind a little extra effort, please use the normal " -"converters instead of legacy converters." -msgstr "" - -#: ../../howto/clinic.rst:851 -msgid "" -"In a nutshell, the syntax for Argument Clinic (non-legacy) converters looks " -"like a Python function call. However, if there are no explicit arguments to " -"the function (all functions take their default values), you may omit the " -"parentheses. Thus ``bool`` and ``bool()`` are exactly the same converters." -msgstr "" - -#: ../../howto/clinic.rst:857 -msgid "" -"All arguments to Argument Clinic converters are keyword-only. All Argument " -"Clinic converters accept the following arguments:" -msgstr "" - -#: ../../howto/clinic.rst:865 -msgid "*c_default*" -msgstr "*c_default*" - -#: ../../howto/clinic.rst:861 -msgid "" -"The default value for this parameter when defined in C. Specifically, this " -"will be the initializer for the variable declared in the \"parse " -"function\". See :ref:`the section on default values ` for " -"how to use this. Specified as a string." -msgstr "" - -#: ../../howto/clinic.rst:870 -msgid "*annotation*" -msgstr "*annotation*" - -#: ../../howto/clinic.rst:868 -msgid "" -"The annotation value for this parameter. Not currently supported, because :" -"pep:`8` mandates that the Python library may not use annotations." -msgstr "" - -#: ../../howto/clinic.rst:873 -msgid "*unused*" -msgstr "*unused*" - -#: ../../howto/clinic.rst:873 -msgid "" -"Wrap the argument with :c:macro:`Py_UNUSED` in the impl function signature." -msgstr "" - -#: ../../howto/clinic.rst:875 -msgid "" -"In addition, some converters accept additional arguments. Here is a list of " -"these arguments, along with their meanings:" -msgstr "" - -#: ../../howto/clinic.rst:884 -msgid "*accept*" -msgstr "*accept*" - -#: ../../howto/clinic.rst:879 -msgid "" -"A set of Python types (and possibly pseudo-types); this restricts the " -"allowable Python argument to values of these types. (This is not a general-" -"purpose facility; as a rule it only supports specific lists of types as " -"shown in the legacy converter table.)" -msgstr "" - -#: ../../howto/clinic.rst:884 -msgid "To accept ``None``, add ``NoneType`` to this set." -msgstr "" - -#: ../../howto/clinic.rst:889 -msgid "*bitwise*" -msgstr "*bitwise*" - -#: ../../howto/clinic.rst:887 -msgid "" -"Only supported for unsigned integers. The native integer value of this " -"Python argument will be written to the parameter without any range checking, " -"even for negative values." -msgstr "" - -#: ../../howto/clinic.rst:894 -msgid "*converter*" -msgstr "*converter*" - -#: ../../howto/clinic.rst:892 -msgid "" -"Only supported by the ``object`` converter. Specifies the name of a :ref:`C " -"\"converter function\" ` to use to convert this object to a " -"native type." -msgstr "" - -#: ../../howto/clinic.rst:899 -msgid "*encoding*" -msgstr "*encoding*" - -#: ../../howto/clinic.rst:897 -msgid "" -"Only supported for strings. Specifies the encoding to use when converting " -"this string from a Python str (Unicode) value into a C ``char *`` value." -msgstr "" - -#: ../../howto/clinic.rst:903 -msgid "*subclass_of*" -msgstr "*subclass_of*" - -#: ../../howto/clinic.rst:902 -msgid "" -"Only supported for the ``object`` converter. Requires that the Python value " -"be a subclass of a Python type, as expressed in C." -msgstr "" - -#: ../../howto/clinic.rst:908 -msgid "*type*" -msgstr "" - -#: ../../howto/clinic.rst:906 -msgid "" -"Only supported for the ``object`` and ``self`` converters. Specifies the C " -"type that will be used to declare the variable. Default value is " -"``\"PyObject *\"``." -msgstr "" - -#: ../../howto/clinic.rst:914 -msgid "*zeroes*" -msgstr "*zeroes*" - -#: ../../howto/clinic.rst:911 -msgid "" -"Only supported for strings. If true, embedded NUL bytes (``'\\\\0'``) are " -"permitted inside the value. The length of the string will be passed in to " -"the impl function, just after the string parameter, as a parameter named " -"``_length``." -msgstr "" - -#: ../../howto/clinic.rst:916 -msgid "" -"Please note, not every possible combination of arguments will work. Usually " -"these arguments are implemented by specific :c:func:`PyArg_ParseTuple` " -"*format units*, with specific behavior. For example, currently you cannot " -"call ``unsigned_short`` without also specifying ``bitwise=True``. Although " -"it's perfectly reasonable to think this would work, these semantics don't " -"map to any existing format unit. So Argument Clinic doesn't support it. " -"(Or, at least, not yet.)" -msgstr "" - -#: ../../howto/clinic.rst:924 -msgid "" -"Below is a table showing the mapping of legacy converters into real Argument " -"Clinic converters. On the left is the legacy converter, on the right is the " -"text you'd replace it with." -msgstr "" - -#: ../../howto/clinic.rst:929 -msgid "``'B'``" -msgstr "``'B'``" - -#: ../../howto/clinic.rst:929 -msgid "``unsigned_char(bitwise=True)``" -msgstr "``unsigned_char(bitwise=True)``" - -#: ../../howto/clinic.rst:930 -msgid "``'b'``" -msgstr "``'b'``" - -#: ../../howto/clinic.rst:930 -msgid "``unsigned_char``" -msgstr "``unsigned_char``" - -#: ../../howto/clinic.rst:931 -msgid "``'c'``" -msgstr "``'c'``" - -#: ../../howto/clinic.rst:931 -msgid "``char``" -msgstr "``char``" - -#: ../../howto/clinic.rst:932 -msgid "``'C'``" -msgstr "``'C'``" - -#: ../../howto/clinic.rst:932 -msgid "``int(accept={str})``" -msgstr "``int(accept={str})``" - -#: ../../howto/clinic.rst:933 -msgid "``'d'``" -msgstr "``'d'``" - -#: ../../howto/clinic.rst:933 -msgid "``double``" -msgstr "``double``" - -#: ../../howto/clinic.rst:934 -msgid "``'D'``" -msgstr "``'D'``" - -#: ../../howto/clinic.rst:934 -msgid "``Py_complex``" -msgstr "``Py_complex``" - -#: ../../howto/clinic.rst:935 -msgid "``'es'``" -msgstr "``'es'``" - -#: ../../howto/clinic.rst:935 -msgid "``str(encoding='name_of_encoding')``" -msgstr "``str(encoding='name_of_encoding')``" - -#: ../../howto/clinic.rst:936 -msgid "``'es#'``" -msgstr "``'es#'``" - -#: ../../howto/clinic.rst:936 -msgid "``str(encoding='name_of_encoding', zeroes=True)``" -msgstr "``str(encoding='name_of_encoding', zeroes=True)``" - -#: ../../howto/clinic.rst:937 -msgid "``'et'``" -msgstr "``'et'``" - -#: ../../howto/clinic.rst:937 -msgid "``str(encoding='name_of_encoding', accept={bytes, bytearray, str})``" -msgstr "``str(encoding='name_of_encoding', accept={bytes, bytearray, str})``" - -#: ../../howto/clinic.rst:938 -msgid "``'et#'``" -msgstr "``'et#'``" - -#: ../../howto/clinic.rst:938 -msgid "" -"``str(encoding='name_of_encoding', accept={bytes, bytearray, str}, " -"zeroes=True)``" -msgstr "" - -#: ../../howto/clinic.rst:939 -msgid "``'f'``" -msgstr "``'f'``" - -#: ../../howto/clinic.rst:939 -msgid "``float``" -msgstr "``float``" - -#: ../../howto/clinic.rst:940 -msgid "``'h'``" -msgstr "``'h'``" - -#: ../../howto/clinic.rst:940 -msgid "``short``" -msgstr "``short``" - -#: ../../howto/clinic.rst:941 -msgid "``'H'``" -msgstr "``'H'``" - -#: ../../howto/clinic.rst:941 -msgid "``unsigned_short(bitwise=True)``" -msgstr "``unsigned_short(bitwise=True)``" - -#: ../../howto/clinic.rst:942 -msgid "``'i'``" -msgstr "``'i'``" - -#: ../../howto/clinic.rst:942 -msgid "``int``" -msgstr "``int``" - -#: ../../howto/clinic.rst:943 -msgid "``'I'``" -msgstr "``'I'``" - -#: ../../howto/clinic.rst:943 -msgid "``unsigned_int(bitwise=True)``" -msgstr "``unsigned_int(bitwise=True)``" - -#: ../../howto/clinic.rst:944 -msgid "``'k'``" -msgstr "``'k'``" - -#: ../../howto/clinic.rst:944 -msgid "``unsigned_long(bitwise=True)``" -msgstr "``unsigned_long(bitwise=True)``" - -#: ../../howto/clinic.rst:945 -msgid "``'K'``" -msgstr "``'K'``" - -#: ../../howto/clinic.rst:945 -msgid "``unsigned_long_long(bitwise=True)``" -msgstr "``unsigned_long_long(bitwise=True)``" - -#: ../../howto/clinic.rst:946 -msgid "``'l'``" -msgstr "``'l'``" - -#: ../../howto/clinic.rst:946 -msgid "``long``" -msgstr "``long``" - -#: ../../howto/clinic.rst:947 -msgid "``'L'``" -msgstr "``'L'``" - -#: ../../howto/clinic.rst:947 -msgid "``long long``" -msgstr "``long long``" - -#: ../../howto/clinic.rst:948 -msgid "``'n'``" -msgstr "``'n'``" - -#: ../../howto/clinic.rst:948 -msgid "``Py_ssize_t``" -msgstr "``Py_ssize_t``" - -#: ../../howto/clinic.rst:949 -msgid "``'O'``" -msgstr "``'O'``" - -#: ../../howto/clinic.rst:949 -msgid "``object``" -msgstr "``object``" - -#: ../../howto/clinic.rst:950 -msgid "``'O!'``" -msgstr "``'O!'``" - -#: ../../howto/clinic.rst:950 -msgid "``object(subclass_of='&PySomething_Type')``" -msgstr "``object(subclass_of='&PySomething_Type')``" - -#: ../../howto/clinic.rst:951 -msgid "``'O&'``" -msgstr "``'O&'``" - -#: ../../howto/clinic.rst:951 -msgid "``object(converter='name_of_c_function')``" -msgstr "``object(converter='name_of_c_function')``" - -#: ../../howto/clinic.rst:952 -msgid "``'p'``" -msgstr "``'p'``" - -#: ../../howto/clinic.rst:952 -msgid "``bool``" -msgstr "``bool``" - -#: ../../howto/clinic.rst:953 -msgid "``'S'``" -msgstr "``'S'``" - -#: ../../howto/clinic.rst:953 -msgid "``PyBytesObject``" -msgstr "``PyBytesObject``" - -#: ../../howto/clinic.rst:954 -msgid "``'s'``" -msgstr "``'s'``" - -#: ../../howto/clinic.rst:954 -msgid "``str``" -msgstr "``str``" - -#: ../../howto/clinic.rst:955 -msgid "``'s#'``" -msgstr "``'s#'``" - -#: ../../howto/clinic.rst:955 -msgid "``str(zeroes=True)``" -msgstr "``str(zeroes=True)``" - -#: ../../howto/clinic.rst:956 -msgid "``'s*'``" -msgstr "``'s*'``" - -#: ../../howto/clinic.rst:956 -msgid "``Py_buffer(accept={buffer, str})``" -msgstr "``Py_buffer(accept={buffer, str})``" - -#: ../../howto/clinic.rst:957 -msgid "``'U'``" -msgstr "``'U'``" - -#: ../../howto/clinic.rst:957 -msgid "``unicode``" -msgstr "``unicode``" - -#: ../../howto/clinic.rst:958 -msgid "``'u'``" -msgstr "``'u'``" - -#: ../../howto/clinic.rst:958 -msgid "``wchar_t``" -msgstr "``wchar_t``" - -#: ../../howto/clinic.rst:959 -msgid "``'u#'``" -msgstr "``'u#'``" - -#: ../../howto/clinic.rst:959 -msgid "``wchar_t(zeroes=True)``" -msgstr "``wchar_t(zeroes=True)``" - -#: ../../howto/clinic.rst:960 -msgid "``'w*'``" -msgstr "``'w*'``" - -#: ../../howto/clinic.rst:960 -msgid "``Py_buffer(accept={rwbuffer})``" -msgstr "``Py_buffer(accept={rwbuffer})``" - -#: ../../howto/clinic.rst:961 -msgid "``'Y'``" -msgstr "``'Y'``" - -#: ../../howto/clinic.rst:961 -msgid "``PyByteArrayObject``" -msgstr "``PyByteArrayObject``" - -#: ../../howto/clinic.rst:962 -msgid "``'y'``" -msgstr "``'y'``" - -#: ../../howto/clinic.rst:962 -msgid "``str(accept={bytes})``" -msgstr "``str(accept={bytes})``" - -#: ../../howto/clinic.rst:963 -msgid "``'y#'``" -msgstr "``'y#'``" - -#: ../../howto/clinic.rst:963 -msgid "``str(accept={robuffer}, zeroes=True)``" -msgstr "``str(accept={robuffer}, zeroes=True)``" - -#: ../../howto/clinic.rst:964 -msgid "``'y*'``" -msgstr "``'y*'``" - -#: ../../howto/clinic.rst:964 -msgid "``Py_buffer``" -msgstr "``Py_buffer``" - -#: ../../howto/clinic.rst:965 -msgid "``'Z'``" -msgstr "``'Z'``" - -#: ../../howto/clinic.rst:965 -msgid "``wchar_t(accept={str, NoneType})``" -msgstr "``wchar_t(accept={str, NoneType})``" - -#: ../../howto/clinic.rst:966 -msgid "``'Z#'``" -msgstr "``'Z#'``" - -#: ../../howto/clinic.rst:966 -msgid "``wchar_t(accept={str, NoneType}, zeroes=True)``" -msgstr "``wchar_t(accept={str, NoneType}, zeroes=True)``" - -#: ../../howto/clinic.rst:967 -msgid "``'z'``" -msgstr "``'z'``" - -#: ../../howto/clinic.rst:967 -msgid "``str(accept={str, NoneType})``" -msgstr "``str(accept={str, NoneType})``" - -#: ../../howto/clinic.rst:968 -msgid "``'z#'``" -msgstr "``'z#'``" - -#: ../../howto/clinic.rst:968 -msgid "``str(accept={str, NoneType}, zeroes=True)``" -msgstr "``str(accept={str, NoneType}, zeroes=True)``" - -#: ../../howto/clinic.rst:969 -msgid "``'z*'``" -msgstr "``'z*'``" - -#: ../../howto/clinic.rst:969 -msgid "``Py_buffer(accept={buffer, str, NoneType})``" -msgstr "``Py_buffer(accept={buffer, str, NoneType})``" - -#: ../../howto/clinic.rst:972 -msgid "" -"As an example, here's our sample ``pickle.Pickler.dump`` using the proper " -"converter::" -msgstr "" - -#: ../../howto/clinic.rst:985 -msgid "" -"One advantage of real converters is that they're more flexible than legacy " -"converters. For example, the ``unsigned_int`` converter (and all the " -"``unsigned_`` converters) can be specified without ``bitwise=True``. Their " -"default behavior performs range checking on the value, and they won't accept " -"negative numbers. You just can't do that with a legacy converter!" -msgstr "" - -#: ../../howto/clinic.rst:991 -msgid "" -"Argument Clinic will show you all the converters it has available. For each " -"converter it'll show you all the parameters it accepts, along with the " -"default value for each parameter. Just run ``Tools/clinic/clinic.py --" -"converters`` to see the full list." -msgstr "" - -#: ../../howto/clinic.rst:998 -msgid "How to use the ``Py_buffer`` converter" -msgstr "" - -#: ../../howto/clinic.rst:1000 -msgid "" -"When using the ``Py_buffer`` converter (or the ``'s*'``, ``'w*'``, ``'*y'``, " -"or ``'z*'`` legacy converters), you *must* not call :c:func:" -"`PyBuffer_Release` on the provided buffer. Argument Clinic generates code " -"that does it for you (in the parsing function)." -msgstr "" - -#: ../../howto/clinic.rst:1009 -msgid "How to use advanced converters" -msgstr "" - -#: ../../howto/clinic.rst:1011 -msgid "" -"Remember those format units you skipped for your first time because they " -"were advanced? Here's how to handle those too." -msgstr "" - -#: ../../howto/clinic.rst:1014 -msgid "" -"The trick is, all those format units take arguments—either conversion " -"functions, or types, or strings specifying an encoding. (But \"legacy " -"converters\" don't support arguments. That's why we skipped them for your " -"first function.) The argument you specified to the format unit is now an " -"argument to the converter; this argument is either *converter* (for ``O&``), " -"*subclass_of* (for ``O!``), or *encoding* (for all the format units that " -"start with ``e``)." -msgstr "" - -#: ../../howto/clinic.rst:1022 -msgid "" -"When using *subclass_of*, you may also want to use the other custom argument " -"for ``object()``: *type*, which lets you set the type actually used for the " -"parameter. For example, if you want to ensure that the object is a subclass " -"of :c:var:`PyUnicode_Type`, you probably want to use the converter " -"``object(type='PyUnicodeObject *', subclass_of='&PyUnicode_Type')``." -msgstr "" - -#: ../../howto/clinic.rst:1028 -msgid "" -"One possible problem with using Argument Clinic: it takes away some possible " -"flexibility for the format units starting with ``e``. When writing a :c:" -"func:`!PyArg_Parse*` call by hand, you could theoretically decide at runtime " -"what encoding string to pass to that call. But now this string must be " -"hard-coded at Argument-Clinic-preprocessing-time. This limitation is " -"deliberate; it made supporting this format unit much easier, and may allow " -"for future optimizations. This restriction doesn't seem unreasonable; " -"CPython itself always passes in static hard-coded encoding strings for " -"parameters whose format units start with ``e``." -msgstr "" - -#: ../../howto/clinic.rst:1042 -msgid "How to assign default values to parameter" -msgstr "" - -#: ../../howto/clinic.rst:1044 -msgid "" -"Default values for parameters can be any of a number of values. At their " -"simplest, they can be string, int, or float literals:" -msgstr "" - -#: ../../howto/clinic.rst:1053 -msgid "They can also use any of Python's built-in constants:" -msgstr "" - -#: ../../howto/clinic.rst:1061 -msgid "" -"There's also special support for a default value of ``NULL``, and for simple " -"expressions, documented in the following sections." -msgstr "" - -#: ../../howto/clinic.rst:1066 -msgid "The ``NULL`` default value" -msgstr "" - -#: ../../howto/clinic.rst:1068 -msgid "" -"For string and object parameters, you can set them to ``None`` to indicate " -"that there's no default. However, that means the C variable will be " -"initialized to ``Py_None``. For convenience's sakes, there's a special " -"value called ``NULL`` for just this reason: from Python's perspective it " -"behaves like a default value of ``None``, but the C variable is initialized " -"with ``NULL``." -msgstr "" - -#: ../../howto/clinic.rst:1077 -msgid "Symbolic default values" -msgstr "" - -#: ../../howto/clinic.rst:1079 -msgid "" -"The default value you provide for a parameter can't be any arbitrary " -"expression. Currently the following are explicitly supported:" -msgstr "" - -#: ../../howto/clinic.rst:1082 -msgid "Numeric constants (integer and float)" -msgstr "" - -#: ../../howto/clinic.rst:1083 -msgid "String constants" -msgstr "" - -#: ../../howto/clinic.rst:1084 -msgid "``True``, ``False``, and ``None``" -msgstr "``True``、``False`` 和 ``None``" - -#: ../../howto/clinic.rst:1085 -msgid "" -"Simple symbolic constants like :py:data:`sys.maxsize`, which must start with " -"the name of the module" -msgstr "" - -#: ../../howto/clinic.rst:1088 -msgid "" -"(In the future, this may need to get even more elaborate, to allow full " -"expressions like ``CONSTANT - 1``.)" -msgstr "" - -#: ../../howto/clinic.rst:1093 -msgid "Expressions as default values" -msgstr "" - -#: ../../howto/clinic.rst:1095 -msgid "" -"The default value for a parameter can be more than just a literal value. It " -"can be an entire expression, using math operators and looking up attributes " -"on objects. However, this support isn't exactly simple, because of some non-" -"obvious semantics." -msgstr "" - -#: ../../howto/clinic.rst:1100 -msgid "Consider the following example:" -msgstr "" - -#: ../../howto/clinic.rst:1106 -msgid "" -":py:data:`sys.maxsize` can have different values on different platforms. " -"Therefore Argument Clinic can't simply evaluate that expression locally and " -"hard-code it in C. So it stores the default in such a way that it will get " -"evaluated at runtime, when the user asks for the function's signature." -msgstr "" - -#: ../../howto/clinic.rst:1111 -msgid "" -"What namespace is available when the expression is evaluated? It's " -"evaluated in the context of the module the builtin came from. So, if your " -"module has an attribute called :py:attr:`!max_widgets`, you may simply use " -"it:" -msgstr "" - -#: ../../howto/clinic.rst:1119 -msgid "" -"If the symbol isn't found in the current module, it fails over to looking " -"in :py:data:`sys.modules`. That's how it can find :py:data:`sys.maxsize` " -"for example. (Since you don't know in advance what modules the user will " -"load into their interpreter, it's best to restrict yourself to modules that " -"are preloaded by Python itself.)" -msgstr "" - -#: ../../howto/clinic.rst:1124 -msgid "" -"Evaluating default values only at runtime means Argument Clinic can't " -"compute the correct equivalent C default value. So you need to tell it " -"explicitly. When you use an expression, you must also specify the equivalent " -"expression in C, using the *c_default* parameter to the converter:" -msgstr "" - -#: ../../howto/clinic.rst:1133 -msgid "" -"Another complication: Argument Clinic can't know in advance whether or not " -"the expression you supply is valid. It parses it to make sure it looks " -"legal, but it can't *actually* know. You must be very careful when using " -"expressions to specify values that are guaranteed to be valid at runtime!" -msgstr "" - -#: ../../howto/clinic.rst:1138 -msgid "" -"Finally, because expressions must be representable as static C values, there " -"are many restrictions on legal expressions. Here's a list of Python " -"features you're not permitted to use:" -msgstr "" - -#: ../../howto/clinic.rst:1142 -msgid "Function calls." -msgstr "" - -#: ../../howto/clinic.rst:1143 -msgid "Inline if statements (``3 if foo else 5``)." -msgstr "" - -#: ../../howto/clinic.rst:1144 -msgid "Automatic sequence unpacking (``*[1, 2, 3]``)." -msgstr "" - -#: ../../howto/clinic.rst:1145 -msgid "List/set/dict comprehensions and generator expressions." -msgstr "" - -#: ../../howto/clinic.rst:1146 -msgid "Tuple/list/set/dict literals." -msgstr "" - -#: ../../howto/clinic.rst:1152 -msgid "How to use return converters" -msgstr "" - -#: ../../howto/clinic.rst:1154 -msgid "" -"By default, the impl function Argument Clinic generates for you returns :c:" -"type:`PyObject * `. But your C function often computes some C " -"type, then converts it into the :c:type:`!PyObject *` at the last moment. " -"Argument Clinic handles converting your inputs from Python types into native " -"C types—why not have it convert your return value from a native C type into " -"a Python type too?" -msgstr "" - -#: ../../howto/clinic.rst:1162 -msgid "" -"That's what a \"return converter\" does. It changes your impl function to " -"return some C type, then adds code to the generated (non-impl) function to " -"handle converting that value into the appropriate :c:type:`!PyObject *`." -msgstr "" - -#: ../../howto/clinic.rst:1166 -msgid "" -"The syntax for return converters is similar to that of parameter converters. " -"You specify the return converter like it was a return annotation on the " -"function itself, using ``->`` notation." -msgstr "" - -#: ../../howto/clinic.rst:1170 -msgid "For example:" -msgstr "" - -#: ../../howto/clinic.rst:1183 -msgid "" -"Return converters behave much the same as parameter converters; they take " -"arguments, the arguments are all keyword-only, and if you're not changing " -"any of the default arguments you can omit the parentheses." -msgstr "" - -#: ../../howto/clinic.rst:1187 -msgid "" -"(If you use both ``\"as\"`` *and* a return converter for your function, the " -"``\"as\"`` should come before the return converter.)" -msgstr "" - -#: ../../howto/clinic.rst:1190 -msgid "" -"There's one additional complication when using return converters: how do you " -"indicate an error has occurred? Normally, a function returns a valid (non-" -"``NULL``) pointer for success, and ``NULL`` for failure. But if you use an " -"integer return converter, all integers are valid. How can Argument Clinic " -"detect an error? Its solution: each return converter implicitly looks for a " -"special value that indicates an error. If you return that value, and an " -"error has been set (c:func:`PyErr_Occurred` returns a true value), then the " -"generated code will propagate the error. Otherwise it will encode the value " -"you return like normal." -msgstr "" - -#: ../../howto/clinic.rst:1199 -msgid "Currently Argument Clinic supports only a few return converters:" -msgstr "" - -#: ../../howto/clinic.rst:1213 -msgid "" -"None of these take parameters. For all of these, return ``-1`` to indicate " -"error." -msgstr "" - -#: ../../howto/clinic.rst:1216 -msgid "" -"To see all the return converters Argument Clinic supports, along with their " -"parameters (if any), just run ``Tools/clinic/clinic.py --converters`` for " -"the full list." -msgstr "" - -#: ../../howto/clinic.rst:1222 -msgid "How to clone existing functions" -msgstr "" - -#: ../../howto/clinic.rst:1224 -msgid "" -"If you have a number of functions that look similar, you may be able to use " -"Clinic's \"clone\" feature. When you clone an existing function, you reuse:" -msgstr "" - -#: ../../howto/clinic.rst:1228 -msgid "its parameters, including" -msgstr "" - -#: ../../howto/clinic.rst:1230 -msgid "their names," -msgstr "" - -#: ../../howto/clinic.rst:1232 -msgid "their converters, with all parameters," -msgstr "" - -#: ../../howto/clinic.rst:1234 -msgid "their default values," -msgstr "" - -#: ../../howto/clinic.rst:1236 -msgid "their per-parameter docstrings," -msgstr "" - -#: ../../howto/clinic.rst:1238 -msgid "" -"their *kind* (whether they're positional only, positional or keyword, or " -"keyword only), and" -msgstr "" - -#: ../../howto/clinic.rst:1241 -msgid "its return converter." -msgstr "" - -#: ../../howto/clinic.rst:1243 -msgid "" -"The only thing not copied from the original function is its docstring; the " -"syntax allows you to specify a new docstring." -msgstr "" - -#: ../../howto/clinic.rst:1246 -msgid "Here's the syntax for cloning a function::" -msgstr "" - -#: ../../howto/clinic.rst:1254 -msgid "" -"(The functions can be in different modules or classes. I wrote ``module." -"class`` in the sample just to illustrate that you must use the full path to " -"*both* functions.)" -msgstr "" - -#: ../../howto/clinic.rst:1258 -msgid "" -"Sorry, there's no syntax for partially cloning a function, or cloning a " -"function then modifying it. Cloning is an all-or nothing proposition." -msgstr "" - -#: ../../howto/clinic.rst:1261 -msgid "" -"Also, the function you are cloning from must have been previously defined in " -"the current file." -msgstr "" - -#: ../../howto/clinic.rst:1266 -msgid "How to call Python code" -msgstr "" - -#: ../../howto/clinic.rst:1268 -msgid "" -"The rest of the advanced topics require you to write Python code which lives " -"inside your C file and modifies Argument Clinic's runtime state. This is " -"simple: you simply define a Python block." -msgstr "" - -#: ../../howto/clinic.rst:1272 -msgid "" -"A Python block uses different delimiter lines than an Argument Clinic " -"function block. It looks like this::" -msgstr "" - -#: ../../howto/clinic.rst:1279 -msgid "" -"All the code inside the Python block is executed at the time it's parsed. " -"All text written to stdout inside the block is redirected into the " -"\"output\" after the block." -msgstr "" - -#: ../../howto/clinic.rst:1283 -msgid "" -"As an example, here's a Python block that adds a static integer variable to " -"the C code::" -msgstr "" - -#: ../../howto/clinic.rst:1296 -msgid "How to use the \"self converter\"" -msgstr "" - -#: ../../howto/clinic.rst:1298 -msgid "" -"Argument Clinic automatically adds a \"self\" parameter for you using a " -"default converter. It automatically sets the ``type`` of this parameter to " -"the \"pointer to an instance\" you specified when you declared the type. " -"However, you can override Argument Clinic's converter and specify one " -"yourself. Just add your own *self* parameter as the first parameter in a " -"block, and ensure that its converter is an instance of :class:`!" -"self_converter` or a subclass thereof." -msgstr "" - -#: ../../howto/clinic.rst:1307 -msgid "" -"What's the point? This lets you override the type of ``self``, or give it a " -"different default name." -msgstr "" - -#: ../../howto/clinic.rst:1310 -msgid "" -"How do you specify the custom type you want to cast ``self`` to? If you only " -"have one or two functions with the same type for ``self``, you can directly " -"use Argument Clinic's existing ``self`` converter, passing in the type you " -"want to use as the *type* parameter::" -msgstr "" - -#: ../../howto/clinic.rst:1326 -msgid "" -"On the other hand, if you have a lot of functions that will use the same " -"type for ``self``, it's best to create your own converter, subclassing :" -"class:`!self_converter` but overwriting the :py:attr:`!type` member::" -msgstr "" - -#: ../../howto/clinic.rst:1348 -msgid "How to use the \"defining class\" converter" -msgstr "" - -#: ../../howto/clinic.rst:1350 -msgid "" -"Argument Clinic facilitates gaining access to the defining class of a " -"method. This is useful for :ref:`heap type ` methods that need " -"to fetch module level state. Use :c:func:`PyType_FromModuleAndSpec` to " -"associate a new heap type with a module. You can now use :c:func:" -"`PyType_GetModuleState` on the defining class to fetch the module state, for " -"example from a module method." -msgstr "" - -#: ../../howto/clinic.rst:1356 -msgid "" -"Example from :source:`Modules/zlibmodule.c`. First, ``defining_class`` is " -"added to the clinic input::" -msgstr "" - -#: ../../howto/clinic.rst:1368 -msgid "" -"After running the Argument Clinic tool, the following function signature is " -"generated::" -msgstr "" - -#: ../../howto/clinic.rst:1378 -msgid "" -"The following code can now use ``PyType_GetModuleState(cls)`` to fetch the " -"module state::" -msgstr "" - -#: ../../howto/clinic.rst:1384 -msgid "" -"Each method may only have one argument using this converter, and it must " -"appear after ``self``, or, if ``self`` is not used, as the first argument. " -"The argument will be of type ``PyTypeObject *``. The argument will not " -"appear in the :py:attr:`!__text_signature__`." -msgstr "" - -#: ../../howto/clinic.rst:1389 -msgid "" -"The ``defining_class`` converter is not compatible with :py:meth:`!__init__` " -"and :py:meth:`!__new__` methods, which cannot use the :c:macro:`METH_METHOD` " -"convention." -msgstr "" - -#: ../../howto/clinic.rst:1393 -msgid "" -"It is not possible to use ``defining_class`` with slot methods. In order to " -"fetch the module state from such methods, use :c:func:" -"`PyType_GetModuleByDef` to look up the module and then :c:func:" -"`PyModule_GetState` to fetch the module state. Example from the " -"``setattro`` slot method in :source:`Modules/_threadmodule.c`::" -msgstr "" - -#: ../../howto/clinic.rst:1408 -msgid "See also :pep:`573`." -msgstr "也請見 :pep:`573`\\ 。" - -#: ../../howto/clinic.rst:1414 -msgid "How to write a custom converter" -msgstr "" - -#: ../../howto/clinic.rst:1416 -msgid "" -"A converter is a Python class that inherits from :py:class:`CConverter`. The " -"main purpose of a custom converter, is for parameters parsed with the ``O&`` " -"format unit --- parsing such a parameter means calling a :c:func:" -"`PyArg_ParseTuple` \"converter function\"." -msgstr "" - -#: ../../howto/clinic.rst:1421 -msgid "" -"Your converter class should be named :samp:`{ConverterName}_converter`. By " -"following this convention, your converter class will be automatically " -"registered with Argument Clinic, with its *converter name* being the name of " -"your converter class with the ``_converter`` suffix stripped off." -msgstr "" - -#: ../../howto/clinic.rst:1426 -msgid "" -"Instead of subclassing :py:meth:`!CConverter.__init__`, write a :py:meth:`!" -"converter_init` method. :py:meth:`!converter_init` always accepts a *self* " -"parameter. After *self*, all additional parameters **must** be keyword-only. " -"Any arguments passed to the converter in Argument Clinic will be passed " -"along to your :py:meth:`!converter_init` method. See :py:class:`CConverter` " -"for a list of members you may wish to specify in your subclass." -msgstr "" - -#: ../../howto/clinic.rst:1435 -msgid "" -"Here's the simplest example of a custom converter, from :source:`Modules/" -"zlibmodule.c`::" -msgstr "" - -#: ../../howto/clinic.rst:1446 -msgid "" -"This block adds a converter named ``ssize_t`` to Argument Clinic. Parameters " -"declared as ``ssize_t`` will be declared with type :c:type:`Py_ssize_t`, and " -"will be parsed by the ``'O&'`` format unit, which will call the :c:func:`!" -"ssize_t_converter` converter C function. ``ssize_t`` variables automatically " -"support default values." -msgstr "" - -#: ../../howto/clinic.rst:1452 -msgid "" -"More sophisticated custom converters can insert custom C code to handle " -"initialization and cleanup. You can see more examples of custom converters " -"in the CPython source tree; grep the C files for the string ``CConverter``." -msgstr "" - -#: ../../howto/clinic.rst:1459 -msgid "How to write a custom return converter" -msgstr "" +msgstr "Argument Clinic 指南" -#: ../../howto/clinic.rst:1461 +#: ../../howto/clinic.rst:13 msgid "" -"Writing a custom return converter is much like writing a custom converter. " -"Except it's somewhat simpler, because return converters are themselves much " -"simpler." +"The Argument Clinic How-TO has been moved to the `Python Developer's Guide " +"`__." msgstr "" - -#: ../../howto/clinic.rst:1465 -msgid "" -"Return converters must subclass :py:class:`!CReturnConverter`. There are no " -"examples yet of custom return converters, because they are not widely used " -"yet. If you wish to write your own return converter, please read :source:" -"`Tools/clinic/clinic.py`, specifically the implementation of :py:class:`!" -"CReturnConverter` and all its subclasses." -msgstr "" - -#: ../../howto/clinic.rst:1474 -msgid "How to convert ``METH_O`` and ``METH_NOARGS`` functions" -msgstr "" - -#: ../../howto/clinic.rst:1476 -msgid "" -"To convert a function using :c:macro:`METH_O`, make sure the function's " -"single argument is using the ``object`` converter, and mark the arguments as " -"positional-only::" -msgstr "" - -#: ../../howto/clinic.rst:1488 -msgid "" -"To convert a function using :c:macro:`METH_NOARGS`, just don't specify any " -"arguments." -msgstr "" - -#: ../../howto/clinic.rst:1491 -msgid "" -"You can still use a self converter, a return converter, and specify a *type* " -"argument to the object converter for :c:macro:`METH_O`." -msgstr "" - -#: ../../howto/clinic.rst:1496 -msgid "How to convert ``tp_new`` and ``tp_init`` functions" -msgstr "" - -#: ../../howto/clinic.rst:1498 -msgid "" -"You can convert :c:member:`~PyTypeObject.tp_new` and :c:member:" -"`~PyTypeObject.tp_init` functions. Just name them ``__new__`` or " -"``__init__`` as appropriate. Notes:" -msgstr "" - -#: ../../howto/clinic.rst:1502 -msgid "" -"The function name generated for ``__new__`` doesn't end in ``__new__`` like " -"it would by default. It's just the name of the class, converted into a " -"valid C identifier." -msgstr "" - -#: ../../howto/clinic.rst:1506 -msgid "No :c:type:`PyMethodDef` ``#define`` is generated for these functions." -msgstr "" - -#: ../../howto/clinic.rst:1508 -msgid "``__init__`` functions return ``int``, not ``PyObject *``." -msgstr "" - -#: ../../howto/clinic.rst:1510 -msgid "Use the docstring as the class docstring." -msgstr "" - -#: ../../howto/clinic.rst:1512 -msgid "" -"Although ``__new__`` and ``__init__`` functions must always accept both the " -"``args`` and ``kwargs`` objects, when converting you may specify any " -"signature for these functions that you like. (If your function doesn't " -"support keywords, the parsing function generated will throw an exception if " -"it receives any.)" -msgstr "" - -#: ../../howto/clinic.rst:1520 -msgid "How to change and redirect Clinic's output" -msgstr "" - -#: ../../howto/clinic.rst:1522 -msgid "" -"It can be inconvenient to have Clinic's output interspersed with your " -"conventional hand-edited C code. Luckily, Clinic is configurable: you can " -"buffer up its output for printing later (or earlier!), or write its output " -"to a separate file. You can also add a prefix or suffix to every line of " -"Clinic's generated output." -msgstr "" - -#: ../../howto/clinic.rst:1528 -msgid "" -"While changing Clinic's output in this manner can be a boon to readability, " -"it may result in Clinic code using types before they are defined, or your " -"code attempting to use Clinic-generated code before it is defined. These " -"problems can be easily solved by rearranging the declarations in your file, " -"or moving where Clinic's generated code goes. (This is why the default " -"behavior of Clinic is to output everything into the current block; while " -"many people consider this hampers readability, it will never require " -"rearranging your code to fix definition-before-use problems.)" -msgstr "" - -#: ../../howto/clinic.rst:1537 -msgid "Let's start with defining some terminology:" -msgstr "" - -#: ../../howto/clinic.rst:1564 -msgid "*field*" -msgstr "" - -#: ../../howto/clinic.rst:1540 -msgid "" -"A field, in this context, is a subsection of Clinic's output. For example, " -"the ``#define`` for the :c:type:`PyMethodDef` structure is a field, called " -"``methoddef_define``. Clinic has seven different fields it can output per " -"function definition:" -msgstr "" - -#: ../../howto/clinic.rst:1555 -msgid "" -"All the names are of the form ``\"_\"``, where ``\"\"`` is the " -"semantic object represented (the parsing function, the impl function, the " -"docstring, or the methoddef structure) and ``\"\"`` represents what kind " -"of statement the field is. Field names that end in ``\"_prototype\"`` " -"represent forward declarations of that thing, without the actual body/data " -"of the thing; field names that end in ``\"_definition\"`` represent the " -"actual definition of the thing, with the body/data of the thing. " -"(``\"methoddef\"`` is special, it's the only one that ends with " -"``\"_define\"``, representing that it's a preprocessor #define.)" -msgstr "" - -#: ../../howto/clinic.rst:1598 -msgid "*destination*" -msgstr "" - -#: ../../howto/clinic.rst:1567 -msgid "" -"A destination is a place Clinic can write output to. There are five built-" -"in destinations:" -msgstr "" - -#: ../../howto/clinic.rst:1572 ../../howto/clinic.rst:1647 -#: ../../howto/clinic.rst:1725 -msgid "``block``" -msgstr "``block``" - -#: ../../howto/clinic.rst:1571 -msgid "" -"The default destination: printed in the output section of the current Clinic " -"block." -msgstr "" - -#: ../../howto/clinic.rst:1578 ../../howto/clinic.rst:1674 -#: ../../howto/clinic.rst:1728 -msgid "``buffer``" -msgstr "``buffer``" - -#: ../../howto/clinic.rst:1575 -msgid "" -"A text buffer where you can save text for later. Text sent here is appended " -"to the end of any existing text. It's an error to have any text left in the " -"buffer when Clinic finishes processing a file." -msgstr "" - -#: ../../howto/clinic.rst:1589 ../../howto/clinic.rst:1660 -#: ../../howto/clinic.rst:1754 -msgid "``file``" -msgstr "``file``" - -#: ../../howto/clinic.rst:1581 -msgid "" -"A separate \"clinic file\" that will be created automatically by Clinic. The " -"filename chosen for the file is ``{basename}.clinic{extension}``, where " -"``basename`` and ``extension`` were assigned the output from ``os.path." -"splitext()`` run on the current file. (Example: the ``file`` destination " -"for :file:`_pickle.c` would be written to :file:`_pickle.clinic.c`.)" -msgstr "" - -#: ../../howto/clinic.rst:1588 -msgid "" -"**Important: When using a** ``file`` **destination, you** *must check in* " -"**the generated file!**" -msgstr "" - -#: ../../howto/clinic.rst:1594 ../../howto/clinic.rst:1687 -#: ../../howto/clinic.rst:1758 -msgid "``two-pass``" -msgstr "``two-pass``" - -#: ../../howto/clinic.rst:1592 -msgid "" -"A buffer like ``buffer``. However, a two-pass buffer can only be dumped " -"once, and it prints out all text sent to it during all processing, even from " -"Clinic blocks *after* the dumping point." -msgstr "" - -#: ../../howto/clinic.rst:1598 ../../howto/clinic.rst:1721 -msgid "``suppress``" -msgstr "``suppress``" - -#: ../../howto/clinic.rst:1597 -msgid "The text is suppressed—thrown away." -msgstr "" - -#: ../../howto/clinic.rst:1600 -msgid "Clinic defines five new directives that let you reconfigure its output." -msgstr "" - -#: ../../howto/clinic.rst:1602 -msgid "The first new directive is ``dump``:" -msgstr "" - -#: ../../howto/clinic.rst:1608 -msgid "" -"This dumps the current contents of the named destination into the output of " -"the current block, and empties it. This only works with ``buffer`` and " -"``two-pass`` destinations." -msgstr "" - -#: ../../howto/clinic.rst:1612 -msgid "" -"The second new directive is ``output``. The most basic form of ``output`` " -"is like this:" -msgstr "" - -#: ../../howto/clinic.rst:1619 -msgid "" -"This tells Clinic to output *field* to *destination*. ``output`` also " -"supports a special meta-destination, called ``everything``, which tells " -"Clinic to output *all* fields to that *destination*." -msgstr "" - -#: ../../howto/clinic.rst:1623 -msgid "``output`` has a number of other functions:" -msgstr "" - -#: ../../howto/clinic.rst:1632 -msgid "" -"``output push`` and ``output pop`` allow you to push and pop configurations " -"on an internal configuration stack, so that you can temporarily modify the " -"output configuration, then easily restore the previous configuration. " -"Simply push before your change to save the current configuration, then pop " -"when you wish to restore the previous configuration." -msgstr "" - -#: ../../howto/clinic.rst:1639 -msgid "" -"``output preset`` sets Clinic's output to one of several built-in preset " -"configurations, as follows:" -msgstr "" - -#: ../../howto/clinic.rst:1643 -msgid "" -"Clinic's original starting configuration. Writes everything immediately " -"after the input block." -msgstr "" - -#: ../../howto/clinic.rst:1646 -msgid "" -"Suppress the ``parser_prototype`` and ``docstring_prototype``, write " -"everything else to ``block``." -msgstr "" - -#: ../../howto/clinic.rst:1650 -msgid "" -"Designed to write everything to the \"clinic file\" that it can. You then " -"``#include`` this file near the top of your file. You may need to rearrange " -"your file to make this work, though usually this just means creating forward " -"declarations for various ``typedef`` and ``PyTypeObject`` definitions." -msgstr "" - -#: ../../howto/clinic.rst:1656 -msgid "" -"Suppress the ``parser_prototype`` and ``docstring_prototype``, write the " -"``impl_definition`` to ``block``, and write everything else to ``file``." -msgstr "" - -#: ../../howto/clinic.rst:1660 -msgid "The default filename is ``\"{dirname}/clinic/{basename}.h\"``." -msgstr "" - -#: ../../howto/clinic.rst:1663 -msgid "" -"Save up most of the output from Clinic, to be written into your file near " -"the end. For Python files implementing modules or builtin types, it's " -"recommended that you dump the buffer just above the static structures for " -"your module or builtin type; these are normally very near the end. Using " -"``buffer`` may require even more editing than ``file``, if your file has " -"static ``PyMethodDef`` arrays defined in the middle of the file." -msgstr "" - -#: ../../howto/clinic.rst:1672 -msgid "" -"Suppress the ``parser_prototype``, ``impl_prototype``, and " -"``docstring_prototype``, write the ``impl_definition`` to ``block``, and " -"write everything else to ``file``." -msgstr "" - -#: ../../howto/clinic.rst:1677 -msgid "" -"Similar to the ``buffer`` preset, but writes forward declarations to the " -"``two-pass`` buffer, and definitions to the ``buffer``. This is similar to " -"the ``buffer`` preset, but may require less editing than ``buffer``. Dump " -"the ``two-pass`` buffer near the top of your file, and dump the ``buffer`` " -"near the end just like you would when using the ``buffer`` preset." -msgstr "" - -#: ../../howto/clinic.rst:1684 -msgid "" -"Suppresses the ``impl_prototype``, write the ``impl_definition`` to " -"``block``, write ``docstring_prototype``, ``methoddef_define``, and " -"``parser_prototype`` to ``two-pass``, write everything else to ``buffer``." -msgstr "" - -#: ../../howto/clinic.rst:1698 -msgid "``partial-buffer``" -msgstr "``partial-buffer``" - -#: ../../howto/clinic.rst:1690 -msgid "" -"Similar to the ``buffer`` preset, but writes more things to ``block``, only " -"writing the really big chunks of generated code to ``buffer``. This avoids " -"the definition-before-use problem of ``buffer`` completely, at the small " -"cost of having slightly more stuff in the block's output. Dump the " -"``buffer`` near the end, just like you would when using the ``buffer`` " -"preset." -msgstr "" - -#: ../../howto/clinic.rst:1697 -msgid "" -"Suppresses the ``impl_prototype``, write the ``docstring_definition`` and " -"``parser_definition`` to ``buffer``, write everything else to ``block``." -msgstr "" - -#: ../../howto/clinic.rst:1700 -msgid "The third new directive is ``destination``:" -msgstr "" - -#: ../../howto/clinic.rst:1706 -msgid "This performs an operation on the destination named ``name``." -msgstr "" - -#: ../../howto/clinic.rst:1708 -msgid "There are two defined subcommands: ``new`` and ``clear``." -msgstr "" - -#: ../../howto/clinic.rst:1710 -msgid "The ``new`` subcommand works like this:" -msgstr "" - -#: ../../howto/clinic.rst:1716 -msgid "" -"This creates a new destination with name ```` and type ````." -msgstr "" - -#: ../../howto/clinic.rst:1718 -msgid "There are five destination types:" -msgstr "" - -#: ../../howto/clinic.rst:1721 -msgid "Throws the text away." -msgstr "" - -#: ../../howto/clinic.rst:1724 -msgid "" -"Writes the text to the current block. This is what Clinic originally did." -msgstr "" - -#: ../../howto/clinic.rst:1728 -msgid "A simple text buffer, like the \"buffer\" builtin destination above." -msgstr "" - -#: ../../howto/clinic.rst:1731 -msgid "" -"A text file. The file destination takes an extra argument, a template to " -"use for building the filename, like so:" -msgstr "" - -#: ../../howto/clinic.rst:1734 -msgid "destination new " -msgstr "" - -#: ../../howto/clinic.rst:1736 -msgid "" -"The template can use three strings internally that will be replaced by bits " -"of the filename:" -msgstr "" - -#: ../../howto/clinic.rst:1739 -msgid "{path}" -msgstr "{path}" - -#: ../../howto/clinic.rst:1740 -msgid "The full path to the file, including directory and full filename." -msgstr "" - -#: ../../howto/clinic.rst:1741 -msgid "{dirname}" -msgstr "{dirname}" - -#: ../../howto/clinic.rst:1742 -msgid "The name of the directory the file is in." -msgstr "" - -#: ../../howto/clinic.rst:1743 -msgid "{basename}" -msgstr "{basename}" - -#: ../../howto/clinic.rst:1744 -msgid "Just the name of the file, not including the directory." -msgstr "" - -#: ../../howto/clinic.rst:1746 -msgid "{basename_root}" -msgstr "{basename_root}" - -#: ../../howto/clinic.rst:1746 -msgid "" -"Basename with the extension clipped off (everything up to but not including " -"the last '.')." -msgstr "" - -#: ../../howto/clinic.rst:1750 -msgid "{basename_extension}" -msgstr "{basename_extension}" - -#: ../../howto/clinic.rst:1749 -msgid "" -"The last '.' and everything after it. If the basename does not contain a " -"period, this will be the empty string." -msgstr "" - -#: ../../howto/clinic.rst:1752 -msgid "" -"If there are no periods in the filename, {basename} and {filename} are the " -"same, and {extension} is empty. \"{basename}{extension}\" is always exactly " -"the same as \"{filename}\".\"" -msgstr "" - -#: ../../howto/clinic.rst:1757 -msgid "A two-pass buffer, like the \"two-pass\" builtin destination above." -msgstr "" - -#: ../../howto/clinic.rst:1760 -msgid "The ``clear`` subcommand works like this:" -msgstr "" - -#: ../../howto/clinic.rst:1766 -msgid "" -"It removes all the accumulated text up to this point in the destination. (I " -"don't know what you'd need this for, but I thought maybe it'd be useful " -"while someone's experimenting.)" -msgstr "" - -#: ../../howto/clinic.rst:1770 -msgid "The fourth new directive is ``set``:" -msgstr "" - -#: ../../howto/clinic.rst:1777 -msgid "" -"``set`` lets you set two internal variables in Clinic. ``line_prefix`` is a " -"string that will be prepended to every line of Clinic's output; " -"``line_suffix`` is a string that will be appended to every line of Clinic's " -"output." -msgstr "" - -#: ../../howto/clinic.rst:1781 -msgid "Both of these support two format strings:" -msgstr "" - -#: ../../howto/clinic.rst:1784 -msgid "``{block comment start}``" -msgstr "``{block comment start}``" - -#: ../../howto/clinic.rst:1784 -msgid "" -"Turns into the string ``/*``, the start-comment text sequence for C files." -msgstr "" - -#: ../../howto/clinic.rst:1787 -msgid "``{block comment end}``" -msgstr "``{block comment end}``" - -#: ../../howto/clinic.rst:1787 -msgid "" -"Turns into the string ``*/``, the end-comment text sequence for C files." -msgstr "" - -#: ../../howto/clinic.rst:1789 -msgid "" -"The final new directive is one you shouldn't need to use directly, called " -"``preserve``:" -msgstr "" - -#: ../../howto/clinic.rst:1796 -msgid "" -"This tells Clinic that the current contents of the output should be kept, " -"unmodified. This is used internally by Clinic when dumping output into " -"``file`` files; wrapping it in a Clinic block lets Clinic use its existing " -"checksum functionality to ensure the file was not modified by hand before it " -"gets overwritten." -msgstr "" - -#: ../../howto/clinic.rst:1803 -msgid "How to use the ``#ifdef`` trick" -msgstr "" - -#: ../../howto/clinic.rst:1805 -msgid "" -"If you're converting a function that isn't available on all platforms, " -"there's a trick you can use to make life a little easier. The existing code " -"probably looks like this::" -msgstr "" - -#: ../../howto/clinic.rst:1816 -msgid "" -"And then in the ``PyMethodDef`` structure at the bottom the existing code " -"will have:" -msgstr "" - -#: ../../howto/clinic.rst:1825 -msgid "" -"In this scenario, you should enclose the body of your impl function inside " -"the ``#ifdef``, like so::" -msgstr "" - -#: ../../howto/clinic.rst:1839 -msgid "" -"Then, remove those three lines from the :c:type:`PyMethodDef` structure, " -"replacing them with the macro Argument Clinic generated:" -msgstr "" - -#: ../../howto/clinic.rst:1846 -msgid "" -"(You can find the real name for this macro inside the generated code. Or you " -"can calculate it yourself: it's the name of your function as defined on the " -"first line of your block, but with periods changed to underscores, " -"uppercased, and ``\"_METHODDEF\"`` added to the end.)" -msgstr "" - -#: ../../howto/clinic.rst:1851 -msgid "" -"Perhaps you're wondering: what if ``HAVE_FUNCTIONNAME`` isn't defined? The " -"``MODULE_FUNCTIONNAME_METHODDEF`` macro won't be defined either!" -msgstr "" - -#: ../../howto/clinic.rst:1854 -msgid "" -"Here's where Argument Clinic gets very clever. It actually detects that the " -"Argument Clinic block might be deactivated by the ``#ifdef``. When that " -"happens, it generates a little extra code that looks like this::" -msgstr "" - -#: ../../howto/clinic.rst:1862 -msgid "" -"That means the macro always works. If the function is defined, this turns " -"into the correct structure, including the trailing comma. If the function " -"is undefined, this turns into nothing." -msgstr "" - -#: ../../howto/clinic.rst:1866 -msgid "" -"However, this causes one ticklish problem: where should Argument Clinic put " -"this extra code when using the \"block\" output preset? It can't go in the " -"output block, because that could be deactivated by the ``#ifdef``. (That's " -"the whole point!)" -msgstr "" - -#: ../../howto/clinic.rst:1870 -msgid "" -"In this situation, Argument Clinic writes the extra code to the \"buffer\" " -"destination. This may mean that you get a complaint from Argument Clinic:" -msgstr "" - -#: ../../howto/clinic.rst:1878 -msgid "" -"When this happens, just open your file, find the ``dump buffer`` block that " -"Argument Clinic added to your file (it'll be at the very bottom), then move " -"it above the :c:type:`PyMethodDef` structure where that macro is used." -msgstr "" - -#: ../../howto/clinic.rst:1884 -msgid "How to use Argument Clinic in Python files" -msgstr "" - -#: ../../howto/clinic.rst:1886 -msgid "" -"It's actually possible to use Argument Clinic to preprocess Python files. " -"There's no point to using Argument Clinic blocks, of course, as the output " -"wouldn't make any sense to the Python interpreter. But using Argument " -"Clinic to run Python blocks lets you use Python as a Python preprocessor!" -msgstr "" - -#: ../../howto/clinic.rst:1891 -msgid "" -"Since Python comments are different from C comments, Argument Clinic blocks " -"embedded in Python files look slightly different. They look like this:" -msgstr "" - -#~ msgid "``type``" -#~ msgstr "``type``" - -#~ msgid "``default``" -#~ msgstr "``default``" - -#~ msgid "``py_default``" -#~ msgstr "``py_default``" - -#~ msgid "``c_ignored_default``" -#~ msgstr "``c_ignored_default``" - -#~ msgid "``impl_by_reference``" -#~ msgstr "``impl_by_reference``" - -#~ msgid "``parse_by_reference``" -#~ msgstr "``parse_by_reference``" - -#~ msgid "Py_buffer" -#~ msgstr "Py_buffer" +"Argument Clinic 操作方法已移至「`Python 開發人員指南 `__」。" diff --git a/howto/enum.po b/howto/enum.po index b8dfcac179..d581267153 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-09-01 00:03+0000\n" +"POT-Creation-Date: 2023-10-12 00:03+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -1030,44 +1030,44 @@ msgstr "" msgid "EJECT --> lose Flag status and become a normal int with the given value" msgstr "" -#: ../../howto/enum.rst:1165 +#: ../../howto/enum.rst:1162 msgid "KEEP --> keep the extra bits" msgstr "" -#: ../../howto/enum.rst:1163 +#: ../../howto/enum.rst:1164 msgid "keeps Flag status and extra bits" msgstr "" -#: ../../howto/enum.rst:1164 +#: ../../howto/enum.rst:1165 msgid "extra bits do not show up in iteration" msgstr "" -#: ../../howto/enum.rst:1165 +#: ../../howto/enum.rst:1166 msgid "extra bits do show up in repr() and str()" msgstr "" -#: ../../howto/enum.rst:1167 +#: ../../howto/enum.rst:1168 msgid "" "The default for Flag is ``STRICT``, the default for ``IntFlag`` is " "``EJECT``, and the default for ``_convert_`` is ``KEEP`` (see ``ssl." "Options`` for an example of when ``KEEP`` is needed)." msgstr "" -#: ../../howto/enum.rst:1175 +#: ../../howto/enum.rst:1176 msgid "How are Enums and Flags different?" msgstr "" -#: ../../howto/enum.rst:1177 +#: ../../howto/enum.rst:1178 msgid "" "Enums have a custom metaclass that affects many aspects of both derived :" "class:`Enum` classes and their instances (members)." msgstr "" -#: ../../howto/enum.rst:1182 +#: ../../howto/enum.rst:1183 msgid "Enum Classes" msgstr "" -#: ../../howto/enum.rst:1184 +#: ../../howto/enum.rst:1185 msgid "" "The :class:`EnumType` metaclass is responsible for providing the :meth:" "`__contains__`, :meth:`__dir__`, :meth:`__iter__` and other methods that " @@ -1078,11 +1078,11 @@ msgid "" "`__getnewargs__`, :meth:`__str__` and :meth:`__repr__`)." msgstr "" -#: ../../howto/enum.rst:1193 +#: ../../howto/enum.rst:1194 msgid "Flag Classes" msgstr "" -#: ../../howto/enum.rst:1195 +#: ../../howto/enum.rst:1196 msgid "" "Flags have an expanded view of aliasing: to be canonical, the value of a " "flag needs to be a power-of-two value, and not a duplicate name. So, in " @@ -1091,11 +1091,11 @@ msgid "" "considered an alias." msgstr "" -#: ../../howto/enum.rst:1201 +#: ../../howto/enum.rst:1202 msgid "Enum Members (aka instances)" msgstr "" -#: ../../howto/enum.rst:1203 +#: ../../howto/enum.rst:1204 msgid "" "The most interesting thing about enum members is that they are singletons. :" "class:`EnumType` creates them all while it is creating the enum class " @@ -1104,37 +1104,37 @@ msgid "" "instances." msgstr "" -#: ../../howto/enum.rst:1209 +#: ../../howto/enum.rst:1210 msgid "Flag Members" msgstr "" -#: ../../howto/enum.rst:1211 +#: ../../howto/enum.rst:1212 msgid "" "Flag members can be iterated over just like the :class:`Flag` class, and " "only the canonical members will be returned. For example::" msgstr "" -#: ../../howto/enum.rst:1217 +#: ../../howto/enum.rst:1218 msgid "(Note that ``BLACK``, ``PURPLE``, and ``WHITE`` do not show up.)" msgstr "" -#: ../../howto/enum.rst:1219 +#: ../../howto/enum.rst:1220 msgid "" "Inverting a flag member returns the corresponding positive value, rather " "than a negative value --- for example::" msgstr "" -#: ../../howto/enum.rst:1225 +#: ../../howto/enum.rst:1226 msgid "" "Flag members have a length corresponding to the number of power-of-two " "values they contain. For example::" msgstr "" -#: ../../howto/enum.rst:1235 +#: ../../howto/enum.rst:1236 msgid "Enum Cookbook" msgstr "" -#: ../../howto/enum.rst:1238 +#: ../../howto/enum.rst:1239 msgid "" "While :class:`Enum`, :class:`IntEnum`, :class:`StrEnum`, :class:`Flag`, and :" "class:`IntFlag` are expected to cover the majority of use-cases, they cannot " @@ -1142,155 +1142,155 @@ msgid "" "that can be used directly, or as examples for creating one's own." msgstr "" -#: ../../howto/enum.rst:1245 +#: ../../howto/enum.rst:1246 msgid "Omitting values" msgstr "" -#: ../../howto/enum.rst:1247 +#: ../../howto/enum.rst:1248 msgid "" "In many use-cases, one doesn't care what the actual value of an enumeration " "is. There are several ways to define this type of simple enumeration:" msgstr "" -#: ../../howto/enum.rst:1250 +#: ../../howto/enum.rst:1251 msgid "use instances of :class:`auto` for the value" msgstr "" -#: ../../howto/enum.rst:1251 +#: ../../howto/enum.rst:1252 msgid "use instances of :class:`object` as the value" msgstr "" -#: ../../howto/enum.rst:1252 +#: ../../howto/enum.rst:1253 msgid "use a descriptive string as the value" msgstr "" -#: ../../howto/enum.rst:1253 +#: ../../howto/enum.rst:1254 msgid "" "use a tuple as the value and a custom :meth:`__new__` to replace the tuple " "with an :class:`int` value" msgstr "" -#: ../../howto/enum.rst:1256 +#: ../../howto/enum.rst:1257 msgid "" "Using any of these methods signifies to the user that these values are not " "important, and also enables one to add, remove, or reorder members without " "having to renumber the remaining members." msgstr "" -#: ../../howto/enum.rst:1262 +#: ../../howto/enum.rst:1263 msgid "Using :class:`auto`" msgstr "" -#: ../../howto/enum.rst:1264 +#: ../../howto/enum.rst:1265 msgid "Using :class:`auto` would look like::" msgstr "" -#: ../../howto/enum.rst:1276 +#: ../../howto/enum.rst:1277 msgid "Using :class:`object`" msgstr "" -#: ../../howto/enum.rst:1278 +#: ../../howto/enum.rst:1279 msgid "Using :class:`object` would look like::" msgstr "" -#: ../../howto/enum.rst:1288 +#: ../../howto/enum.rst:1289 msgid "" "This is also a good example of why you might want to write your own :meth:" "`__repr__`::" msgstr "" -#: ../../howto/enum.rst:1304 +#: ../../howto/enum.rst:1305 msgid "Using a descriptive string" msgstr "" -#: ../../howto/enum.rst:1306 +#: ../../howto/enum.rst:1307 msgid "Using a string as the value would look like::" msgstr "" -#: ../../howto/enum.rst:1318 +#: ../../howto/enum.rst:1319 msgid "Using a custom :meth:`__new__`" msgstr "" -#: ../../howto/enum.rst:1320 +#: ../../howto/enum.rst:1321 msgid "Using an auto-numbering :meth:`__new__` would look like::" msgstr "" -#: ../../howto/enum.rst:1337 +#: ../../howto/enum.rst:1338 msgid "" "To make a more general purpose ``AutoNumber``, add ``*args`` to the " "signature::" msgstr "" -#: ../../howto/enum.rst:1347 +#: ../../howto/enum.rst:1348 msgid "" "Then when you inherit from ``AutoNumber`` you can write your own " "``__init__`` to handle any extra arguments::" msgstr "" -#: ../../howto/enum.rst:1366 +#: ../../howto/enum.rst:1367 msgid "" "The :meth:`__new__` method, if defined, is used during creation of the Enum " "members; it is then replaced by Enum's :meth:`__new__` which is used after " "class creation for lookup of existing members." msgstr "" -#: ../../howto/enum.rst:1372 +#: ../../howto/enum.rst:1373 msgid "" "*Do not* call ``super().__new__()``, as the lookup-only ``__new__`` is the " "one that is found; instead, use the data type directly -- e.g.::" msgstr "" -#: ../../howto/enum.rst:1379 +#: ../../howto/enum.rst:1380 msgid "OrderedEnum" msgstr "" -#: ../../howto/enum.rst:1381 +#: ../../howto/enum.rst:1382 msgid "" "An ordered enumeration that is not based on :class:`IntEnum` and so " "maintains the normal :class:`Enum` invariants (such as not being comparable " "to other enumerations)::" msgstr "" -#: ../../howto/enum.rst:1415 +#: ../../howto/enum.rst:1416 msgid "DuplicateFreeEnum" msgstr "" -#: ../../howto/enum.rst:1417 +#: ../../howto/enum.rst:1418 msgid "" "Raises an error if a duplicate member value is found instead of creating an " "alias::" msgstr "" -#: ../../howto/enum.rst:1442 +#: ../../howto/enum.rst:1443 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:1448 +#: ../../howto/enum.rst:1449 msgid "Planet" msgstr "" -#: ../../howto/enum.rst:1450 +#: ../../howto/enum.rst:1451 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:1479 +#: ../../howto/enum.rst:1480 msgid "TimePeriod" msgstr "" -#: ../../howto/enum.rst:1481 +#: ../../howto/enum.rst:1482 msgid "An example to show the :attr:`_ignore_` attribute in use::" msgstr "" -#: ../../howto/enum.rst:1500 +#: ../../howto/enum.rst:1501 msgid "Subclassing EnumType" msgstr "" -#: ../../howto/enum.rst:1502 +#: ../../howto/enum.rst:1503 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/instrumentation.po b/howto/instrumentation.po index 29a7b4d68f..0850e3c94d 100644 --- a/howto/instrumentation.po +++ b/howto/instrumentation.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-24 00:03+0000\n" +"POT-Creation-Date: 2023-10-12 00:03+0000\n" "PO-Revision-Date: 2023-08-17 22:17+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -193,20 +193,20 @@ msgstr "其中的行 (column) 是:" msgid "time in microseconds since start of script" msgstr "自腳本開始以來的時間(以微秒為單位)" -#: ../../howto/instrumentation.rst:251 +#: ../../howto/instrumentation.rst:250 msgid "name of executable" msgstr "可執行檔案的名稱" -#: ../../howto/instrumentation.rst:253 +#: ../../howto/instrumentation.rst:251 msgid "PID of process" msgstr "行程的 PID" -#: ../../howto/instrumentation.rst:255 +#: ../../howto/instrumentation.rst:253 msgid "" "and the remainder indicates the call/return hierarchy as the script executes." msgstr "其餘部分表示腳本執行時的呼叫/回傳階層結構。" -#: ../../howto/instrumentation.rst:257 +#: ../../howto/instrumentation.rst:255 msgid "" "For a :option:`--enable-shared` build of CPython, the markers are contained " "within the libpython shared library, and the probe's dotted path needs to " @@ -216,26 +216,26 @@ msgstr "" "函式庫中,並且探針的帶點路徑 (dotted path) 需要反映這一點。例如,上面範例中的" "這一列:" -#: ../../howto/instrumentation.rst:265 +#: ../../howto/instrumentation.rst:263 msgid "should instead read:" msgstr "應該改為讀取:" -#: ../../howto/instrumentation.rst:271 +#: ../../howto/instrumentation.rst:269 msgid "(assuming a :ref:`debug build ` of CPython 3.6)" msgstr "(假設 CPython 3.6 的\\ :ref:`除錯建置版本 `)" -#: ../../howto/instrumentation.rst:275 +#: ../../howto/instrumentation.rst:273 msgid "Available static markers" msgstr "可用的靜態標記" -#: ../../howto/instrumentation.rst:279 +#: ../../howto/instrumentation.rst:277 msgid "" "This marker indicates that execution of a Python function has begun. It is " "only triggered for pure-Python (bytecode) functions." msgstr "" "該標記表示 Python 函式的執行已經開始。它僅針對純 Python(位元組碼)函式觸發。" -#: ../../howto/instrumentation.rst:282 +#: ../../howto/instrumentation.rst:280 msgid "" "The filename, function name, and line number are provided back to the " "tracing script as positional arguments, which must be accessed using " @@ -244,25 +244,25 @@ msgstr "" "檔案名稱、函式名稱和列號作為位置引數提供給追蹤腳本,必須使用 ``$arg1``、" "``$arg2``、``$arg3`` 來存取:" -#: ../../howto/instrumentation.rst:286 +#: ../../howto/instrumentation.rst:284 msgid "" "``$arg1`` : ``(const char *)`` filename, accessible using " "``user_string($arg1)``" msgstr "" "``$arg1`` : ``(const char *)`` 檔案名稱,可使用 ``user_string($arg1)`` 存取" -#: ../../howto/instrumentation.rst:288 +#: ../../howto/instrumentation.rst:286 msgid "" "``$arg2`` : ``(const char *)`` function name, accessible using " "``user_string($arg2)``" msgstr "" "``$arg2`` :``(const char *)`` 函式名稱,可使用 ``user_string($arg2)`` 存取" -#: ../../howto/instrumentation.rst:291 +#: ../../howto/instrumentation.rst:289 msgid "``$arg3`` : ``int`` line number" msgstr "``$arg3`` : ``int`` 列號" -#: ../../howto/instrumentation.rst:295 +#: ../../howto/instrumentation.rst:293 msgid "" "This marker is the converse of :c:func:`!function__entry`, and indicates " "that execution of a Python function has ended (either via ``return``, or via " @@ -271,11 +271,11 @@ msgstr "" "該標記與 :c:func:`!function__entry` 相反,表示 Python 函式的執行已結束(透過 " "``return`` 或透過例外)。它僅針對純 Python(位元組碼)函式觸發。" -#: ../../howto/instrumentation.rst:299 +#: ../../howto/instrumentation.rst:297 msgid "The arguments are the same as for :c:func:`!function__entry`" msgstr "引數與 :c:func:`!function__entry` 相同" -#: ../../howto/instrumentation.rst:303 +#: ../../howto/instrumentation.rst:301 msgid "" "This marker indicates a Python line is about to be executed. It is the " "equivalent of line-by-line tracing with a Python profiler. It is not " @@ -284,11 +284,11 @@ msgstr "" "該標記表示一列 Python 即將被執行。它相當於使用 Python 分析器來逐行追蹤。它不" "在 C 函式內觸發。" -#: ../../howto/instrumentation.rst:307 +#: ../../howto/instrumentation.rst:305 msgid "The arguments are the same as for :c:func:`!function__entry`." msgstr "引數與 :c:func:`!function__entry` 相同。" -#: ../../howto/instrumentation.rst:311 +#: ../../howto/instrumentation.rst:309 msgid "" "Fires when the Python interpreter starts a garbage collection cycle. " "``arg0`` is the generation to scan, like :func:`gc.collect()`." @@ -296,19 +296,19 @@ msgstr "" "當 Python 直譯器開始垃圾回收 (garbage collection) 週期時觸發。``arg0`` 是要掃" "描的一代 (generation),如 :func:`gc.collect()`。" -#: ../../howto/instrumentation.rst:316 +#: ../../howto/instrumentation.rst:314 msgid "" "Fires when the Python interpreter finishes a garbage collection cycle. " "``arg0`` is the number of collected objects." msgstr "當 Python 直譯器完成垃圾回收週期時觸發。``arg0`` 是收集到的物件數量。" -#: ../../howto/instrumentation.rst:321 +#: ../../howto/instrumentation.rst:319 msgid "" "Fires before :mod:`importlib` attempts to find and load the module. ``arg0`` " "is the module name." msgstr "在 :mod:`importlib` 嘗試查找並載入模組之前觸發。``arg0`` 是模組名稱。" -#: ../../howto/instrumentation.rst:328 +#: ../../howto/instrumentation.rst:326 msgid "" "Fires after :mod:`importlib`'s find_and_load function is called. ``arg0`` is " "the module name, ``arg1`` indicates if module was successfully loaded." @@ -316,7 +316,7 @@ msgstr "" "在呼叫 :mod:`importlib` 的 find_and_load 函式後觸發。 ``arg0`` 是模組名稱," "``arg1`` 代表模組是否已成功載入。" -#: ../../howto/instrumentation.rst:337 +#: ../../howto/instrumentation.rst:335 msgid "" "Fires when :func:`sys.audit` or :c:func:`PySys_Audit` is called. ``arg0`` is " "the event name as C string, ``arg1`` is a :c:type:`PyObject` pointer to a " @@ -325,11 +325,11 @@ msgstr "" "當呼叫 :func:`sys.audit` 或 :c:func:`PySys_Audit` 時觸發。``arg0`` 是 C 字串" "形式的事件名稱,``arg1`` 是指向元組 (tuple) 物件的 :c:type:`PyObject` 指標。" -#: ../../howto/instrumentation.rst:345 +#: ../../howto/instrumentation.rst:343 msgid "SystemTap Tapsets" msgstr "SystemTap Tapsets" -#: ../../howto/instrumentation.rst:347 +#: ../../howto/instrumentation.rst:345 msgid "" "The higher-level way to use the SystemTap integration is to use a " "\"tapset\": SystemTap's equivalent of a library, which hides some of the " @@ -338,11 +338,11 @@ msgstr "" "使用 SystemTap 整合的高階方法是使用 \"tapset\":SystemTap 相當於一個函式庫," "它隱藏了靜態標記的一些低階詳細資訊。" -#: ../../howto/instrumentation.rst:351 +#: ../../howto/instrumentation.rst:349 msgid "Here is a tapset file, based on a non-shared build of CPython:" msgstr "這是一個 tapset 檔案,是基於 CPython 的非共享建置版本:" -#: ../../howto/instrumentation.rst:374 +#: ../../howto/instrumentation.rst:372 msgid "" "If this file is installed in SystemTap's tapset directory (e.g. ``/usr/share/" "systemtap/tapset``), then these additional probepoints become available:" @@ -350,7 +350,7 @@ msgstr "" "如果此檔案是安裝在 SystemTap 的 tapset 目錄中(例如 ``/usr/share/systemtap/" "tapset``),則這些額外的探測點將可被使用:" -#: ../../howto/instrumentation.rst:380 +#: ../../howto/instrumentation.rst:378 msgid "" "This probe point indicates that execution of a Python function has begun. It " "is only triggered for pure-Python (bytecode) functions." @@ -358,7 +358,7 @@ msgstr "" "該探測點表示 Python 函式的執行已經開始。它僅針對純 Python(位元組碼)函式觸" "發。" -#: ../../howto/instrumentation.rst:385 +#: ../../howto/instrumentation.rst:383 msgid "" "This probe point is the converse of ``python.function.return``, and " "indicates that execution of a Python function has ended (either via " @@ -368,11 +368,11 @@ msgstr "" "這個探測點與 ``python.function.return`` 相反,表示 Python 函式的執行已經結束" "(透過 ``return`` 或者透過例外)。它僅針對純 Python(位元組碼)函式觸發。" -#: ../../howto/instrumentation.rst:392 +#: ../../howto/instrumentation.rst:390 msgid "Examples" msgstr "範例" -#: ../../howto/instrumentation.rst:393 +#: ../../howto/instrumentation.rst:391 msgid "" "This SystemTap script uses the tapset above to more cleanly implement the " "example given above of tracing the Python function-call hierarchy, without " @@ -381,7 +381,7 @@ msgstr "" "此 SystemTap 腳本使用上面的 tapset 來更清晰地實作上面給出的追蹤 Python 函式呼" "叫階層結構的範例,而無需直接命名靜態標記:" -#: ../../howto/instrumentation.rst:412 +#: ../../howto/instrumentation.rst:410 msgid "" "The following script uses the tapset above to provide a top-like view of all " "running CPython code, showing the top 20 most frequently entered bytecode " diff --git a/howto/logging-cookbook.po b/howto/logging-cookbook.po index 31e89a4211..677327880d 100644 --- a/howto/logging-cookbook.po +++ b/howto/logging-cookbook.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-31 00:03+0000\n" +"POT-Creation-Date: 2023-10-11 17:13+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-" @@ -915,7 +915,7 @@ msgid "" "a log by a handler. So the only slightly unusual thing which might trip you " "up is that the parentheses go around the format string and the arguments, " "not just the format string. That's because the __ notation is just syntax " -"sugar for a constructor call to one of the XXXMessage classes." +"sugar for a constructor call to one of the :samp:`{XXX}Message` classes." msgstr "" #: ../../howto/logging-cookbook.rst:1733 @@ -1446,8 +1446,8 @@ msgid "" "a log by a handler. So the only slightly unusual thing which might trip you " "up is that the parentheses go around the format string and the arguments, " "not just the format string. That’s because the __ notation is just syntax " -"sugar for a constructor call to one of the ``XXXMessage`` classes shown " -"above." +"sugar for a constructor call to one of the :samp:`{XXX}Message` classes " +"shown above." msgstr "" #: ../../howto/logging-cookbook.rst:2655 diff --git a/howto/logging.po b/howto/logging.po index 56e0345614..72076c0c96 100644 --- a/howto/logging.po +++ b/howto/logging.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-10-11 17:13+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-" @@ -1237,7 +1237,7 @@ msgstr "" msgid "" ":class:`NullHandler` instances do nothing with error messages. They are used " "by library developers who want to use logging, but want to avoid the 'No " -"handlers could be found for logger XXX' message which can be displayed if " +"handlers could be found for logger *XXX*' message which can be displayed if " "the library user has not configured logging. See :ref:`library-config` for " "more information." msgstr "" diff --git a/howto/perf_profiling.po b/howto/perf_profiling.po index 3fb4ec18fe..4964959d41 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-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-10-11 17:13+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -112,23 +112,23 @@ msgstr "" msgid "Example, using the environment variable::" msgstr "" -#: ../../howto/perf_profiling.rst:169 +#: ../../howto/perf_profiling.rst:168 msgid "Example, using the :option:`!-X` option::" msgstr "" -#: ../../howto/perf_profiling.rst:174 +#: ../../howto/perf_profiling.rst:173 msgid "Example, using the :mod:`sys` APIs in file :file:`example.py`:" msgstr "" -#: ../../howto/perf_profiling.rst:186 +#: ../../howto/perf_profiling.rst:185 msgid "...then::" msgstr "" -#: ../../howto/perf_profiling.rst:193 +#: ../../howto/perf_profiling.rst:192 msgid "How to obtain the best results" msgstr "" -#: ../../howto/perf_profiling.rst:195 +#: ../../howto/perf_profiling.rst:194 msgid "" "For best results, Python should be compiled with ``CFLAGS=\"-fno-omit-frame-" "pointer -mno-omit-leaf-frame-pointer\"`` as this allows profilers to unwind " @@ -138,12 +138,12 @@ msgid "" "available." msgstr "" -#: ../../howto/perf_profiling.rst:202 +#: ../../howto/perf_profiling.rst:201 msgid "" "You can check if your system has been compiled with this flag by running::" msgstr "" -#: ../../howto/perf_profiling.rst:206 +#: ../../howto/perf_profiling.rst:205 msgid "" "If you don't see any output it means that your interpreter has not been " "compiled with frame pointers and therefore it may not be able to show Python " diff --git a/howto/urllib2.po b/howto/urllib2.po index 38983936ff..64aac1a827 100644 --- a/howto/urllib2.po +++ b/howto/urllib2.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-23 00:16+0000\n" +"POT-Creation-Date: 2023-10-11 17:13+0000\n" "PO-Revision-Date: 2022-06-27 09:36+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -226,15 +226,15 @@ msgstr "" #: ../../howto/urllib2.rst:197 msgid "" -"*urlopen* raises :exc:`URLError` when it cannot handle a response (though as " -"usual with Python APIs, built-in exceptions such as :exc:`ValueError`, :exc:" -"`TypeError` etc. may also be raised)." +"*urlopen* raises :exc:`~urllib.error.URLError` when it cannot handle a " +"response (though as usual with Python APIs, built-in exceptions such as :exc:" +"`ValueError`, :exc:`TypeError` etc. may also be raised)." msgstr "" #: ../../howto/urllib2.rst:201 msgid "" -":exc:`HTTPError` is the subclass of :exc:`URLError` raised in the specific " -"case of HTTP URLs." +":exc:`~urllib.error.HTTPError` is the subclass of :exc:`~urllib.error." +"URLError` raised in the specific case of HTTP URLs." msgstr "" #: ../../howto/urllib2.rst:204 @@ -268,9 +268,9 @@ msgid "" "request. The default handlers will handle some of these responses for you " "(for example, if the response is a \"redirection\" that requests the client " "fetch the document from a different URL, urllib will handle that for you). " -"For those it can't handle, urlopen will raise an :exc:`HTTPError`. Typical " -"errors include '404' (page not found), '403' (request forbidden), and " -"'401' (authentication required)." +"For those it can't handle, urlopen will raise an :exc:`~urllib.error." +"HTTPError`. Typical errors include '404' (page not found), '403' (request " +"forbidden), and '401' (authentication required)." msgstr "" #: ../../howto/urllib2.rst:235 @@ -280,8 +280,8 @@ msgstr "" #: ../../howto/urllib2.rst:237 msgid "" -"The :exc:`HTTPError` instance raised will have an integer 'code' attribute, " -"which corresponds to the error sent by the server." +"The :exc:`~urllib.error.HTTPError` instance raised will have an integer " +"'code' attribute, which corresponds to the error sent by the server." msgstr "" #: ../../howto/urllib2.rst:241 @@ -305,10 +305,10 @@ msgstr "" #: ../../howto/urllib2.rst:319 msgid "" "When an error is raised the server responds by returning an HTTP error code " -"*and* an error page. You can use the :exc:`HTTPError` instance as a response " -"on the page returned. This means that as well as the code attribute, it also " -"has read, geturl, and info, methods as returned by the ``urllib.response`` " -"module::" +"*and* an error page. You can use the :exc:`~urllib.error.HTTPError` instance " +"as a response on the page returned. This means that as well as the code " +"attribute, it also has read, geturl, and info, methods as returned by the " +"``urllib.response`` module::" msgstr "" #: ../../howto/urllib2.rst:339 @@ -317,8 +317,9 @@ msgstr "" #: ../../howto/urllib2.rst:341 msgid "" -"So if you want to be prepared for :exc:`HTTPError` *or* :exc:`URLError` " -"there are two basic approaches. I prefer the second approach." +"So if you want to be prepared for :exc:`~urllib.error.HTTPError` *or* :exc:" +"`~urllib.error.URLError` there are two basic approaches. I prefer the second " +"approach." msgstr "" #: ../../howto/urllib2.rst:345 @@ -328,7 +329,7 @@ msgstr "" #: ../../howto/urllib2.rst:367 msgid "" "The ``except HTTPError`` *must* come first, otherwise ``except URLError`` " -"will *also* catch an :exc:`HTTPError`." +"will *also* catch an :exc:`~urllib.error.HTTPError`." msgstr "" #: ../../howto/urllib2.rst:371 @@ -341,9 +342,9 @@ msgstr "" #: ../../howto/urllib2.rst:394 msgid "" -"The response returned by urlopen (or the :exc:`HTTPError` instance) has two " -"useful methods :meth:`info` and :meth:`geturl` and is defined in the module :" -"mod:`urllib.response`.." +"The response returned by urlopen (or the :exc:`~urllib.error.HTTPError` " +"instance) has two useful methods :meth:`info` and :meth:`geturl` and is " +"defined in the module :mod:`urllib.response`.." msgstr "" #: ../../howto/urllib2.rst:398 diff --git a/library/__main__.po b/library/__main__.po index c369e52fc2..d5bf9aa3ad 100644 --- a/library/__main__.po +++ b/library/__main__.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-22 00:04+0000\n" +"POT-Creation-Date: 2023-10-11 17:13+0000\n" "PO-Revision-Date: 2015-12-09 17:51+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -254,10 +254,10 @@ msgstr "" #: ../../library/__main__.rst:241 msgid "" -"The contents of ``__main__.py`` typically isn't fenced with ``if __name__ == " -"'__main__'`` blocks. Instead, those files are kept short, functions to " -"execute from other modules. Those other modules can then be easily unit-" -"tested and are properly reusable." +"The content of ``__main__.py`` typically isn't fenced with an ``if __name__ " +"== '__main__'`` block. Instead, those files are kept short and import " +"functions to execute from other modules. Those other modules can then be " +"easily unit-tested and are properly reusable." msgstr "" #: ../../library/__main__.rst:246 diff --git a/library/asyncio-llapi-index.po b/library/asyncio-llapi-index.po index 7e8bd669a4..b073cb620a 100644 --- a/library/asyncio-llapi-index.po +++ b/library/asyncio-llapi-index.po @@ -1,15 +1,15 @@ -# Copyright (C) 2001-2022, Python Software Foundation +# Copyright (C) 2001-2023, Python Software Foundation # This file is distributed under the same license as the Python package. # # Translators: -# Matt Wang , 2022 +# Matt Wang , 2022-2023 # msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-12-07 00:17+0000\n" -"PO-Revision-Date: 2022-02-09 11:27+0800\n" +"POT-Creation-Date: 2023-10-11 17:13+0000\n" +"PO-Revision-Date: 2023-10-12 11:27+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -70,7 +70,7 @@ msgstr "範例" #: ../../library/asyncio-llapi-index.rst:33 msgid ":ref:`Using asyncio.get_running_loop() `." -msgstr ":ref:`使用 asyncio.get_running_loop() `\\ 。" +msgstr ":ref:`使用 asyncio.get_running_loop() `。" #: ../../library/asyncio-llapi-index.rst:37 msgid "Event Loop Methods" @@ -124,7 +124,7 @@ msgstr ":meth:`loop.is_running()`" #: ../../library/asyncio-llapi-index.rst:60 msgid "Return ``True`` if the event loop is running." -msgstr "如果事件迴圈正在執行則回傳 ``True``\\ 。" +msgstr "如果事件迴圈正在執行則回傳 ``True``。" #: ../../library/asyncio-llapi-index.rst:62 msgid ":meth:`loop.is_closed()`" @@ -132,7 +132,7 @@ msgstr ":meth:`loop.is_closed()`" #: ../../library/asyncio-llapi-index.rst:63 msgid "Return ``True`` if the event loop is closed." -msgstr "如果事件迴圈已經被關閉則回傳 ``True``\\ ,。" +msgstr "如果事件迴圈已經被關閉則回傳 ``True``。" #: ../../library/asyncio-llapi-index.rst:65 msgid "``await`` :meth:`loop.shutdown_asyncgens`" @@ -275,7 +275,7 @@ msgstr "``await`` :meth:`loop.getaddrinfo`" #: ../../library/asyncio-llapi-index.rst:138 msgid "Asynchronous version of :meth:`socket.getaddrinfo`." -msgstr "非同步版本的 :meth:`socket.getaddrinfo`\\ 。" +msgstr "非同步版本的 :meth:`socket.getaddrinfo`。" #: ../../library/asyncio-llapi-index.rst:140 msgid "``await`` :meth:`loop.getnameinfo`" @@ -283,7 +283,7 @@ msgstr "``await`` :meth:`loop.getnameinfo`" #: ../../library/asyncio-llapi-index.rst:141 msgid "Asynchronous version of :meth:`socket.getnameinfo`." -msgstr "非同步版本的 :meth:`socket.getnameinfo`\\ 。" +msgstr "非同步版本的 :meth:`socket.getnameinfo`。" #: ../../library/asyncio-llapi-index.rst:144 msgid "Networking and IPC" @@ -327,7 +327,7 @@ msgstr "``await`` :meth:`loop.connect_accepted_socket`" #: ../../library/asyncio-llapi-index.rst:162 msgid "Wrap a :class:`~socket.socket` into a ``(transport, protocol)`` pair." -msgstr "將 :class:`~socket.socket` 包裝成 ``(transport, protocol)``\\ 。" +msgstr "將 :class:`~socket.socket` 包裝成 ``(transport, protocol)``。" #: ../../library/asyncio-llapi-index.rst:165 msgid "``await`` :meth:`loop.create_datagram_endpoint`" @@ -359,7 +359,7 @@ msgstr "``await`` :meth:`loop.connect_read_pipe`" #: ../../library/asyncio-llapi-index.rst:175 msgid "Wrap a read end of a pipe into a ``(transport, protocol)`` pair." -msgstr "將 pipe(管道)讀取端包裝成 ``(transport, protocol)``\\ 。" +msgstr "將 pipe(管道)讀取端包裝成 ``(transport, protocol)``。" #: ../../library/asyncio-llapi-index.rst:177 msgid "``await`` :meth:`loop.connect_write_pipe`" @@ -367,7 +367,7 @@ msgstr "``await`` :meth:`loop.connect_write_pipe`" #: ../../library/asyncio-llapi-index.rst:178 msgid "Wrap a write end of a pipe into a ``(transport, protocol)`` pair." -msgstr "將 pipe 寫入端包裝成 ``(transport, protocol)``\\ 。" +msgstr "將 pipe 寫入端包裝成 ``(transport, protocol)``。" #: ../../library/asyncio-llapi-index.rst:181 msgid "Sockets" @@ -412,7 +412,7 @@ msgstr "``await`` :meth:`loop.sock_sendall`" #: ../../library/asyncio-llapi-index.rst:199 msgid "Send data to the :class:`~socket.socket`." -msgstr "傳送資料到 :class:`~socket.socket`\\ 。" +msgstr "傳送資料到 :class:`~socket.socket`。" #: ../../library/asyncio-llapi-index.rst:201 msgid "``await`` :meth:`loop.sock_sendto`" @@ -428,7 +428,7 @@ msgstr "``await`` :meth:`loop.sock_connect`" #: ../../library/asyncio-llapi-index.rst:205 msgid "Connect the :class:`~socket.socket`." -msgstr "連接 :class:`~socket.socket`\\ 。" +msgstr "連接 :class:`~socket.socket`。" #: ../../library/asyncio-llapi-index.rst:207 msgid "``await`` :meth:`loop.sock_accept`" @@ -560,11 +560,11 @@ msgid "" "`." msgstr "" ":ref:`使用 asyncio.new_event_loop() 和 loop.run_forever() " -"`\\ 。" +"`。" #: ../../library/asyncio-llapi-index.rst:273 msgid ":ref:`Using loop.call_later() `." -msgstr ":ref:`使用 loop.call_later() `\\ 。" +msgstr ":ref:`使用 loop.call_later() `。" #: ../../library/asyncio-llapi-index.rst:275 msgid "" @@ -572,7 +572,7 @@ msgid "" "`." msgstr "" "使用 ``loop.create_connection()`` 以實作\\ :ref:`一個 echo 客戶端 " -"`\\ 。" +"`。" #: ../../library/asyncio-llapi-index.rst:278 msgid "" @@ -580,24 +580,23 @@ msgid "" "`." msgstr "" "使用 ``loop.create_connection()`` 來\\ :ref:`連接 socket " -"`\\ 。" +"`。" #: ../../library/asyncio-llapi-index.rst:281 msgid "" ":ref:`Using add_reader() to watch an FD for read events " "`." msgstr "" -":ref:`使用 add_reader() 監控 FD 的讀取事件 `\\ 。" +":ref:`使用 add_reader() 監控 FD 的讀取事件 `。" #: ../../library/asyncio-llapi-index.rst:284 msgid ":ref:`Using loop.add_signal_handler() `." -msgstr "" -":ref:`使用 loop.add_signal_handler() `\\ 。" +msgstr ":ref:`使用 loop.add_signal_handler() `。" #: ../../library/asyncio-llapi-index.rst:286 msgid ":ref:`Using loop.subprocess_exec() `." msgstr "" -":ref:`使用 loop.add_signal_handler() `\\ 。" +":ref:`使用 loop.add_signal_handler() `。" #: ../../library/asyncio-llapi-index.rst:290 msgid "Transports" @@ -621,7 +620,7 @@ msgstr ":meth:`transport.is_closing() `" #: ../../library/asyncio-llapi-index.rst:302 msgid "Return ``True`` if the transport is closing or is closed." -msgstr "如果傳輸正在關閉或已經關閉則回傳 ``True``\\ 。" +msgstr "如果傳輸正在關閉或已經關閉則回傳 ``True``。" #: ../../library/asyncio-llapi-index.rst:304 msgid ":meth:`transport.get_extra_info() `" @@ -654,8 +653,8 @@ msgid "" "create_unix_connection`, :meth:`loop.connect_read_pipe`, etc:" msgstr "" "可以接收資料(TCP 和 Unix 連線、pipe 等)的傳輸。它由 :meth:`loop." -"create_connection`\\ 、\\ :meth:`loop.create_unix_connection`\\ 、\\ :meth:" -"`loop.connect_read_pipe` 等方法回傳:" +"create_connection`、:meth:`loop.create_unix_connection`、:meth:`loop." +"connect_read_pipe` 等方法回傳:" #: ../../library/asyncio-llapi-index.rst:319 msgid "Read Transports" @@ -667,7 +666,7 @@ msgstr ":meth:`transport.is_reading() `" #: ../../library/asyncio-llapi-index.rst:325 msgid "Return ``True`` if the transport is receiving." -msgstr "如果傳輸正在接收則回傳 ``True``\\ 。" +msgstr "如果傳輸正在接收則回傳 ``True``。" #: ../../library/asyncio-llapi-index.rst:327 msgid ":meth:`transport.pause_reading() `" @@ -692,8 +691,8 @@ msgid "" "create_unix_connection`, :meth:`loop.connect_write_pipe`, etc:" msgstr "" "可以傳送資料(TCP 和 Unix 連線、pipe 等)的傳輸。它由 :meth:`loop." -"create_connection`\\ 、\\ :meth:`loop.create_unix_connection`\\ 、\\ :meth:" -"`loop.connect_write_pipe` 等方法回傳:" +"create_connection`、:meth:`loop.create_unix_connection`、:meth:`loop." +"connect_write_pipe` 等方法回傳:" #: ../../library/asyncio-llapi-index.rst:339 msgid "Write Transports" @@ -721,7 +720,7 @@ msgstr ":meth:`transport.can_write_eof() `" #: ../../library/asyncio-llapi-index.rst:351 msgid "Return :const:`True` if the transport supports sending EOF." -msgstr "如果傳輸支援傳送 EOF 則回傳 :const:`True`\\ 。" +msgstr "如果傳輸支援傳送 EOF 則回傳 :const:`True`。" #: ../../library/asyncio-llapi-index.rst:353 msgid ":meth:`transport.write_eof() `" @@ -830,8 +829,7 @@ msgstr "" msgid "" "Return the transport for the requested communication pipe (*stdin*, " "*stdout*, or *stderr*)." -msgstr "" -"回傳被請求用於通訊 pipe (*stdin*\\ 、\\ *stdout* 或 *stderr*)的傳輸。" +msgstr "回傳被請求用於通訊 pipe (*stdin*、*stdout* 或 *stderr*)的傳輸。" #: ../../library/asyncio-llapi-index.rst:403 msgid ":meth:`transport.get_returncode() `" @@ -989,40 +987,37 @@ msgid "Subprocess Protocols" msgstr "子行程協定" #: ../../library/asyncio-llapi-index.rst:487 -msgid "" -"``callback`` :meth:`pipe_data_received() `" -msgstr "" -"``callback`` :meth:`pipe_data_received() `" +msgid "``callback`` :meth:`~SubprocessProtocol.pipe_data_received`" +msgstr "``callback`` :meth:`~SubprocessProtocol.pipe_data_received`" -#: ../../library/asyncio-llapi-index.rst:489 +#: ../../library/asyncio-llapi-index.rst:488 msgid "" "Called when the child process writes data into its *stdout* or *stderr* pipe." msgstr "在子行程向 *stdout* 或 *stderr* pipe 寫入資料時被呼叫。" -#: ../../library/asyncio-llapi-index.rst:492 -msgid "" -"``callback`` :meth:`pipe_connection_lost() `" -msgstr "" -"``callback`` :meth:`pipe_connection_lost() `" +#: ../../library/asyncio-llapi-index.rst:491 +msgid "``callback`` :meth:`~SubprocessProtocol.pipe_connection_lost`" +msgstr "``callback`` :meth:`~SubprocessProtocol.pipe_connection_lost`" -#: ../../library/asyncio-llapi-index.rst:494 +#: ../../library/asyncio-llapi-index.rst:492 msgid "" "Called when one of the pipes communicating with the child process is closed." msgstr "在與子行程通訊的其中一個 pipes 關閉時被呼叫。" -#: ../../library/asyncio-llapi-index.rst:497 +#: ../../library/asyncio-llapi-index.rst:495 msgid "" "``callback`` :meth:`process_exited() `" msgstr "" "``callback`` :meth:`process_exited() `" -#: ../../library/asyncio-llapi-index.rst:499 -msgid "Called when the child process has exited." -msgstr "在子行程退出後被呼叫。" +#: ../../library/asyncio-llapi-index.rst:497 +msgid "" +"Called when the child process has exited. It can be called before :meth:" +"`~SubprocessProtocol.pipe_data_received` and :meth:`~SubprocessProtocol." +"pipe_connection_lost` methods." +msgstr "" +"在子行程退出時呼叫。它可以在 :meth:`~SubprocessProtocol.pipe_data_received` " +"和 :meth:`~SubprocessProtocol.pipe_connection_lost` 方法之前呼叫。" #: ../../library/asyncio-llapi-index.rst:503 msgid "Event Loop Policies" @@ -1035,7 +1030,7 @@ msgid "" "` for more details." msgstr "" "Policy 是改變 :func:`asyncio.get_event_loop` 這類函式行為的一個低階機制。更多" -"細節請見 :ref:`Policy 相關段落 `\\ 。" +"細節請見 :ref:`Policy 相關段落 `。" #: ../../library/asyncio-llapi-index.rst:511 msgid "Accessing Policies" diff --git a/library/asyncio-protocol.po b/library/asyncio-protocol.po index 971caf4c1e..c9cf7bfefb 100644 --- a/library/asyncio-protocol.po +++ b/library/asyncio-protocol.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-31 08:13+0000\n" +"POT-Creation-Date: 2023-10-11 17:13+0000\n" "PO-Revision-Date: 2018-05-23 14:39+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -931,101 +931,107 @@ msgstr "" msgid "Called when the child process has exited." msgstr "" -#: ../../library/asyncio-protocol.rst:713 +#: ../../library/asyncio-protocol.rst:711 +msgid "" +"It can be called before :meth:`~SubprocessProtocol.pipe_data_received` and :" +"meth:`~SubprocessProtocol.pipe_connection_lost` methods." +msgstr "" + +#: ../../library/asyncio-protocol.rst:716 msgid "Examples" msgstr "範例" -#: ../../library/asyncio-protocol.rst:718 +#: ../../library/asyncio-protocol.rst:721 msgid "TCP Echo Server" msgstr "" -#: ../../library/asyncio-protocol.rst:720 +#: ../../library/asyncio-protocol.rst:723 msgid "" "Create a TCP echo server using the :meth:`loop.create_server` method, send " "back received data, and close the connection::" msgstr "" -#: ../../library/asyncio-protocol.rst:761 +#: ../../library/asyncio-protocol.rst:764 msgid "" "The :ref:`TCP echo server using streams ` " "example uses the high-level :func:`asyncio.start_server` function." msgstr "" -#: ../../library/asyncio-protocol.rst:767 +#: ../../library/asyncio-protocol.rst:770 msgid "TCP Echo Client" msgstr "" -#: ../../library/asyncio-protocol.rst:769 +#: ../../library/asyncio-protocol.rst:772 msgid "" "A TCP echo client using the :meth:`loop.create_connection` method, sends " "data, and waits until the connection is closed::" msgstr "" -#: ../../library/asyncio-protocol.rst:817 +#: ../../library/asyncio-protocol.rst:820 msgid "" "The :ref:`TCP echo client using streams ` " "example uses the high-level :func:`asyncio.open_connection` function." msgstr "" -#: ../../library/asyncio-protocol.rst:824 +#: ../../library/asyncio-protocol.rst:827 msgid "UDP Echo Server" msgstr "" -#: ../../library/asyncio-protocol.rst:826 +#: ../../library/asyncio-protocol.rst:829 msgid "" "A UDP echo server, using the :meth:`loop.create_datagram_endpoint` method, " "sends back received data::" msgstr "" -#: ../../library/asyncio-protocol.rst:868 +#: ../../library/asyncio-protocol.rst:871 msgid "UDP Echo Client" msgstr "" -#: ../../library/asyncio-protocol.rst:870 +#: ../../library/asyncio-protocol.rst:873 msgid "" "A UDP echo client, using the :meth:`loop.create_datagram_endpoint` method, " "sends data and closes the transport when it receives the answer::" msgstr "" -#: ../../library/asyncio-protocol.rst:925 +#: ../../library/asyncio-protocol.rst:928 msgid "Connecting Existing Sockets" msgstr "" -#: ../../library/asyncio-protocol.rst:927 +#: ../../library/asyncio-protocol.rst:930 msgid "" "Wait until a socket receives data using the :meth:`loop.create_connection` " "method with a protocol::" msgstr "" -#: ../../library/asyncio-protocol.rst:981 +#: ../../library/asyncio-protocol.rst:984 msgid "" "The :ref:`watch a file descriptor for read events " "` example uses the low-level :meth:`loop." "add_reader` method to register an FD." msgstr "" -#: ../../library/asyncio-protocol.rst:985 +#: ../../library/asyncio-protocol.rst:988 msgid "" "The :ref:`register an open socket to wait for data using streams " "` example uses high-level streams " "created by the :func:`open_connection` function in a coroutine." msgstr "" -#: ../../library/asyncio-protocol.rst:992 +#: ../../library/asyncio-protocol.rst:995 msgid "loop.subprocess_exec() and SubprocessProtocol" msgstr "" -#: ../../library/asyncio-protocol.rst:994 +#: ../../library/asyncio-protocol.rst:997 msgid "" "An example of a subprocess protocol used to get the output of a subprocess " "and to wait for the subprocess exit." msgstr "" -#: ../../library/asyncio-protocol.rst:997 +#: ../../library/asyncio-protocol.rst:1000 msgid "The subprocess is created by the :meth:`loop.subprocess_exec` method::" msgstr "" -#: ../../library/asyncio-protocol.rst:1043 +#: ../../library/asyncio-protocol.rst:1060 msgid "" "See also the :ref:`same example ` " "written using high-level APIs." diff --git a/library/asyncio-task.po b/library/asyncio-task.po index 20eded89b3..6c96adc696 100644 --- a/library/asyncio-task.po +++ b/library/asyncio-task.po @@ -1,5 +1,4 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2022, Python Software Foundation +# Copyright (C) 2001-2023, Python Software Foundation # This file is distributed under the same license as the Python package. # # Translators: @@ -7,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-20 00:03+0000\n" +"POT-Creation-Date: 2023-10-14 00:03+0000\n" "PO-Revision-Date: 2018-05-23 14:39+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -305,7 +304,7 @@ msgstr "" #: ../../library/asyncio-task.rst:338 ../../library/asyncio-task.rst:472 #: ../../library/asyncio-task.rst:645 ../../library/asyncio-task.rst:703 -#: ../../library/asyncio-task.rst:729 ../../library/asyncio-task.rst:772 +#: ../../library/asyncio-task.rst:729 ../../library/asyncio-task.rst:769 #: ../../library/asyncio-task.rst:869 msgid "Example::" msgstr "" @@ -395,9 +394,8 @@ msgid "" msgstr "" #: ../../library/asyncio-task.rst:426 ../../library/asyncio-task.rst:521 -#: ../../library/asyncio-task.rst:620 ../../library/asyncio-task.rst:767 -#: ../../library/asyncio-task.rst:797 ../../library/asyncio-task.rst:849 -#: ../../library/asyncio-task.rst:875 +#: ../../library/asyncio-task.rst:620 ../../library/asyncio-task.rst:794 +#: ../../library/asyncio-task.rst:849 ../../library/asyncio-task.rst:875 msgid "Removed the *loop* parameter." msgstr "移除 *loop* 參數。" @@ -723,12 +721,16 @@ msgstr "" msgid "If the wait is cancelled, the future *aw* is also cancelled." msgstr "" -#: ../../library/asyncio-task.rst:792 +#: ../../library/asyncio-task.rst:789 msgid "" "When *aw* is cancelled due to a timeout, ``wait_for`` waits for *aw* to be " "cancelled. Previously, it raised :exc:`TimeoutError` immediately." msgstr "" +#: ../../library/asyncio-task.rst:797 +msgid "Raises :exc:`TimeoutError` instead of :exc:`asyncio.TimeoutError`." +msgstr "引發 :exc:`TimeoutError` 而不是 :exc:`asyncio.TimeoutError`。" + #: ../../library/asyncio-task.rst:802 msgid "Waiting Primitives" msgstr "" diff --git a/library/asyncio.po b/library/asyncio.po index b1deae96b2..c05bfecad4 100644 --- a/library/asyncio.po +++ b/library/asyncio.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-13 00:17+0000\n" +"POT-Creation-Date: 2023-10-12 00:03+0000\n" "PO-Revision-Date: 2021-11-23 12:40+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -21,15 +21,15 @@ msgstr "" "Plural-Forms: nplurals=1; plural=0;\n" "X-Generator: Poedit 3.0\n" -#: ../../library/asyncio.rst:78 +#: ../../library/asyncio.rst:80 msgid "High-level APIs" msgstr "高階 API" -#: ../../library/asyncio.rst:90 +#: ../../library/asyncio.rst:92 msgid "Low-level APIs" msgstr "低階 API" -#: ../../library/asyncio.rst:101 +#: ../../library/asyncio.rst:103 msgid "Guides and Tutorials" msgstr "指南與教學" @@ -127,7 +127,7 @@ msgstr "" "透過 async/await 語法來\\ :ref:`橋接 `\\ 基於回呼 (callback-" "based) 的函式庫與程式碼。" -#: ../../library/asyncio.rst:59 +#: ../../library/asyncio.rst:61 msgid "You can experiment with an ``asyncio`` concurrent context in the REPL:" msgstr "你能在 REPL 中對一個 ``asyncio`` 的並行情境 (context) 進行實驗:" @@ -144,10 +144,10 @@ msgstr "" "此模組在 WebAssembly 平台 ``wasm32-emscripten`` 和 ``wasm32-wasi`` 上不起作用" "或無法使用。有關更多資訊,請參閱 :ref:`wasm-availability`。" -#: ../../library/asyncio.rst:77 +#: ../../library/asyncio.rst:79 msgid "Reference" msgstr "參閱" -#: ../../library/asyncio.rst:110 +#: ../../library/asyncio.rst:112 msgid "The source code for asyncio can be found in :source:`Lib/asyncio/`." msgstr "asyncio 的原始碼可以在 :source:`Lib/asyncio/` 中找到。" diff --git a/library/binascii.po b/library/binascii.po index 2a454d8619..8528897275 100644 --- a/library/binascii.po +++ b/library/binascii.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:15+0000\n" +"POT-Creation-Date: 2023-10-12 00:03+0000\n" "PO-Revision-Date: 2018-05-23 14:39+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -79,51 +79,51 @@ msgid "" "base64 data will raise :exc:`binascii.Error`." msgstr "" -#: ../../library/binascii.rst:64 +#: ../../library/binascii.rst:60 msgid "Valid base64:" msgstr "" -#: ../../library/binascii.rst:61 +#: ../../library/binascii.rst:62 msgid "Conforms to :rfc:`3548`." msgstr "" -#: ../../library/binascii.rst:62 +#: ../../library/binascii.rst:63 msgid "Contains only characters from the base64 alphabet." msgstr "" -#: ../../library/binascii.rst:63 +#: ../../library/binascii.rst:64 msgid "" "Contains no excess data after padding (including excess padding, newlines, " "etc.)." msgstr "" -#: ../../library/binascii.rst:64 +#: ../../library/binascii.rst:65 msgid "Does not start with a padding." msgstr "" -#: ../../library/binascii.rst:66 +#: ../../library/binascii.rst:67 msgid "Added the *strict_mode* parameter." msgstr "新增 *strict_mode* 參數。" -#: ../../library/binascii.rst:72 +#: ../../library/binascii.rst:73 msgid "" "Convert binary data to a line of ASCII characters in base64 coding. The " "return value is the converted line, including a newline char if *newline* is " "true. The output of this function conforms to :rfc:`3548`." msgstr "" -#: ../../library/binascii.rst:76 +#: ../../library/binascii.rst:77 msgid "Added the *newline* parameter." msgstr "新增 *newline* 參數。" -#: ../../library/binascii.rst:82 +#: ../../library/binascii.rst:83 msgid "" "Convert a block of quoted-printable data back to binary and return the " "binary data. More than one line may be passed at a time. If the optional " "argument *header* is present and true, underscores will be decoded as spaces." msgstr "" -#: ../../library/binascii.rst:89 +#: ../../library/binascii.rst:90 msgid "" "Convert binary data to a line(s) of ASCII characters in quoted-printable " "encoding. The return value is the converted line(s). If the optional " @@ -136,7 +136,7 @@ msgid "" "might corrupt the binary data stream." msgstr "" -#: ../../library/binascii.rst:102 +#: ../../library/binascii.rst:103 msgid "" "Compute a 16-bit CRC value of *data*, starting with *value* as the initial " "CRC, and return the result. This uses the CRC-CCITT polynomial *x*:sup:`16` " @@ -144,7 +144,7 @@ msgid "" "used in the binhex4 format." msgstr "" -#: ../../library/binascii.rst:110 +#: ../../library/binascii.rst:111 msgid "" "Compute CRC-32, the unsigned 32-bit checksum of *data*, starting with an " "initial CRC of *value*. The default initial CRC is zero. The algorithm is " @@ -153,24 +153,24 @@ msgid "" "algorithm. Use as follows::" msgstr "" -#: ../../library/binascii.rst:122 +#: ../../library/binascii.rst:123 msgid "The result is always unsigned." msgstr "" -#: ../../library/binascii.rst:128 +#: ../../library/binascii.rst:129 msgid "" "Return the hexadecimal representation of the binary *data*. Every byte of " "*data* is converted into the corresponding 2-digit hex representation. The " "returned bytes object is therefore twice as long as the length of *data*." msgstr "" -#: ../../library/binascii.rst:132 +#: ../../library/binascii.rst:133 msgid "" "Similar functionality (but returning a text string) is also conveniently " "accessible using the :meth:`bytes.hex` method." msgstr "" -#: ../../library/binascii.rst:135 +#: ../../library/binascii.rst:136 msgid "" "If *sep* is specified, it must be a single character str or bytes object. It " "will be inserted in the output after every *bytes_per_sep* input bytes. " @@ -178,11 +178,11 @@ msgid "" "if you wish to count from the left, supply a negative *bytes_per_sep* value." msgstr "" -#: ../../library/binascii.rst:150 +#: ../../library/binascii.rst:151 msgid "The *sep* and *bytes_per_sep* parameters were added." msgstr "新增 *sep* 與 *bytes_per_sep* 參數。" -#: ../../library/binascii.rst:156 +#: ../../library/binascii.rst:157 msgid "" "Return the binary data represented by the hexadecimal string *hexstr*. This " "function is the inverse of :func:`b2a_hex`. *hexstr* must contain an even " @@ -190,45 +190,45 @@ msgid "" "an :exc:`Error` exception is raised." msgstr "" -#: ../../library/binascii.rst:161 +#: ../../library/binascii.rst:162 msgid "" "Similar functionality (accepting only text string arguments, but more " "liberal towards whitespace) is also accessible using the :meth:`bytes." "fromhex` class method." msgstr "" -#: ../../library/binascii.rst:167 +#: ../../library/binascii.rst:168 msgid "Exception raised on errors. These are usually programming errors." msgstr "" -#: ../../library/binascii.rst:172 +#: ../../library/binascii.rst:173 msgid "" "Exception raised on incomplete data. These are usually not programming " "errors, but may be handled by reading a little more data and trying again." msgstr "" -#: ../../library/binascii.rst:180 +#: ../../library/binascii.rst:181 msgid "Module :mod:`base64`" msgstr ":mod:`base64` 模組" -#: ../../library/binascii.rst:179 +#: ../../library/binascii.rst:180 msgid "" "Support for RFC compliant base64-style encoding in base 16, 32, 64, and 85." msgstr "" -#: ../../library/binascii.rst:183 +#: ../../library/binascii.rst:184 msgid "Module :mod:`uu`" msgstr ":mod:`uu` 模組" -#: ../../library/binascii.rst:183 +#: ../../library/binascii.rst:184 msgid "Support for UU encoding used on Unix." msgstr "" -#: ../../library/binascii.rst:185 +#: ../../library/binascii.rst:186 msgid "Module :mod:`quopri`" msgstr ":mod:`quopri` 模組" -#: ../../library/binascii.rst:186 +#: ../../library/binascii.rst:187 msgid "Support for quoted-printable encoding used in MIME email messages." msgstr "" diff --git a/library/cmdline.po b/library/cmdline.po new file mode 100644 index 0000000000..5f894724f8 --- /dev/null +++ b/library/cmdline.po @@ -0,0 +1,226 @@ +# Copyright (C) 2001-2023, Python Software Foundation +# This file is distributed under the same license as the Python package. +# +# Translators: +# Matt Wang , 2023 +msgid "" +msgstr "" +"Project-Id-Version: Python 3.12\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2023-10-12 00:03+0000\n" +"PO-Revision-Date: 2023-10-14 16:03+0800\n" +"Last-Translator: Matt Wang \n" +"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" +"tw)\n" +"Language: zh_TW\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: ../../library/cmdline.rst:3 +msgid "Modules command-line interface (CLI)" +msgstr "模組命令列介面" + +#: ../../library/cmdline.rst:5 +msgid "The following modules have a command-line interface." +msgstr "以下模組具有命令列介面。" + +#: ../../library/cmdline.rst:7 +msgid ":ref:`ast `" +msgstr ":ref:`ast `" + +#: ../../library/cmdline.rst:8 +msgid ":ref:`asyncio `" +msgstr ":ref:`asyncio `" + +#: ../../library/cmdline.rst:9 +msgid ":mod:`base64`" +msgstr ":mod:`base64`" + +#: ../../library/cmdline.rst:10 +msgid ":ref:`calendar `" +msgstr ":ref:`calendar `" + +#: ../../library/cmdline.rst:11 +msgid ":mod:`code`" +msgstr ":mod:`code`" + +#: ../../library/cmdline.rst:12 +msgid ":ref:`compileall `" +msgstr ":ref:`compileall `" + +#: ../../library/cmdline.rst:13 +msgid ":mod:`cProfile`: see :ref:`profile `" +msgstr ":mod:`cProfile`: 請見 :ref:`profile `" + +#: ../../library/cmdline.rst:14 +msgid ":ref:`difflib `" +msgstr ":ref:`difflib `" + +#: ../../library/cmdline.rst:15 +msgid ":ref:`dis `" +msgstr ":ref:`dis `" + +#: ../../library/cmdline.rst:16 +msgid ":mod:`doctest`" +msgstr ":mod:`doctest`" + +#: ../../library/cmdline.rst:17 +msgid ":mod:`!encodings.rot_13`" +msgstr ":mod:`!encodings.rot_13`" + +#: ../../library/cmdline.rst:18 +msgid ":mod:`ensurepip`" +msgstr ":mod:`ensurepip`" + +#: ../../library/cmdline.rst:19 +msgid ":mod:`filecmp`" +msgstr ":mod:`filecmp`" + +#: ../../library/cmdline.rst:20 +msgid ":mod:`fileinput`" +msgstr ":mod:`fileinput`" + +#: ../../library/cmdline.rst:21 +msgid ":mod:`ftplib`" +msgstr ":mod:`ftplib`" + +#: ../../library/cmdline.rst:22 +msgid ":ref:`gzip `" +msgstr ":ref:`gzip `" + +#: ../../library/cmdline.rst:23 +msgid ":ref:`http.server `" +msgstr ":ref:`http.server `" + +#: ../../library/cmdline.rst:24 +msgid ":mod:`!idlelib`" +msgstr ":mod:`!idlelib`" + +#: ../../library/cmdline.rst:25 +msgid ":ref:`inspect `" +msgstr ":ref:`inspect `" + +#: ../../library/cmdline.rst:26 +msgid ":ref:`json.tool `" +msgstr ":ref:`json.tool `" + +#: ../../library/cmdline.rst:27 +msgid ":mod:`mimetypes`" +msgstr ":mod:`mimetypes`" + +#: ../../library/cmdline.rst:28 +msgid ":mod:`pdb`" +msgstr ":mod:`pdb`" + +#: ../../library/cmdline.rst:29 +msgid ":mod:`pickle`" +msgstr ":mod:`pickle`" + +#: ../../library/cmdline.rst:30 +msgid ":ref:`pickletools `" +msgstr ":ref:`pickletools `" + +#: ../../library/cmdline.rst:31 +msgid ":mod:`platform`" +msgstr ":mod:`platform`" + +#: ../../library/cmdline.rst:32 +msgid ":mod:`poplib`" +msgstr ":mod:`poplib`" + +#: ../../library/cmdline.rst:33 +msgid ":ref:`profile `" +msgstr ":ref:`profile `" + +#: ../../library/cmdline.rst:34 +msgid ":mod:`pstats`" +msgstr ":mod:`pstats`" + +#: ../../library/cmdline.rst:35 +msgid ":ref:`py_compile `" +msgstr ":ref:`py_compile `" + +#: ../../library/cmdline.rst:36 +msgid ":mod:`pyclbr`" +msgstr ":mod:`pyclbr`" + +#: ../../library/cmdline.rst:37 +msgid ":mod:`pydoc`" +msgstr ":mod:`pydoc`" + +#: ../../library/cmdline.rst:38 +msgid ":mod:`quopri`" +msgstr ":mod:`quopri`" + +#: ../../library/cmdline.rst:39 +msgid ":mod:`runpy`" +msgstr ":mod:`runpy`" + +#: ../../library/cmdline.rst:40 +msgid ":ref:`site `" +msgstr ":ref:`site `" + +#: ../../library/cmdline.rst:41 +msgid ":ref:`sqlite3 `" +msgstr ":ref:`sqlite3 `" + +#: ../../library/cmdline.rst:42 +msgid ":ref:`sysconfig `" +msgstr ":ref:`sysconfig `" + +#: ../../library/cmdline.rst:43 +msgid ":mod:`tabnanny`" +msgstr ":mod:`tabnanny`" + +#: ../../library/cmdline.rst:44 +msgid ":ref:`tarfile `" +msgstr ":ref:`tarfile `" + +#: ../../library/cmdline.rst:45 +msgid ":mod:`!this`" +msgstr ":mod:`!this`" + +#: ../../library/cmdline.rst:46 +msgid ":ref:`timeit `" +msgstr ":ref:`timeit `" + +#: ../../library/cmdline.rst:47 +msgid ":ref:`tokenize `" +msgstr ":ref:`tokenize `" + +#: ../../library/cmdline.rst:48 +msgid ":ref:`trace `" +msgstr ":ref:`trace `" + +#: ../../library/cmdline.rst:49 +msgid ":mod:`turtledemo`" +msgstr ":mod:`turtledemo`" + +#: ../../library/cmdline.rst:50 +msgid ":ref:`unittest `" +msgstr ":ref:`unittest `" + +#: ../../library/cmdline.rst:51 +msgid ":ref:`uuid `" +msgstr ":ref:`uuid `" + +#: ../../library/cmdline.rst:52 +msgid ":mod:`venv`" +msgstr ":mod:`venv`" + +#: ../../library/cmdline.rst:53 +msgid ":mod:`webbrowser`" +msgstr ":mod:`webbrowser`" + +#: ../../library/cmdline.rst:54 +msgid ":ref:`zipapp `" +msgstr ":ref:`zipapp `" + +#: ../../library/cmdline.rst:55 +msgid ":ref:`zipfile `" +msgstr ":ref:`zipfile `" + +#: ../../library/cmdline.rst:57 +msgid "See also the :ref:`Python command-line interface `." +msgstr "另請見 :ref:`Python 命令列介面 `。" diff --git a/library/codecs.po b/library/codecs.po index 80c52869c2..c619a48de8 100644 --- a/library/codecs.po +++ b/library/codecs.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:15+0000\n" +"POT-Creation-Date: 2023-10-11 17:13+0000\n" "PO-Revision-Date: 2018-05-23 14:40+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -363,14 +363,14 @@ msgid "" "encodings` codecs:" msgstr "" -#: ../../library/codecs.rst:330 ../../library/codecs.rst:372 -#: ../../library/codecs.rst:391 +#: ../../library/codecs.rst:330 ../../library/codecs.rst:373 +#: ../../library/codecs.rst:393 msgid "Value" msgstr "" -#: ../../library/codecs.rst:330 ../../library/codecs.rst:372 -#: ../../library/codecs.rst:391 ../../library/codecs.rst:1324 -#: ../../library/codecs.rst:1391 ../../library/codecs.rst:1446 +#: ../../library/codecs.rst:330 ../../library/codecs.rst:373 +#: ../../library/codecs.rst:393 ../../library/codecs.rst:1327 +#: ../../library/codecs.rst:1395 ../../library/codecs.rst:1450 msgid "Meaning" msgstr "" @@ -412,16 +412,16 @@ msgstr "``'backslashreplace'``" #: ../../library/codecs.rst:346 msgid "" "Replace with backslashed escape sequences. On encoding, use hexadecimal form " -"of Unicode code point with formats ``\\xhh`` ``\\uxxxx`` ``\\Uxxxxxxxx``. On " -"decoding, use hexadecimal form of byte value with format ``\\xhh``. " -"Implemented in :func:`backslashreplace_errors`." +"of Unicode code point with formats :samp:`\\\\x{hh}` :samp:`\\\\u{xxxx}` :" +"samp:`\\\\U{xxxxxxxx}`. On decoding, use hexadecimal form of byte value with " +"format :samp:`\\\\x{hh}`. Implemented in :func:`backslashreplace_errors`." msgstr "" -#: ../../library/codecs.rst:354 +#: ../../library/codecs.rst:355 msgid "``'surrogateescape'``" msgstr "``'surrogateescape'``" -#: ../../library/codecs.rst:354 +#: ../../library/codecs.rst:355 msgid "" "On decoding, replace byte with individual surrogate code ranging from " "``U+DC80`` to ``U+DCFF``. This code will then be turned back into the same " @@ -429,92 +429,92 @@ msgid "" "data. (See :pep:`383` for more.)" msgstr "" -#: ../../library/codecs.rst:368 +#: ../../library/codecs.rst:369 msgid "" "The following error handlers are only applicable to encoding (within :term:" "`text encodings `):" msgstr "" -#: ../../library/codecs.rst:374 +#: ../../library/codecs.rst:375 msgid "``'xmlcharrefreplace'``" msgstr "``'xmlcharrefreplace'``" -#: ../../library/codecs.rst:374 +#: ../../library/codecs.rst:375 msgid "" "Replace with XML/HTML numeric character reference, which is a decimal form " -"of Unicode code point with format ``&#num;`` Implemented in :func:" +"of Unicode code point with format :samp:`&#{num};`. Implemented in :func:" "`xmlcharrefreplace_errors`." msgstr "" -#: ../../library/codecs.rst:379 +#: ../../library/codecs.rst:381 msgid "``'namereplace'``" msgstr "``'namereplace'``" -#: ../../library/codecs.rst:379 +#: ../../library/codecs.rst:381 msgid "" "Replace with ``\\N{...}`` escape sequences, what appears in the braces is " "the Name property from Unicode Character Database. Implemented in :func:" "`namereplace_errors`." msgstr "" -#: ../../library/codecs.rst:388 +#: ../../library/codecs.rst:390 msgid "" "In addition, the following error handler is specific to the given codecs:" msgstr "" -#: ../../library/codecs.rst:13 ../../library/codecs.rst:391 +#: ../../library/codecs.rst:13 ../../library/codecs.rst:393 msgid "Codecs" msgstr "" -#: ../../library/codecs.rst:393 +#: ../../library/codecs.rst:395 msgid "``'surrogatepass'``" msgstr "``'surrogatepass'``" -#: ../../library/codecs.rst:393 +#: ../../library/codecs.rst:395 msgid "utf-8, utf-16, utf-32, utf-16-be, utf-16-le, utf-32-be, utf-32-le" msgstr "utf-8, utf-16, utf-32, utf-16-be, utf-16-le, utf-32-be, utf-32-le" -#: ../../library/codecs.rst:393 +#: ../../library/codecs.rst:395 msgid "" "Allow encoding and decoding surrogate code point (``U+D800`` - ``U+DFFF``) " "as normal code point. Otherwise these codecs treat the presence of surrogate " "code point in :class:`str` as an error." msgstr "" -#: ../../library/codecs.rst:400 +#: ../../library/codecs.rst:402 msgid "The ``'surrogateescape'`` and ``'surrogatepass'`` error handlers." msgstr "" -#: ../../library/codecs.rst:403 +#: ../../library/codecs.rst:405 msgid "" "The ``'surrogatepass'`` error handler now works with utf-16\\* and utf-32\\* " "codecs." msgstr "" -#: ../../library/codecs.rst:407 +#: ../../library/codecs.rst:409 msgid "The ``'namereplace'`` error handler." msgstr "" -#: ../../library/codecs.rst:410 +#: ../../library/codecs.rst:412 msgid "" "The ``'backslashreplace'`` error handler now works with decoding and " "translating." msgstr "" -#: ../../library/codecs.rst:414 +#: ../../library/codecs.rst:416 msgid "" "The set of allowed values can be extended by registering a new named error " "handler:" msgstr "" -#: ../../library/codecs.rst:419 +#: ../../library/codecs.rst:421 msgid "" "Register the error handling function *error_handler* under the name *name*. " "The *error_handler* argument will be called during encoding and decoding in " "case of an error, when *name* is specified as the errors parameter." msgstr "" -#: ../../library/codecs.rst:423 +#: ../../library/codecs.rst:425 msgid "" "For encoding, *error_handler* will be called with a :exc:" "`UnicodeEncodeError` instance, which contains information about the location " @@ -529,97 +529,97 @@ msgid "" "position is out of bound an :exc:`IndexError` will be raised." msgstr "" -#: ../../library/codecs.rst:435 +#: ../../library/codecs.rst:437 msgid "" "Decoding and translating works similarly, except :exc:`UnicodeDecodeError` " "or :exc:`UnicodeTranslateError` will be passed to the handler and that the " "replacement from the error handler will be put into the output directly." msgstr "" -#: ../../library/codecs.rst:440 +#: ../../library/codecs.rst:442 msgid "" "Previously registered error handlers (including the standard error handlers) " "can be looked up by name:" msgstr "" -#: ../../library/codecs.rst:445 +#: ../../library/codecs.rst:447 msgid "Return the error handler previously registered under the name *name*." msgstr "" -#: ../../library/codecs.rst:447 +#: ../../library/codecs.rst:449 msgid "Raises a :exc:`LookupError` in case the handler cannot be found." msgstr "" -#: ../../library/codecs.rst:449 +#: ../../library/codecs.rst:451 msgid "" "The following standard error handlers are also made available as module " "level functions:" msgstr "" -#: ../../library/codecs.rst:454 +#: ../../library/codecs.rst:456 msgid "Implements the ``'strict'`` error handling." msgstr "" -#: ../../library/codecs.rst:456 +#: ../../library/codecs.rst:458 msgid "Each encoding or decoding error raises a :exc:`UnicodeError`." msgstr "" -#: ../../library/codecs.rst:461 +#: ../../library/codecs.rst:463 msgid "Implements the ``'ignore'`` error handling." msgstr "" -#: ../../library/codecs.rst:463 +#: ../../library/codecs.rst:465 msgid "" "Malformed data is ignored; encoding or decoding is continued without further " "notice." msgstr "" -#: ../../library/codecs.rst:469 +#: ../../library/codecs.rst:471 msgid "Implements the ``'replace'`` error handling." msgstr "" -#: ../../library/codecs.rst:471 +#: ../../library/codecs.rst:473 msgid "" "Substitutes ``?`` (ASCII character) for encoding errors or ``�`` (U+FFFD, " "the official REPLACEMENT CHARACTER) for decoding errors." msgstr "" -#: ../../library/codecs.rst:477 +#: ../../library/codecs.rst:479 msgid "Implements the ``'backslashreplace'`` error handling." msgstr "" -#: ../../library/codecs.rst:479 +#: ../../library/codecs.rst:481 msgid "" "Malformed data is replaced by a backslashed escape sequence. On encoding, " -"use the hexadecimal form of Unicode code point with formats ``\\xhh`` " -"``\\uxxxx`` ``\\Uxxxxxxxx``. On decoding, use the hexadecimal form of byte " -"value with format ``\\xhh``." +"use the hexadecimal form of Unicode code point with formats :samp:`\\\\x{hh}" +"` :samp:`\\\\u{xxxx}` :samp:`\\\\U{xxxxxxxx}`. On decoding, use the " +"hexadecimal form of byte value with format :samp:`\\\\x{hh}`." msgstr "" -#: ../../library/codecs.rst:484 +#: ../../library/codecs.rst:487 msgid "Works with decoding and translating." msgstr "" -#: ../../library/codecs.rst:490 +#: ../../library/codecs.rst:493 msgid "" "Implements the ``'xmlcharrefreplace'`` error handling (for encoding within :" "term:`text encoding` only)." msgstr "" -#: ../../library/codecs.rst:493 +#: ../../library/codecs.rst:496 msgid "" "The unencodable character is replaced by an appropriate XML/HTML numeric " "character reference, which is a decimal form of Unicode code point with " -"format ``&#num;`` ." +"format :samp:`&#{num};` ." msgstr "" -#: ../../library/codecs.rst:500 +#: ../../library/codecs.rst:503 msgid "" "Implements the ``'namereplace'`` error handling (for encoding within :term:" "`text encoding` only)." msgstr "" -#: ../../library/codecs.rst:503 +#: ../../library/codecs.rst:506 msgid "" "The unencodable character is replaced by a ``\\N{...}`` escape sequence. The " "set of characters that appear in the braces is the Name property from " @@ -627,17 +627,17 @@ msgid "" "will be converted to byte sequence ``\\N{LATIN SMALL LETTER SHARP S}`` ." msgstr "" -#: ../../library/codecs.rst:514 +#: ../../library/codecs.rst:517 msgid "Stateless Encoding and Decoding" msgstr "" -#: ../../library/codecs.rst:516 +#: ../../library/codecs.rst:519 msgid "" "The base :class:`Codec` class defines these methods which also define the " "function interfaces of the stateless encoder and decoder:" msgstr "" -#: ../../library/codecs.rst:522 +#: ../../library/codecs.rst:525 msgid "" "Encodes the object *input* and returns a tuple (output object, length " "consumed). For instance, :term:`text encoding` converts a string object to a " @@ -645,26 +645,26 @@ msgid "" "``iso-8859-1``)." msgstr "" -#: ../../library/codecs.rst:527 ../../library/codecs.rst:549 +#: ../../library/codecs.rst:530 ../../library/codecs.rst:552 msgid "" "The *errors* argument defines the error handling to apply. It defaults to " "``'strict'`` handling." msgstr "" -#: ../../library/codecs.rst:530 +#: ../../library/codecs.rst:533 msgid "" "The method may not store state in the :class:`Codec` instance. Use :class:" "`StreamWriter` for codecs which have to keep state in order to make encoding " "efficient." msgstr "" -#: ../../library/codecs.rst:534 +#: ../../library/codecs.rst:537 msgid "" "The encoder must be able to handle zero length input and return an empty " "object of the output object type in this situation." msgstr "" -#: ../../library/codecs.rst:540 +#: ../../library/codecs.rst:543 msgid "" "Decodes the object *input* and returns a tuple (output object, length " "consumed). For instance, for a :term:`text encoding`, decoding converts a " @@ -672,31 +672,31 @@ msgid "" "object." msgstr "" -#: ../../library/codecs.rst:545 +#: ../../library/codecs.rst:548 msgid "" "For text encodings and bytes-to-bytes codecs, *input* must be a bytes object " "or one which provides the read-only buffer interface -- for example, buffer " "objects and memory mapped files." msgstr "" -#: ../../library/codecs.rst:552 +#: ../../library/codecs.rst:555 msgid "" "The method may not store state in the :class:`Codec` instance. Use :class:" "`StreamReader` for codecs which have to keep state in order to make decoding " "efficient." msgstr "" -#: ../../library/codecs.rst:556 +#: ../../library/codecs.rst:559 msgid "" "The decoder must be able to handle zero length input and return an empty " "object of the output object type in this situation." msgstr "" -#: ../../library/codecs.rst:561 +#: ../../library/codecs.rst:564 msgid "Incremental Encoding and Decoding" msgstr "" -#: ../../library/codecs.rst:563 +#: ../../library/codecs.rst:566 msgid "" "The :class:`IncrementalEncoder` and :class:`IncrementalDecoder` classes " "provide the basic interface for incremental encoding and decoding. Encoding/" @@ -707,7 +707,7 @@ msgid "" "during method calls." msgstr "" -#: ../../library/codecs.rst:571 +#: ../../library/codecs.rst:574 msgid "" "The joined output of calls to the :meth:`~IncrementalEncoder.encode`/:meth:" "`~IncrementalDecoder.decode` method is the same as if all the single inputs " @@ -715,36 +715,36 @@ msgid "" "encoder/decoder." msgstr "" -#: ../../library/codecs.rst:580 +#: ../../library/codecs.rst:583 msgid "IncrementalEncoder Objects" msgstr "IncrementalEncoder 物件" -#: ../../library/codecs.rst:582 +#: ../../library/codecs.rst:585 msgid "" "The :class:`IncrementalEncoder` class is used for encoding an input in " "multiple steps. It defines the following methods which every incremental " "encoder must define in order to be compatible with the Python codec registry." msgstr "" -#: ../../library/codecs.rst:589 +#: ../../library/codecs.rst:592 msgid "Constructor for an :class:`IncrementalEncoder` instance." msgstr "" -#: ../../library/codecs.rst:591 +#: ../../library/codecs.rst:594 msgid "" "All incremental encoders must provide this constructor interface. They are " "free to add additional keyword arguments, but only the ones defined here are " "used by the Python codec registry." msgstr "" -#: ../../library/codecs.rst:595 +#: ../../library/codecs.rst:598 msgid "" "The :class:`IncrementalEncoder` may implement different error handling " "schemes by providing the *errors* keyword argument. See :ref:`error-" "handlers` for possible values." msgstr "" -#: ../../library/codecs.rst:599 +#: ../../library/codecs.rst:602 msgid "" "The *errors* argument will be assigned to an attribute of the same name. " "Assigning to this attribute makes it possible to switch between different " @@ -752,21 +752,21 @@ msgid "" "`IncrementalEncoder` object." msgstr "" -#: ../../library/codecs.rst:607 +#: ../../library/codecs.rst:610 msgid "" "Encodes *object* (taking the current state of the encoder into account) and " "returns the resulting encoded object. If this is the last call to :meth:" "`encode` *final* must be true (the default is false)." msgstr "" -#: ../../library/codecs.rst:614 +#: ../../library/codecs.rst:617 msgid "" "Reset the encoder to the initial state. The output is discarded: call ``." "encode(object, final=True)``, passing an empty byte or text string if " "necessary, to reset the encoder and to get the output." msgstr "" -#: ../../library/codecs.rst:621 +#: ../../library/codecs.rst:624 msgid "" "Return the current state of the encoder which must be an integer. The " "implementation should make sure that ``0`` is the most common state. (States " @@ -775,42 +775,42 @@ msgid "" "into an integer.)" msgstr "" -#: ../../library/codecs.rst:630 +#: ../../library/codecs.rst:633 msgid "" "Set the state of the encoder to *state*. *state* must be an encoder state " "returned by :meth:`getstate`." msgstr "" -#: ../../library/codecs.rst:637 +#: ../../library/codecs.rst:640 msgid "IncrementalDecoder Objects" msgstr "IncrementalDecoder 物件" -#: ../../library/codecs.rst:639 +#: ../../library/codecs.rst:642 msgid "" "The :class:`IncrementalDecoder` class is used for decoding an input in " "multiple steps. It defines the following methods which every incremental " "decoder must define in order to be compatible with the Python codec registry." msgstr "" -#: ../../library/codecs.rst:646 +#: ../../library/codecs.rst:649 msgid "Constructor for an :class:`IncrementalDecoder` instance." msgstr "" -#: ../../library/codecs.rst:648 +#: ../../library/codecs.rst:651 msgid "" "All incremental decoders must provide this constructor interface. They are " "free to add additional keyword arguments, but only the ones defined here are " "used by the Python codec registry." msgstr "" -#: ../../library/codecs.rst:652 +#: ../../library/codecs.rst:655 msgid "" "The :class:`IncrementalDecoder` may implement different error handling " "schemes by providing the *errors* keyword argument. See :ref:`error-" "handlers` for possible values." msgstr "" -#: ../../library/codecs.rst:656 +#: ../../library/codecs.rst:659 msgid "" "The *errors* argument will be assigned to an attribute of the same name. " "Assigning to this attribute makes it possible to switch between different " @@ -818,7 +818,7 @@ msgid "" "`IncrementalDecoder` object." msgstr "" -#: ../../library/codecs.rst:664 +#: ../../library/codecs.rst:667 msgid "" "Decodes *object* (taking the current state of the decoder into account) and " "returns the resulting decoded object. If this is the last call to :meth:" @@ -829,11 +829,11 @@ msgid "" "(which might raise an exception)." msgstr "" -#: ../../library/codecs.rst:675 +#: ../../library/codecs.rst:678 msgid "Reset the decoder to the initial state." msgstr "" -#: ../../library/codecs.rst:680 +#: ../../library/codecs.rst:683 msgid "" "Return the current state of the decoder. This must be a tuple with two " "items, the first must be the buffer containing the still undecoded input. " @@ -848,59 +848,59 @@ msgid "" "bytes of the resulting string into an integer.)" msgstr "" -#: ../../library/codecs.rst:695 +#: ../../library/codecs.rst:698 msgid "" "Set the state of the decoder to *state*. *state* must be a decoder state " "returned by :meth:`getstate`." msgstr "" -#: ../../library/codecs.rst:700 +#: ../../library/codecs.rst:703 msgid "Stream Encoding and Decoding" msgstr "" -#: ../../library/codecs.rst:703 +#: ../../library/codecs.rst:706 msgid "" "The :class:`StreamWriter` and :class:`StreamReader` classes provide generic " "working interfaces which can be used to implement new encoding submodules " "very easily. See :mod:`encodings.utf_8` for an example of how this is done." msgstr "" -#: ../../library/codecs.rst:711 +#: ../../library/codecs.rst:714 msgid "StreamWriter Objects" msgstr "StreamWriter 物件" -#: ../../library/codecs.rst:713 +#: ../../library/codecs.rst:716 msgid "" "The :class:`StreamWriter` class is a subclass of :class:`Codec` and defines " "the following methods which every stream writer must define in order to be " "compatible with the Python codec registry." msgstr "" -#: ../../library/codecs.rst:720 +#: ../../library/codecs.rst:723 msgid "Constructor for a :class:`StreamWriter` instance." msgstr "" -#: ../../library/codecs.rst:722 +#: ../../library/codecs.rst:725 msgid "" "All stream writers must provide this constructor interface. They are free to " "add additional keyword arguments, but only the ones defined here are used by " "the Python codec registry." msgstr "" -#: ../../library/codecs.rst:726 +#: ../../library/codecs.rst:729 msgid "" "The *stream* argument must be a file-like object open for writing text or " "binary data, as appropriate for the specific codec." msgstr "" -#: ../../library/codecs.rst:729 +#: ../../library/codecs.rst:732 msgid "" "The :class:`StreamWriter` may implement different error handling schemes by " "providing the *errors* keyword argument. See :ref:`error-handlers` for the " "standard error handlers the underlying stream codec may support." msgstr "" -#: ../../library/codecs.rst:733 +#: ../../library/codecs.rst:736 msgid "" "The *errors* argument will be assigned to an attribute of the same name. " "Assigning to this attribute makes it possible to switch between different " @@ -908,70 +908,70 @@ msgid "" "object." msgstr "" -#: ../../library/codecs.rst:739 +#: ../../library/codecs.rst:742 msgid "Writes the object's contents encoded to the stream." msgstr "" -#: ../../library/codecs.rst:744 +#: ../../library/codecs.rst:747 msgid "" "Writes the concatenated iterable of strings to the stream (possibly by " "reusing the :meth:`write` method). Infinite or very large iterables are not " "supported. The standard bytes-to-bytes codecs do not support this method." msgstr "" -#: ../../library/codecs.rst:752 ../../library/codecs.rst:847 +#: ../../library/codecs.rst:755 ../../library/codecs.rst:850 msgid "Resets the codec buffers used for keeping internal state." msgstr "" -#: ../../library/codecs.rst:754 +#: ../../library/codecs.rst:757 msgid "" "Calling this method should ensure that the data on the output is put into a " "clean state that allows appending of new fresh data without having to rescan " "the whole stream to recover state." msgstr "" -#: ../../library/codecs.rst:759 +#: ../../library/codecs.rst:762 msgid "" "In addition to the above methods, the :class:`StreamWriter` must also " "inherit all other methods and attributes from the underlying stream." msgstr "" -#: ../../library/codecs.rst:766 +#: ../../library/codecs.rst:769 msgid "StreamReader Objects" msgstr "StreamReader 物件" -#: ../../library/codecs.rst:768 +#: ../../library/codecs.rst:771 msgid "" "The :class:`StreamReader` class is a subclass of :class:`Codec` and defines " "the following methods which every stream reader must define in order to be " "compatible with the Python codec registry." msgstr "" -#: ../../library/codecs.rst:775 +#: ../../library/codecs.rst:778 msgid "Constructor for a :class:`StreamReader` instance." msgstr "" -#: ../../library/codecs.rst:777 +#: ../../library/codecs.rst:780 msgid "" "All stream readers must provide this constructor interface. They are free to " "add additional keyword arguments, but only the ones defined here are used by " "the Python codec registry." msgstr "" -#: ../../library/codecs.rst:781 +#: ../../library/codecs.rst:784 msgid "" "The *stream* argument must be a file-like object open for reading text or " "binary data, as appropriate for the specific codec." msgstr "" -#: ../../library/codecs.rst:784 +#: ../../library/codecs.rst:787 msgid "" "The :class:`StreamReader` may implement different error handling schemes by " "providing the *errors* keyword argument. See :ref:`error-handlers` for the " "standard error handlers the underlying stream codec may support." msgstr "" -#: ../../library/codecs.rst:788 +#: ../../library/codecs.rst:791 msgid "" "The *errors* argument will be assigned to an attribute of the same name. " "Assigning to this attribute makes it possible to switch between different " @@ -979,24 +979,24 @@ msgid "" "object." msgstr "" -#: ../../library/codecs.rst:792 +#: ../../library/codecs.rst:795 msgid "" "The set of allowed values for the *errors* argument can be extended with :" "func:`register_error`." msgstr "" -#: ../../library/codecs.rst:798 +#: ../../library/codecs.rst:801 msgid "Decodes data from the stream and returns the resulting object." msgstr "" -#: ../../library/codecs.rst:800 +#: ../../library/codecs.rst:803 msgid "" "The *chars* argument indicates the number of decoded code points or bytes to " "return. The :func:`read` method will never return more data than requested, " "but it might return less, if there is not enough available." msgstr "" -#: ../../library/codecs.rst:805 +#: ../../library/codecs.rst:808 msgid "" "The *size* argument indicates the approximate maximum number of encoded " "bytes or code points to read for decoding. The decoder can modify this " @@ -1005,13 +1005,13 @@ msgid "" "huge files in one step." msgstr "" -#: ../../library/codecs.rst:812 +#: ../../library/codecs.rst:815 msgid "" "The *firstline* flag indicates that it would be sufficient to only return " "the first line, if there are decoding errors on later lines." msgstr "" -#: ../../library/codecs.rst:816 +#: ../../library/codecs.rst:819 msgid "" "The method should use a greedy read strategy meaning that it should read as " "much data as is allowed within the definition of the encoding and the given " @@ -1019,68 +1019,68 @@ msgid "" "the stream, these should be read too." msgstr "" -#: ../../library/codecs.rst:824 +#: ../../library/codecs.rst:827 msgid "Read one line from the input stream and return the decoded data." msgstr "" -#: ../../library/codecs.rst:826 +#: ../../library/codecs.rst:829 msgid "" "*size*, if given, is passed as size argument to the stream's :meth:`read` " "method." msgstr "" -#: ../../library/codecs.rst:829 +#: ../../library/codecs.rst:832 msgid "" "If *keepends* is false line-endings will be stripped from the lines returned." msgstr "" -#: ../../library/codecs.rst:835 +#: ../../library/codecs.rst:838 msgid "" "Read all lines available on the input stream and return them as a list of " "lines." msgstr "" -#: ../../library/codecs.rst:838 +#: ../../library/codecs.rst:841 msgid "" "Line-endings are implemented using the codec's :meth:`decode` method and are " "included in the list entries if *keepends* is true." msgstr "" -#: ../../library/codecs.rst:841 +#: ../../library/codecs.rst:844 msgid "" "*sizehint*, if given, is passed as the *size* argument to the stream's :meth:" "`read` method." msgstr "" -#: ../../library/codecs.rst:849 +#: ../../library/codecs.rst:852 msgid "" "Note that no stream repositioning should take place. This method is " "primarily intended to be able to recover from decoding errors." msgstr "" -#: ../../library/codecs.rst:853 +#: ../../library/codecs.rst:856 msgid "" "In addition to the above methods, the :class:`StreamReader` must also " "inherit all other methods and attributes from the underlying stream." msgstr "" -#: ../../library/codecs.rst:859 +#: ../../library/codecs.rst:862 msgid "StreamReaderWriter Objects" msgstr "StreamReaderWriter 物件" -#: ../../library/codecs.rst:861 +#: ../../library/codecs.rst:864 msgid "" "The :class:`StreamReaderWriter` is a convenience class that allows wrapping " "streams which work in both read and write modes." msgstr "" -#: ../../library/codecs.rst:864 ../../library/codecs.rst:888 +#: ../../library/codecs.rst:867 ../../library/codecs.rst:891 msgid "" "The design is such that one can use the factory functions returned by the :" "func:`lookup` function to construct the instance." msgstr "" -#: ../../library/codecs.rst:870 +#: ../../library/codecs.rst:873 msgid "" "Creates a :class:`StreamReaderWriter` instance. *stream* must be a file-like " "object. *Reader* and *Writer* must be factory functions or classes providing " @@ -1089,24 +1089,24 @@ msgid "" "writers." msgstr "" -#: ../../library/codecs.rst:875 +#: ../../library/codecs.rst:878 msgid "" ":class:`StreamReaderWriter` instances define the combined interfaces of :" "class:`StreamReader` and :class:`StreamWriter` classes. They inherit all " "other methods and attributes from the underlying stream." msgstr "" -#: ../../library/codecs.rst:883 +#: ../../library/codecs.rst:886 msgid "StreamRecoder Objects" msgstr "StreamRecoder 物件" -#: ../../library/codecs.rst:885 +#: ../../library/codecs.rst:888 msgid "" "The :class:`StreamRecoder` translates data from one encoding to another, " "which is sometimes useful when dealing with different encoding environments." msgstr "" -#: ../../library/codecs.rst:894 +#: ../../library/codecs.rst:897 msgid "" "Creates a :class:`StreamRecoder` instance which implements a two-way " "conversion: *encode* and *decode* work on the frontend — the data visible to " @@ -1114,17 +1114,17 @@ msgid "" "work on the backend — the data in *stream*." msgstr "" -#: ../../library/codecs.rst:899 +#: ../../library/codecs.rst:902 msgid "" "You can use these objects to do transparent transcodings, e.g., from Latin-1 " "to UTF-8 and back." msgstr "" -#: ../../library/codecs.rst:902 +#: ../../library/codecs.rst:905 msgid "The *stream* argument must be a file-like object." msgstr "" -#: ../../library/codecs.rst:904 +#: ../../library/codecs.rst:907 msgid "" "The *encode* and *decode* arguments must adhere to the :class:`Codec` " "interface. *Reader* and *Writer* must be factory functions or classes " @@ -1132,24 +1132,24 @@ msgid "" "interface respectively." msgstr "" -#: ../../library/codecs.rst:909 +#: ../../library/codecs.rst:912 msgid "" "Error handling is done in the same way as defined for the stream readers and " "writers." msgstr "" -#: ../../library/codecs.rst:913 +#: ../../library/codecs.rst:916 msgid "" ":class:`StreamRecoder` instances define the combined interfaces of :class:" "`StreamReader` and :class:`StreamWriter` classes. They inherit all other " "methods and attributes from the underlying stream." msgstr "" -#: ../../library/codecs.rst:921 +#: ../../library/codecs.rst:924 msgid "Encodings and Unicode" msgstr "" -#: ../../library/codecs.rst:923 +#: ../../library/codecs.rst:926 msgid "" "Strings are stored internally as sequences of code points in range " "``U+0000``--``U+10FFFF``. (See :pep:`393` for more details about the " @@ -1161,7 +1161,7 @@ msgid "" "which are collectivity referred to as :term:`text encodings `." msgstr "" -#: ../../library/codecs.rst:933 +#: ../../library/codecs.rst:936 msgid "" "The simplest text encoding (called ``'latin-1'`` or ``'iso-8859-1'``) maps " "the code points 0--255 to the bytes ``0x0``--``0xff``, which means that a " @@ -1172,7 +1172,7 @@ msgid "" "position 3: ordinal not in range(256)``." msgstr "" -#: ../../library/codecs.rst:941 +#: ../../library/codecs.rst:944 msgid "" "There's another group of encodings (the so called charmap encodings) that " "choose a different subset of all Unicode code points and how these code " @@ -1182,7 +1182,7 @@ msgid "" "that shows you which character is mapped to which byte value." msgstr "" -#: ../../library/codecs.rst:948 +#: ../../library/codecs.rst:951 msgid "" "All of these encodings can only encode 256 of the 1114112 code points " "defined in Unicode. A simple and straightforward way that can store each " @@ -1212,7 +1212,7 @@ msgid "" "normal character that will be decoded like any other." msgstr "" -#: ../../library/codecs.rst:974 +#: ../../library/codecs.rst:977 msgid "" "There's another encoding that is able to encode the full range of Unicode " "characters: UTF-8. UTF-8 is an 8-bit encoding, which means there are no " @@ -1223,59 +1223,59 @@ msgid "" "which when concatenated give the Unicode character):" msgstr "" -#: ../../library/codecs.rst:983 +#: ../../library/codecs.rst:986 msgid "Range" msgstr "" -#: ../../library/codecs.rst:983 +#: ../../library/codecs.rst:986 msgid "Encoding" msgstr "" -#: ../../library/codecs.rst:985 +#: ../../library/codecs.rst:988 msgid "``U-00000000`` ... ``U-0000007F``" msgstr "``U-00000000`` ... ``U-0000007F``" -#: ../../library/codecs.rst:985 +#: ../../library/codecs.rst:988 msgid "0xxxxxxx" msgstr "0xxxxxxx" -#: ../../library/codecs.rst:987 +#: ../../library/codecs.rst:990 msgid "``U-00000080`` ... ``U-000007FF``" msgstr "``U-00000080`` ... ``U-000007FF``" -#: ../../library/codecs.rst:987 +#: ../../library/codecs.rst:990 msgid "110xxxxx 10xxxxxx" msgstr "110xxxxx 10xxxxxx" -#: ../../library/codecs.rst:989 +#: ../../library/codecs.rst:992 msgid "``U-00000800`` ... ``U-0000FFFF``" msgstr "``U-00000800`` ... ``U-0000FFFF``" -#: ../../library/codecs.rst:989 +#: ../../library/codecs.rst:992 msgid "1110xxxx 10xxxxxx 10xxxxxx" msgstr "1110xxxx 10xxxxxx 10xxxxxx" -#: ../../library/codecs.rst:991 +#: ../../library/codecs.rst:994 msgid "``U-00010000`` ... ``U-0010FFFF``" msgstr "``U-00010000`` ... ``U-0010FFFF``" -#: ../../library/codecs.rst:991 +#: ../../library/codecs.rst:994 msgid "11110xxx 10xxxxxx 10xxxxxx 10xxxxxx" msgstr "11110xxx 10xxxxxx 10xxxxxx 10xxxxxx" -#: ../../library/codecs.rst:994 +#: ../../library/codecs.rst:997 msgid "" "The least significant bit of the Unicode character is the rightmost x bit." msgstr "" -#: ../../library/codecs.rst:996 +#: ../../library/codecs.rst:999 msgid "" "As UTF-8 is an 8-bit encoding no BOM is required and any ``U+FEFF`` " "character in the decoded string (even if it's the first character) is " "treated as a ``ZERO WIDTH NO-BREAK SPACE``." msgstr "" -#: ../../library/codecs.rst:1000 +#: ../../library/codecs.rst:1003 msgid "" "Without external information it's impossible to reliably determine which " "encoding was used for encoding a string. Each charmap encoding can decode " @@ -1301,7 +1301,7 @@ msgstr "" msgid "INVERTED QUESTION MARK" msgstr "" -#: ../../library/codecs.rst:1016 +#: ../../library/codecs.rst:1019 msgid "" "in iso-8859-1), this increases the probability that a ``utf-8-sig`` encoding " "can be correctly guessed from the byte sequence. So here the BOM is not used " @@ -1313,11 +1313,11 @@ msgid "" "the use of the BOM is discouraged and should generally be avoided." msgstr "" -#: ../../library/codecs.rst:1029 +#: ../../library/codecs.rst:1032 msgid "Standard Encodings" msgstr "" -#: ../../library/codecs.rst:1031 +#: ../../library/codecs.rst:1034 msgid "" "Python comes with a number of codecs built-in, either implemented as C " "functions or with dictionaries as mapping tables. The following table lists " @@ -1329,7 +1329,7 @@ msgid "" "alias for the ``'utf_8'`` codec." msgstr "" -#: ../../library/codecs.rst:1041 +#: ../../library/codecs.rst:1044 msgid "" "Some common encodings can bypass the codecs lookup machinery to improve " "performance. These optimization opportunities are only recognized by CPython " @@ -1339,11 +1339,11 @@ msgid "" "Using alternative aliases for these encodings may result in slower execution." msgstr "" -#: ../../library/codecs.rst:1049 +#: ../../library/codecs.rst:1052 msgid "Optimization opportunity recognized for us-ascii." msgstr "" -#: ../../library/codecs.rst:1052 +#: ../../library/codecs.rst:1055 msgid "" "Many of the character sets support the same languages. They vary in " "individual characters (e.g. whether the EURO SIGN is supported or not), and " @@ -1351,504 +1351,504 @@ msgid "" "languages in particular, the following variants typically exist:" msgstr "" -#: ../../library/codecs.rst:1057 +#: ../../library/codecs.rst:1060 msgid "an ISO 8859 codeset" msgstr "" -#: ../../library/codecs.rst:1059 +#: ../../library/codecs.rst:1062 msgid "" "a Microsoft Windows code page, which is typically derived from an 8859 " "codeset, but replaces control characters with additional graphic characters" msgstr "" -#: ../../library/codecs.rst:1062 +#: ../../library/codecs.rst:1065 msgid "an IBM EBCDIC code page" msgstr "" -#: ../../library/codecs.rst:1064 +#: ../../library/codecs.rst:1067 msgid "an IBM PC code page, which is ASCII compatible" msgstr "" -#: ../../library/codecs.rst:1069 ../../library/codecs.rst:1324 -#: ../../library/codecs.rst:1391 ../../library/codecs.rst:1446 +#: ../../library/codecs.rst:1072 ../../library/codecs.rst:1327 +#: ../../library/codecs.rst:1395 ../../library/codecs.rst:1450 msgid "Codec" msgstr "" -#: ../../library/codecs.rst:1069 ../../library/codecs.rst:1324 -#: ../../library/codecs.rst:1391 ../../library/codecs.rst:1446 +#: ../../library/codecs.rst:1072 ../../library/codecs.rst:1327 +#: ../../library/codecs.rst:1395 ../../library/codecs.rst:1450 msgid "Aliases" msgstr "" -#: ../../library/codecs.rst:1069 +#: ../../library/codecs.rst:1072 msgid "Languages" msgstr "語言" -#: ../../library/codecs.rst:1071 +#: ../../library/codecs.rst:1074 msgid "ascii" msgstr "ascii" -#: ../../library/codecs.rst:1071 +#: ../../library/codecs.rst:1074 msgid "646, us-ascii" msgstr "646, us-ascii" -#: ../../library/codecs.rst:1071 ../../library/codecs.rst:1077 -#: ../../library/codecs.rst:1085 +#: ../../library/codecs.rst:1074 ../../library/codecs.rst:1080 +#: ../../library/codecs.rst:1088 msgid "English" msgstr "英文" -#: ../../library/codecs.rst:1073 +#: ../../library/codecs.rst:1076 msgid "big5" msgstr "big5" -#: ../../library/codecs.rst:1073 +#: ../../library/codecs.rst:1076 msgid "big5-tw, csbig5" msgstr "big5-tw, csbig5" -#: ../../library/codecs.rst:1073 ../../library/codecs.rst:1075 -#: ../../library/codecs.rst:1133 +#: ../../library/codecs.rst:1076 ../../library/codecs.rst:1078 +#: ../../library/codecs.rst:1136 msgid "Traditional Chinese" msgstr "繁體中文" -#: ../../library/codecs.rst:1075 +#: ../../library/codecs.rst:1078 msgid "big5hkscs" msgstr "big5hkscs" -#: ../../library/codecs.rst:1075 +#: ../../library/codecs.rst:1078 msgid "big5-hkscs, hkscs" msgstr "big5-hkscs, hkscs" -#: ../../library/codecs.rst:1077 +#: ../../library/codecs.rst:1080 msgid "cp037" msgstr "cp037" -#: ../../library/codecs.rst:1077 +#: ../../library/codecs.rst:1080 msgid "IBM037, IBM039" msgstr "IBM037, IBM039" -#: ../../library/codecs.rst:1079 +#: ../../library/codecs.rst:1082 msgid "cp273" msgstr "cp273" -#: ../../library/codecs.rst:1079 +#: ../../library/codecs.rst:1082 msgid "273, IBM273, csIBM273" msgstr "273, IBM273, csIBM273" -#: ../../library/codecs.rst:1079 +#: ../../library/codecs.rst:1082 msgid "German" msgstr "德文" -#: ../../library/codecs.rst:1083 +#: ../../library/codecs.rst:1086 msgid "cp424" msgstr "cp424" -#: ../../library/codecs.rst:1083 +#: ../../library/codecs.rst:1086 msgid "EBCDIC-CP-HE, IBM424" msgstr "EBCDIC-CP-HE, IBM424" -#: ../../library/codecs.rst:1083 ../../library/codecs.rst:1103 -#: ../../library/codecs.rst:1113 ../../library/codecs.rst:1156 -#: ../../library/codecs.rst:1219 +#: ../../library/codecs.rst:1086 ../../library/codecs.rst:1106 +#: ../../library/codecs.rst:1116 ../../library/codecs.rst:1159 +#: ../../library/codecs.rst:1222 msgid "Hebrew" msgstr "希伯來文" -#: ../../library/codecs.rst:1085 +#: ../../library/codecs.rst:1088 msgid "cp437" msgstr "cp437" -#: ../../library/codecs.rst:1085 +#: ../../library/codecs.rst:1088 msgid "437, IBM437" msgstr "437, IBM437" -#: ../../library/codecs.rst:1087 +#: ../../library/codecs.rst:1090 msgid "cp500" msgstr "cp500" -#: ../../library/codecs.rst:1087 +#: ../../library/codecs.rst:1090 msgid "EBCDIC-CP-BE, EBCDIC-CP-CH, IBM500" msgstr "EBCDIC-CP-BE, EBCDIC-CP-CH, IBM500" -#: ../../library/codecs.rst:1087 ../../library/codecs.rst:1096 -#: ../../library/codecs.rst:1107 ../../library/codecs.rst:1143 -#: ../../library/codecs.rst:1150 ../../library/codecs.rst:1203 -#: ../../library/codecs.rst:1231 ../../library/codecs.rst:1259 +#: ../../library/codecs.rst:1090 ../../library/codecs.rst:1099 +#: ../../library/codecs.rst:1110 ../../library/codecs.rst:1146 +#: ../../library/codecs.rst:1153 ../../library/codecs.rst:1206 +#: ../../library/codecs.rst:1234 ../../library/codecs.rst:1262 msgid "Western Europe" msgstr "" -#: ../../library/codecs.rst:1090 +#: ../../library/codecs.rst:1093 msgid "cp720" msgstr "cp720" -#: ../../library/codecs.rst:1090 ../../library/codecs.rst:1117 -#: ../../library/codecs.rst:1158 ../../library/codecs.rst:1215 +#: ../../library/codecs.rst:1093 ../../library/codecs.rst:1120 +#: ../../library/codecs.rst:1161 ../../library/codecs.rst:1218 msgid "Arabic" msgstr "阿拉伯文" -#: ../../library/codecs.rst:1092 +#: ../../library/codecs.rst:1095 msgid "cp737" msgstr "cp737" -#: ../../library/codecs.rst:1092 ../../library/codecs.rst:1123 -#: ../../library/codecs.rst:1127 ../../library/codecs.rst:1152 -#: ../../library/codecs.rst:1217 ../../library/codecs.rst:1252 +#: ../../library/codecs.rst:1095 ../../library/codecs.rst:1126 +#: ../../library/codecs.rst:1130 ../../library/codecs.rst:1155 +#: ../../library/codecs.rst:1220 ../../library/codecs.rst:1255 msgid "Greek" msgstr "希臘文" -#: ../../library/codecs.rst:1094 +#: ../../library/codecs.rst:1097 msgid "cp775" msgstr "cp775" -#: ../../library/codecs.rst:1094 +#: ../../library/codecs.rst:1097 msgid "IBM775" msgstr "IBM775" -#: ../../library/codecs.rst:1094 ../../library/codecs.rst:1160 -#: ../../library/codecs.rst:1210 ../../library/codecs.rst:1227 +#: ../../library/codecs.rst:1097 ../../library/codecs.rst:1163 +#: ../../library/codecs.rst:1213 ../../library/codecs.rst:1230 msgid "Baltic languages" msgstr "" -#: ../../library/codecs.rst:1096 +#: ../../library/codecs.rst:1099 msgid "cp850" msgstr "cp850" -#: ../../library/codecs.rst:1096 +#: ../../library/codecs.rst:1099 msgid "850, IBM850" msgstr "850, IBM850" -#: ../../library/codecs.rst:1098 +#: ../../library/codecs.rst:1101 msgid "cp852" msgstr "cp852" -#: ../../library/codecs.rst:1098 +#: ../../library/codecs.rst:1101 msgid "852, IBM852" msgstr "852, IBM852" -#: ../../library/codecs.rst:1098 ../../library/codecs.rst:1145 -#: ../../library/codecs.rst:1206 ../../library/codecs.rst:1256 +#: ../../library/codecs.rst:1101 ../../library/codecs.rst:1148 +#: ../../library/codecs.rst:1209 ../../library/codecs.rst:1259 msgid "Central and Eastern Europe" msgstr "" -#: ../../library/codecs.rst:1100 +#: ../../library/codecs.rst:1103 msgid "cp855" msgstr "cp855" -#: ../../library/codecs.rst:1100 +#: ../../library/codecs.rst:1103 msgid "855, IBM855" msgstr "855, IBM855" -#: ../../library/codecs.rst:1100 ../../library/codecs.rst:1147 -#: ../../library/codecs.rst:1212 ../../library/codecs.rst:1249 +#: ../../library/codecs.rst:1103 ../../library/codecs.rst:1150 +#: ../../library/codecs.rst:1215 ../../library/codecs.rst:1252 msgid "Bulgarian, Byelorussian, Macedonian, Russian, Serbian" msgstr "" -#: ../../library/codecs.rst:1103 +#: ../../library/codecs.rst:1106 msgid "cp856" msgstr "cp856" -#: ../../library/codecs.rst:1105 +#: ../../library/codecs.rst:1108 msgid "cp857" msgstr "cp857" -#: ../../library/codecs.rst:1105 +#: ../../library/codecs.rst:1108 msgid "857, IBM857" msgstr "857, IBM857" -#: ../../library/codecs.rst:1105 ../../library/codecs.rst:1137 -#: ../../library/codecs.rst:1154 ../../library/codecs.rst:1221 -#: ../../library/codecs.rst:1261 +#: ../../library/codecs.rst:1108 ../../library/codecs.rst:1140 +#: ../../library/codecs.rst:1157 ../../library/codecs.rst:1224 +#: ../../library/codecs.rst:1264 msgid "Turkish" msgstr "土耳其文" -#: ../../library/codecs.rst:1107 +#: ../../library/codecs.rst:1110 msgid "cp858" msgstr "cp858" -#: ../../library/codecs.rst:1107 +#: ../../library/codecs.rst:1110 msgid "858, IBM858" msgstr "858, IBM858" -#: ../../library/codecs.rst:1109 +#: ../../library/codecs.rst:1112 msgid "cp860" msgstr "cp860" -#: ../../library/codecs.rst:1109 +#: ../../library/codecs.rst:1112 msgid "860, IBM860" msgstr "860, IBM860" -#: ../../library/codecs.rst:1109 +#: ../../library/codecs.rst:1112 msgid "Portuguese" msgstr "" -#: ../../library/codecs.rst:1111 +#: ../../library/codecs.rst:1114 msgid "cp861" msgstr "cp861" -#: ../../library/codecs.rst:1111 +#: ../../library/codecs.rst:1114 msgid "861, CP-IS, IBM861" msgstr "861, CP-IS, IBM861" -#: ../../library/codecs.rst:1111 ../../library/codecs.rst:1254 +#: ../../library/codecs.rst:1114 ../../library/codecs.rst:1257 msgid "Icelandic" msgstr "" -#: ../../library/codecs.rst:1113 +#: ../../library/codecs.rst:1116 msgid "cp862" msgstr "cp862" -#: ../../library/codecs.rst:1113 +#: ../../library/codecs.rst:1116 msgid "862, IBM862" msgstr "862, IBM862" -#: ../../library/codecs.rst:1115 +#: ../../library/codecs.rst:1118 msgid "cp863" msgstr "cp863" -#: ../../library/codecs.rst:1115 +#: ../../library/codecs.rst:1118 msgid "863, IBM863" msgstr "863, IBM863" -#: ../../library/codecs.rst:1115 +#: ../../library/codecs.rst:1118 msgid "Canadian" msgstr "" -#: ../../library/codecs.rst:1117 +#: ../../library/codecs.rst:1120 msgid "cp864" msgstr "cp864" -#: ../../library/codecs.rst:1117 +#: ../../library/codecs.rst:1120 msgid "IBM864" msgstr "IBM864" -#: ../../library/codecs.rst:1119 +#: ../../library/codecs.rst:1122 msgid "cp865" msgstr "cp865" -#: ../../library/codecs.rst:1119 +#: ../../library/codecs.rst:1122 msgid "865, IBM865" msgstr "865, IBM865" -#: ../../library/codecs.rst:1119 +#: ../../library/codecs.rst:1122 msgid "Danish, Norwegian" msgstr "" -#: ../../library/codecs.rst:1121 +#: ../../library/codecs.rst:1124 msgid "cp866" msgstr "cp866" -#: ../../library/codecs.rst:1121 +#: ../../library/codecs.rst:1124 msgid "866, IBM866" msgstr "866, IBM866" -#: ../../library/codecs.rst:1121 ../../library/codecs.rst:1237 +#: ../../library/codecs.rst:1124 ../../library/codecs.rst:1240 msgid "Russian" msgstr "俄羅斯文" -#: ../../library/codecs.rst:1123 +#: ../../library/codecs.rst:1126 msgid "cp869" msgstr "cp869" -#: ../../library/codecs.rst:1123 +#: ../../library/codecs.rst:1126 msgid "869, CP-GR, IBM869" msgstr "869, CP-GR, IBM869" -#: ../../library/codecs.rst:1125 +#: ../../library/codecs.rst:1128 msgid "cp874" msgstr "cp874" -#: ../../library/codecs.rst:1125 +#: ../../library/codecs.rst:1128 msgid "Thai" msgstr "泰文" -#: ../../library/codecs.rst:1127 +#: ../../library/codecs.rst:1130 msgid "cp875" msgstr "cp875" -#: ../../library/codecs.rst:1129 +#: ../../library/codecs.rst:1132 msgid "cp932" msgstr "cp932" -#: ../../library/codecs.rst:1129 +#: ../../library/codecs.rst:1132 msgid "932, ms932, mskanji, ms-kanji" msgstr "932, ms932, mskanji, ms-kanji" -#: ../../library/codecs.rst:1129 ../../library/codecs.rst:1164 -#: ../../library/codecs.rst:1166 ../../library/codecs.rst:1168 -#: ../../library/codecs.rst:1185 ../../library/codecs.rst:1188 -#: ../../library/codecs.rst:1193 ../../library/codecs.rst:1196 -#: ../../library/codecs.rst:1198 ../../library/codecs.rst:1266 -#: ../../library/codecs.rst:1269 ../../library/codecs.rst:1272 +#: ../../library/codecs.rst:1132 ../../library/codecs.rst:1167 +#: ../../library/codecs.rst:1169 ../../library/codecs.rst:1171 +#: ../../library/codecs.rst:1188 ../../library/codecs.rst:1191 +#: ../../library/codecs.rst:1196 ../../library/codecs.rst:1199 +#: ../../library/codecs.rst:1201 ../../library/codecs.rst:1269 +#: ../../library/codecs.rst:1272 ../../library/codecs.rst:1275 msgid "Japanese" msgstr "日文" -#: ../../library/codecs.rst:1131 +#: ../../library/codecs.rst:1134 msgid "cp949" msgstr "cp949" -#: ../../library/codecs.rst:1131 +#: ../../library/codecs.rst:1134 msgid "949, ms949, uhc" msgstr "949, ms949, uhc" -#: ../../library/codecs.rst:1131 ../../library/codecs.rst:1170 -#: ../../library/codecs.rst:1200 ../../library/codecs.rst:1235 +#: ../../library/codecs.rst:1134 ../../library/codecs.rst:1173 +#: ../../library/codecs.rst:1203 ../../library/codecs.rst:1238 msgid "Korean" msgstr "韓文" -#: ../../library/codecs.rst:1133 +#: ../../library/codecs.rst:1136 msgid "cp950" msgstr "cp950" -#: ../../library/codecs.rst:1133 +#: ../../library/codecs.rst:1136 msgid "950, ms950" msgstr "950, ms950" -#: ../../library/codecs.rst:1135 +#: ../../library/codecs.rst:1138 msgid "cp1006" msgstr "cp1006" -#: ../../library/codecs.rst:1135 +#: ../../library/codecs.rst:1138 msgid "Urdu" msgstr "" -#: ../../library/codecs.rst:1137 +#: ../../library/codecs.rst:1140 msgid "cp1026" msgstr "cp1026" -#: ../../library/codecs.rst:1137 +#: ../../library/codecs.rst:1140 msgid "ibm1026" msgstr "ibm1026" -#: ../../library/codecs.rst:1139 +#: ../../library/codecs.rst:1142 msgid "cp1125" msgstr "cp1125" -#: ../../library/codecs.rst:1139 +#: ../../library/codecs.rst:1142 msgid "1125, ibm1125, cp866u, ruscii" msgstr "1125, ibm1125, cp866u, ruscii" -#: ../../library/codecs.rst:1139 ../../library/codecs.rst:1243 +#: ../../library/codecs.rst:1142 ../../library/codecs.rst:1246 msgid "Ukrainian" msgstr "烏克蘭文" -#: ../../library/codecs.rst:1143 +#: ../../library/codecs.rst:1146 msgid "cp1140" msgstr "cp1140" -#: ../../library/codecs.rst:1143 +#: ../../library/codecs.rst:1146 msgid "ibm1140" msgstr "ibm1140" -#: ../../library/codecs.rst:1145 +#: ../../library/codecs.rst:1148 msgid "cp1250" msgstr "cp1250" -#: ../../library/codecs.rst:1145 +#: ../../library/codecs.rst:1148 msgid "windows-1250" msgstr "windows-1250" -#: ../../library/codecs.rst:1147 +#: ../../library/codecs.rst:1150 msgid "cp1251" msgstr "cp1251" -#: ../../library/codecs.rst:1147 +#: ../../library/codecs.rst:1150 msgid "windows-1251" msgstr "windows-1251" -#: ../../library/codecs.rst:1150 +#: ../../library/codecs.rst:1153 msgid "cp1252" msgstr "cp1252" -#: ../../library/codecs.rst:1150 +#: ../../library/codecs.rst:1153 msgid "windows-1252" msgstr "windows-1252" -#: ../../library/codecs.rst:1152 +#: ../../library/codecs.rst:1155 msgid "cp1253" msgstr "cp1253" -#: ../../library/codecs.rst:1152 +#: ../../library/codecs.rst:1155 msgid "windows-1253" msgstr "windows-1253" -#: ../../library/codecs.rst:1154 +#: ../../library/codecs.rst:1157 msgid "cp1254" msgstr "cp1254" -#: ../../library/codecs.rst:1154 +#: ../../library/codecs.rst:1157 msgid "windows-1254" msgstr "windows-1254" -#: ../../library/codecs.rst:1156 +#: ../../library/codecs.rst:1159 msgid "cp1255" msgstr "cp1255" -#: ../../library/codecs.rst:1156 +#: ../../library/codecs.rst:1159 msgid "windows-1255" msgstr "windows-1255" -#: ../../library/codecs.rst:1158 +#: ../../library/codecs.rst:1161 msgid "cp1256" msgstr "cp1256" -#: ../../library/codecs.rst:1158 +#: ../../library/codecs.rst:1161 msgid "windows-1256" msgstr "windows-1256" -#: ../../library/codecs.rst:1160 +#: ../../library/codecs.rst:1163 msgid "cp1257" msgstr "cp1257" -#: ../../library/codecs.rst:1160 +#: ../../library/codecs.rst:1163 msgid "windows-1257" msgstr "windows-1257" -#: ../../library/codecs.rst:1162 +#: ../../library/codecs.rst:1165 msgid "cp1258" msgstr "cp1258" -#: ../../library/codecs.rst:1162 +#: ../../library/codecs.rst:1165 msgid "windows-1258" msgstr "windows-1258" -#: ../../library/codecs.rst:1162 +#: ../../library/codecs.rst:1165 msgid "Vietnamese" msgstr "越南文" -#: ../../library/codecs.rst:1164 +#: ../../library/codecs.rst:1167 msgid "euc_jp" msgstr "euc_jp" -#: ../../library/codecs.rst:1164 +#: ../../library/codecs.rst:1167 msgid "eucjp, ujis, u-jis" msgstr "eucjp, ujis, u-jis" -#: ../../library/codecs.rst:1166 +#: ../../library/codecs.rst:1169 msgid "euc_jis_2004" msgstr "euc_jis_2004" -#: ../../library/codecs.rst:1166 +#: ../../library/codecs.rst:1169 msgid "jisx0213, eucjis2004" msgstr "jisx0213, eucjis2004" -#: ../../library/codecs.rst:1168 +#: ../../library/codecs.rst:1171 msgid "euc_jisx0213" msgstr "euc_jisx0213" -#: ../../library/codecs.rst:1168 +#: ../../library/codecs.rst:1171 msgid "eucjisx0213" msgstr "eucjisx0213" -#: ../../library/codecs.rst:1170 +#: ../../library/codecs.rst:1173 msgid "euc_kr" msgstr "euc_kr" -#: ../../library/codecs.rst:1170 +#: ../../library/codecs.rst:1173 msgid "euckr, korean, ksc5601, ks_c-5601, ks_c-5601-1987, ksx1001, ks_x-1001" msgstr "euckr, korean, ksc5601, ks_c-5601, ks_c-5601-1987, ksx1001, ks_x-1001" -#: ../../library/codecs.rst:1174 +#: ../../library/codecs.rst:1177 msgid "gb2312" msgstr "gb2312" -#: ../../library/codecs.rst:1174 +#: ../../library/codecs.rst:1177 msgid "" "chinese, csiso58gb231280, euc-cn, euccn, eucgb2312-cn, gb2312-1980, " "gb2312-80, iso-ir-58" @@ -1856,446 +1856,446 @@ msgstr "" "chinese, csiso58gb231280, euc-cn, euccn, eucgb2312-cn, gb2312-1980, " "gb2312-80, iso-ir-58" -#: ../../library/codecs.rst:1174 ../../library/codecs.rst:1183 +#: ../../library/codecs.rst:1177 ../../library/codecs.rst:1186 msgid "Simplified Chinese" msgstr "簡體中文" -#: ../../library/codecs.rst:1179 +#: ../../library/codecs.rst:1182 msgid "gbk" msgstr "gbk" -#: ../../library/codecs.rst:1179 +#: ../../library/codecs.rst:1182 msgid "936, cp936, ms936" msgstr "936, cp936, ms936" -#: ../../library/codecs.rst:1179 ../../library/codecs.rst:1181 +#: ../../library/codecs.rst:1182 ../../library/codecs.rst:1184 msgid "Unified Chinese" msgstr "" -#: ../../library/codecs.rst:1181 +#: ../../library/codecs.rst:1184 msgid "gb18030" msgstr "gb18030" -#: ../../library/codecs.rst:1181 +#: ../../library/codecs.rst:1184 msgid "gb18030-2000" msgstr "gb18030-2000" -#: ../../library/codecs.rst:1183 +#: ../../library/codecs.rst:1186 msgid "hz" msgstr "" -#: ../../library/codecs.rst:1183 +#: ../../library/codecs.rst:1186 msgid "hzgb, hz-gb, hz-gb-2312" msgstr "hzgb, hz-gb, hz-gb-2312" -#: ../../library/codecs.rst:1185 +#: ../../library/codecs.rst:1188 msgid "iso2022_jp" msgstr "iso2022_jp" -#: ../../library/codecs.rst:1185 +#: ../../library/codecs.rst:1188 msgid "csiso2022jp, iso2022jp, iso-2022-jp" msgstr "csiso2022jp, iso2022jp, iso-2022-jp" -#: ../../library/codecs.rst:1188 +#: ../../library/codecs.rst:1191 msgid "iso2022_jp_1" msgstr "iso2022_jp_1" -#: ../../library/codecs.rst:1188 +#: ../../library/codecs.rst:1191 msgid "iso2022jp-1, iso-2022-jp-1" msgstr "iso2022jp-1, iso-2022-jp-1" -#: ../../library/codecs.rst:1190 +#: ../../library/codecs.rst:1193 msgid "iso2022_jp_2" msgstr "iso2022_jp_2" -#: ../../library/codecs.rst:1190 +#: ../../library/codecs.rst:1193 msgid "iso2022jp-2, iso-2022-jp-2" msgstr "iso2022jp-2, iso-2022-jp-2" -#: ../../library/codecs.rst:1190 +#: ../../library/codecs.rst:1193 msgid "Japanese, Korean, Simplified Chinese, Western Europe, Greek" msgstr "" -#: ../../library/codecs.rst:1193 +#: ../../library/codecs.rst:1196 msgid "iso2022_jp_2004" msgstr "iso2022_jp_2004" -#: ../../library/codecs.rst:1193 +#: ../../library/codecs.rst:1196 msgid "iso2022jp-2004, iso-2022-jp-2004" msgstr "iso2022jp-2004, iso-2022-jp-2004" -#: ../../library/codecs.rst:1196 +#: ../../library/codecs.rst:1199 msgid "iso2022_jp_3" msgstr "iso2022_jp_3" -#: ../../library/codecs.rst:1196 +#: ../../library/codecs.rst:1199 msgid "iso2022jp-3, iso-2022-jp-3" msgstr "iso2022jp-3, iso-2022-jp-3" -#: ../../library/codecs.rst:1198 +#: ../../library/codecs.rst:1201 msgid "iso2022_jp_ext" msgstr "iso2022_jp_ext" -#: ../../library/codecs.rst:1198 +#: ../../library/codecs.rst:1201 msgid "iso2022jp-ext, iso-2022-jp-ext" msgstr "iso2022jp-ext, iso-2022-jp-ext" -#: ../../library/codecs.rst:1200 +#: ../../library/codecs.rst:1203 msgid "iso2022_kr" msgstr "iso2022_kr" -#: ../../library/codecs.rst:1200 +#: ../../library/codecs.rst:1203 msgid "csiso2022kr, iso2022kr, iso-2022-kr" msgstr "csiso2022kr, iso2022kr, iso-2022-kr" -#: ../../library/codecs.rst:1203 +#: ../../library/codecs.rst:1206 msgid "latin_1" msgstr "latin_1" -#: ../../library/codecs.rst:1203 +#: ../../library/codecs.rst:1206 msgid "iso-8859-1, iso8859-1, 8859, cp819, latin, latin1, L1" msgstr "iso-8859-1, iso8859-1, 8859, cp819, latin, latin1, L1" -#: ../../library/codecs.rst:1206 +#: ../../library/codecs.rst:1209 msgid "iso8859_2" msgstr "iso8859_2" -#: ../../library/codecs.rst:1206 +#: ../../library/codecs.rst:1209 msgid "iso-8859-2, latin2, L2" msgstr "iso-8859-2, latin2, L2" -#: ../../library/codecs.rst:1208 +#: ../../library/codecs.rst:1211 msgid "iso8859_3" msgstr "iso8859_3" -#: ../../library/codecs.rst:1208 +#: ../../library/codecs.rst:1211 msgid "iso-8859-3, latin3, L3" msgstr "iso-8859-3, latin3, L3" -#: ../../library/codecs.rst:1208 +#: ../../library/codecs.rst:1211 msgid "Esperanto, Maltese" msgstr "" -#: ../../library/codecs.rst:1210 +#: ../../library/codecs.rst:1213 msgid "iso8859_4" msgstr "iso8859_4" -#: ../../library/codecs.rst:1210 +#: ../../library/codecs.rst:1213 msgid "iso-8859-4, latin4, L4" msgstr "iso-8859-4, latin4, L4" -#: ../../library/codecs.rst:1212 +#: ../../library/codecs.rst:1215 msgid "iso8859_5" msgstr "iso8859_5" -#: ../../library/codecs.rst:1212 +#: ../../library/codecs.rst:1215 msgid "iso-8859-5, cyrillic" msgstr "iso-8859-5, cyrillic" -#: ../../library/codecs.rst:1215 +#: ../../library/codecs.rst:1218 msgid "iso8859_6" msgstr "iso8859_6" -#: ../../library/codecs.rst:1215 +#: ../../library/codecs.rst:1218 msgid "iso-8859-6, arabic" msgstr "iso-8859-6, arabic" -#: ../../library/codecs.rst:1217 +#: ../../library/codecs.rst:1220 msgid "iso8859_7" msgstr "iso8859_7" -#: ../../library/codecs.rst:1217 +#: ../../library/codecs.rst:1220 msgid "iso-8859-7, greek, greek8" msgstr "iso-8859-7, greek, greek8" -#: ../../library/codecs.rst:1219 +#: ../../library/codecs.rst:1222 msgid "iso8859_8" msgstr "iso8859_8" -#: ../../library/codecs.rst:1219 +#: ../../library/codecs.rst:1222 msgid "iso-8859-8, hebrew" msgstr "iso-8859-8, hebrew" -#: ../../library/codecs.rst:1221 +#: ../../library/codecs.rst:1224 msgid "iso8859_9" msgstr "iso8859_9" -#: ../../library/codecs.rst:1221 +#: ../../library/codecs.rst:1224 msgid "iso-8859-9, latin5, L5" msgstr "iso-8859-9, latin5, L5" -#: ../../library/codecs.rst:1223 +#: ../../library/codecs.rst:1226 msgid "iso8859_10" msgstr "iso8859_10" -#: ../../library/codecs.rst:1223 +#: ../../library/codecs.rst:1226 msgid "iso-8859-10, latin6, L6" msgstr "iso-8859-10, latin6, L6" -#: ../../library/codecs.rst:1223 +#: ../../library/codecs.rst:1226 msgid "Nordic languages" msgstr "" -#: ../../library/codecs.rst:1225 +#: ../../library/codecs.rst:1228 msgid "iso8859_11" msgstr "iso8859_11" -#: ../../library/codecs.rst:1225 +#: ../../library/codecs.rst:1228 msgid "iso-8859-11, thai" msgstr "iso-8859-11, thai" -#: ../../library/codecs.rst:1225 +#: ../../library/codecs.rst:1228 msgid "Thai languages" msgstr "" -#: ../../library/codecs.rst:1227 +#: ../../library/codecs.rst:1230 msgid "iso8859_13" msgstr "iso8859_13" -#: ../../library/codecs.rst:1227 +#: ../../library/codecs.rst:1230 msgid "iso-8859-13, latin7, L7" msgstr "iso-8859-13, latin7, L7" -#: ../../library/codecs.rst:1229 +#: ../../library/codecs.rst:1232 msgid "iso8859_14" msgstr "iso8859_14" -#: ../../library/codecs.rst:1229 +#: ../../library/codecs.rst:1232 msgid "iso-8859-14, latin8, L8" msgstr "iso-8859-14, latin8, L8" -#: ../../library/codecs.rst:1229 +#: ../../library/codecs.rst:1232 msgid "Celtic languages" msgstr "" -#: ../../library/codecs.rst:1231 +#: ../../library/codecs.rst:1234 msgid "iso8859_15" msgstr "iso8859_15" -#: ../../library/codecs.rst:1231 +#: ../../library/codecs.rst:1234 msgid "iso-8859-15, latin9, L9" msgstr "iso-8859-15, latin9, L9" -#: ../../library/codecs.rst:1233 +#: ../../library/codecs.rst:1236 msgid "iso8859_16" msgstr "iso8859_16" -#: ../../library/codecs.rst:1233 +#: ../../library/codecs.rst:1236 msgid "iso-8859-16, latin10, L10" msgstr "iso-8859-16, latin10, L10" -#: ../../library/codecs.rst:1233 +#: ../../library/codecs.rst:1236 msgid "South-Eastern Europe" msgstr "" -#: ../../library/codecs.rst:1235 +#: ../../library/codecs.rst:1238 msgid "johab" msgstr "" -#: ../../library/codecs.rst:1235 +#: ../../library/codecs.rst:1238 msgid "cp1361, ms1361" msgstr "cp1361, ms1361" -#: ../../library/codecs.rst:1237 +#: ../../library/codecs.rst:1240 msgid "koi8_r" msgstr "koi8_r" -#: ../../library/codecs.rst:1239 +#: ../../library/codecs.rst:1242 msgid "koi8_t" msgstr "koi8_t" -#: ../../library/codecs.rst:1239 +#: ../../library/codecs.rst:1242 msgid "Tajik" msgstr "" -#: ../../library/codecs.rst:1243 +#: ../../library/codecs.rst:1246 msgid "koi8_u" msgstr "koi8_u" -#: ../../library/codecs.rst:1245 +#: ../../library/codecs.rst:1248 msgid "kz1048" msgstr "kz1048" -#: ../../library/codecs.rst:1245 +#: ../../library/codecs.rst:1248 msgid "kz_1048, strk1048_2002, rk1048" msgstr "kz_1048, strk1048_2002, rk1048" -#: ../../library/codecs.rst:1245 ../../library/codecs.rst:1263 +#: ../../library/codecs.rst:1248 ../../library/codecs.rst:1266 msgid "Kazakh" msgstr "" -#: ../../library/codecs.rst:1249 +#: ../../library/codecs.rst:1252 msgid "mac_cyrillic" msgstr "mac_cyrillic" -#: ../../library/codecs.rst:1249 +#: ../../library/codecs.rst:1252 msgid "maccyrillic" msgstr "" -#: ../../library/codecs.rst:1252 +#: ../../library/codecs.rst:1255 msgid "mac_greek" msgstr "mac_greek" -#: ../../library/codecs.rst:1252 +#: ../../library/codecs.rst:1255 msgid "macgreek" msgstr "" -#: ../../library/codecs.rst:1254 +#: ../../library/codecs.rst:1257 msgid "mac_iceland" msgstr "mac_iceland" -#: ../../library/codecs.rst:1254 +#: ../../library/codecs.rst:1257 msgid "maciceland" msgstr "" -#: ../../library/codecs.rst:1256 +#: ../../library/codecs.rst:1259 msgid "mac_latin2" msgstr "mac_latin2" -#: ../../library/codecs.rst:1256 +#: ../../library/codecs.rst:1259 msgid "maclatin2, maccentraleurope, mac_centeuro" msgstr "maclatin2, maccentraleurope, mac_centeuro" -#: ../../library/codecs.rst:1259 +#: ../../library/codecs.rst:1262 msgid "mac_roman" msgstr "mac_roman" -#: ../../library/codecs.rst:1259 +#: ../../library/codecs.rst:1262 msgid "macroman, macintosh" msgstr "macroman, macintosh" -#: ../../library/codecs.rst:1261 +#: ../../library/codecs.rst:1264 msgid "mac_turkish" msgstr "mac_turkish" -#: ../../library/codecs.rst:1261 +#: ../../library/codecs.rst:1264 msgid "macturkish" msgstr "" -#: ../../library/codecs.rst:1263 +#: ../../library/codecs.rst:1266 msgid "ptcp154" msgstr "ptcp154" -#: ../../library/codecs.rst:1263 +#: ../../library/codecs.rst:1266 msgid "csptcp154, pt154, cp154, cyrillic-asian" msgstr "csptcp154, pt154, cp154, cyrillic-asian" -#: ../../library/codecs.rst:1266 +#: ../../library/codecs.rst:1269 msgid "shift_jis" msgstr "shift_jis" -#: ../../library/codecs.rst:1266 +#: ../../library/codecs.rst:1269 msgid "csshiftjis, shiftjis, sjis, s_jis" msgstr "csshiftjis, shiftjis, sjis, s_jis" -#: ../../library/codecs.rst:1269 +#: ../../library/codecs.rst:1272 msgid "shift_jis_2004" msgstr "shift_jis_2004" -#: ../../library/codecs.rst:1269 +#: ../../library/codecs.rst:1272 msgid "shiftjis2004, sjis_2004, sjis2004" msgstr "shiftjis2004, sjis_2004, sjis2004" -#: ../../library/codecs.rst:1272 +#: ../../library/codecs.rst:1275 msgid "shift_jisx0213" msgstr "shift_jisx0213" -#: ../../library/codecs.rst:1272 +#: ../../library/codecs.rst:1275 msgid "shiftjisx0213, sjisx0213, s_jisx0213" msgstr "shiftjisx0213, sjisx0213, s_jisx0213" -#: ../../library/codecs.rst:1275 +#: ../../library/codecs.rst:1278 msgid "utf_32" msgstr "utf_32" -#: ../../library/codecs.rst:1275 +#: ../../library/codecs.rst:1278 msgid "U32, utf32" msgstr "U32, utf32" -#: ../../library/codecs.rst:1275 ../../library/codecs.rst:1277 -#: ../../library/codecs.rst:1279 ../../library/codecs.rst:1281 -#: ../../library/codecs.rst:1283 ../../library/codecs.rst:1285 -#: ../../library/codecs.rst:1287 ../../library/codecs.rst:1289 -#: ../../library/codecs.rst:1291 +#: ../../library/codecs.rst:1278 ../../library/codecs.rst:1280 +#: ../../library/codecs.rst:1282 ../../library/codecs.rst:1284 +#: ../../library/codecs.rst:1286 ../../library/codecs.rst:1288 +#: ../../library/codecs.rst:1290 ../../library/codecs.rst:1292 +#: ../../library/codecs.rst:1294 msgid "all languages" msgstr "" -#: ../../library/codecs.rst:1277 +#: ../../library/codecs.rst:1280 msgid "utf_32_be" msgstr "utf_32_be" -#: ../../library/codecs.rst:1277 +#: ../../library/codecs.rst:1280 msgid "UTF-32BE" msgstr "UTF-32BE" -#: ../../library/codecs.rst:1279 +#: ../../library/codecs.rst:1282 msgid "utf_32_le" msgstr "utf_32_le" -#: ../../library/codecs.rst:1279 +#: ../../library/codecs.rst:1282 msgid "UTF-32LE" msgstr "UTF-32LE" -#: ../../library/codecs.rst:1281 +#: ../../library/codecs.rst:1284 msgid "utf_16" msgstr "utf_16" -#: ../../library/codecs.rst:1281 +#: ../../library/codecs.rst:1284 msgid "U16, utf16" msgstr "U16, utf16" -#: ../../library/codecs.rst:1283 +#: ../../library/codecs.rst:1286 msgid "utf_16_be" msgstr "utf_16_be" -#: ../../library/codecs.rst:1283 +#: ../../library/codecs.rst:1286 msgid "UTF-16BE" msgstr "UTF-16BE" -#: ../../library/codecs.rst:1285 +#: ../../library/codecs.rst:1288 msgid "utf_16_le" msgstr "utf_16_le" -#: ../../library/codecs.rst:1285 +#: ../../library/codecs.rst:1288 msgid "UTF-16LE" msgstr "UTF-16LE" -#: ../../library/codecs.rst:1287 +#: ../../library/codecs.rst:1290 msgid "utf_7" msgstr "utf_7" -#: ../../library/codecs.rst:1287 +#: ../../library/codecs.rst:1290 msgid "U7, unicode-1-1-utf-7" msgstr "U7, unicode-1-1-utf-7" -#: ../../library/codecs.rst:1289 +#: ../../library/codecs.rst:1292 msgid "utf_8" msgstr "utf_8" -#: ../../library/codecs.rst:1289 +#: ../../library/codecs.rst:1292 msgid "U8, UTF, utf8, cp65001" msgstr "U8, UTF, utf8, cp65001" -#: ../../library/codecs.rst:1291 +#: ../../library/codecs.rst:1294 msgid "utf_8_sig" msgstr "utf_8_sig" -#: ../../library/codecs.rst:1294 +#: ../../library/codecs.rst:1297 msgid "" "The utf-16\\* and utf-32\\* encoders no longer allow surrogate code points " "(``U+D800``--``U+DFFF``) to be encoded. The utf-32\\* decoders no longer " "decode byte sequences that correspond to surrogate code points." msgstr "" -#: ../../library/codecs.rst:1300 +#: ../../library/codecs.rst:1303 msgid "``cp65001`` is now an alias to ``utf_8``." msgstr "" -#: ../../library/codecs.rst:1305 +#: ../../library/codecs.rst:1308 msgid "Python Specific Encodings" msgstr "" -#: ../../library/codecs.rst:1307 +#: ../../library/codecs.rst:1310 msgid "" "A number of predefined codecs are specific to Python, so their codec names " "have no meaning outside Python. These are listed in the tables below based " @@ -2305,272 +2305,272 @@ msgid "" "asymmetric codecs, the stated meaning describes the encoding direction." msgstr "" -#: ../../library/codecs.rst:1315 +#: ../../library/codecs.rst:1318 msgid "Text Encodings" msgstr "" -#: ../../library/codecs.rst:1317 +#: ../../library/codecs.rst:1320 msgid "" "The following codecs provide :class:`str` to :class:`bytes` encoding and :" "term:`bytes-like object` to :class:`str` decoding, similar to the Unicode " "text encodings." msgstr "" -#: ../../library/codecs.rst:1326 +#: ../../library/codecs.rst:1329 msgid "idna" msgstr "idna" -#: ../../library/codecs.rst:1326 +#: ../../library/codecs.rst:1329 msgid "" "Implement :rfc:`3490`, see also :mod:`encodings.idna`. Only " "``errors='strict'`` is supported." msgstr "" -#: ../../library/codecs.rst:1332 +#: ../../library/codecs.rst:1335 msgid "mbcs" msgstr "mbcs" -#: ../../library/codecs.rst:1332 +#: ../../library/codecs.rst:1335 msgid "ansi, dbcs" msgstr "ansi, dbcs" -#: ../../library/codecs.rst:1332 +#: ../../library/codecs.rst:1335 msgid "" "Windows only: Encode the operand according to the ANSI codepage (CP_ACP)." msgstr "" -#: ../../library/codecs.rst:1336 +#: ../../library/codecs.rst:1339 msgid "oem" msgstr "oem" -#: ../../library/codecs.rst:1336 +#: ../../library/codecs.rst:1339 msgid "" "Windows only: Encode the operand according to the OEM codepage (CP_OEMCP)." msgstr "" -#: ../../library/codecs.rst:1342 +#: ../../library/codecs.rst:1345 msgid "palmos" msgstr "" -#: ../../library/codecs.rst:1342 +#: ../../library/codecs.rst:1345 msgid "Encoding of PalmOS 3.5." msgstr "" -#: ../../library/codecs.rst:1344 +#: ../../library/codecs.rst:1347 msgid "punycode" msgstr "" -#: ../../library/codecs.rst:1344 +#: ../../library/codecs.rst:1347 msgid "Implement :rfc:`3492`. Stateful codecs are not supported." msgstr "" -#: ../../library/codecs.rst:1348 +#: ../../library/codecs.rst:1351 msgid "raw_unicode_escape" msgstr "raw_unicode_escape" -#: ../../library/codecs.rst:1348 +#: ../../library/codecs.rst:1351 msgid "" -"Latin-1 encoding with ``\\uXXXX`` and ``\\UXXXXXXXX`` for other code points. " -"Existing backslashes are not escaped in any way. It is used in the Python " -"pickle protocol." +"Latin-1 encoding with :samp:`\\\\u{XXXX}` and :samp:`\\\\U{XXXXXXXX}` for " +"other code points. Existing backslashes are not escaped in any way. It is " +"used in the Python pickle protocol." msgstr "" -#: ../../library/codecs.rst:1357 +#: ../../library/codecs.rst:1361 msgid "undefined" msgstr "" -#: ../../library/codecs.rst:1357 +#: ../../library/codecs.rst:1361 msgid "" "Raise an exception for all conversions, even empty strings. The error " "handler is ignored." msgstr "" -#: ../../library/codecs.rst:1362 +#: ../../library/codecs.rst:1366 msgid "unicode_escape" msgstr "unicode_escape" -#: ../../library/codecs.rst:1362 +#: ../../library/codecs.rst:1366 msgid "" "Encoding suitable as the contents of a Unicode literal in ASCII-encoded " "Python source code, except that quotes are not escaped. Decode from Latin-1 " "source code. Beware that Python source code actually uses UTF-8 by default." msgstr "" -#: ../../library/codecs.rst:1374 +#: ../../library/codecs.rst:1378 msgid "\"unicode_internal\" codec is removed." msgstr "" -#: ../../library/codecs.rst:1381 +#: ../../library/codecs.rst:1385 msgid "Binary Transforms" msgstr "" -#: ../../library/codecs.rst:1383 +#: ../../library/codecs.rst:1387 msgid "" "The following codecs provide binary transforms: :term:`bytes-like object` " "to :class:`bytes` mappings. They are not supported by :meth:`bytes.decode` " "(which only produces :class:`str` output)." msgstr "" -#: ../../library/codecs.rst:1391 +#: ../../library/codecs.rst:1395 msgid "Encoder / decoder" msgstr "" -#: ../../library/codecs.rst:1393 +#: ../../library/codecs.rst:1397 msgid "base64_codec [#b64]_" msgstr "base64_codec [#b64]_" -#: ../../library/codecs.rst:1393 +#: ../../library/codecs.rst:1397 msgid "base64, base_64" msgstr "base64, base_64" -#: ../../library/codecs.rst:1393 +#: ../../library/codecs.rst:1397 msgid "" "Convert the operand to multiline MIME base64 (the result always includes a " "trailing ``'\\n'``)." msgstr "" -#: ../../library/codecs.rst:1398 +#: ../../library/codecs.rst:1402 msgid "" "accepts any :term:`bytes-like object` as input for encoding and decoding" msgstr "" -#: ../../library/codecs.rst:1393 +#: ../../library/codecs.rst:1397 msgid ":meth:`base64.encodebytes` / :meth:`base64.decodebytes`" msgstr ":meth:`base64.encodebytes` / :meth:`base64.decodebytes`" -#: ../../library/codecs.rst:1404 +#: ../../library/codecs.rst:1408 msgid "bz2_codec" msgstr "bz2_codec" -#: ../../library/codecs.rst:1404 +#: ../../library/codecs.rst:1408 msgid "bz2" msgstr "bz2" -#: ../../library/codecs.rst:1404 +#: ../../library/codecs.rst:1408 msgid "Compress the operand using bz2." msgstr "" -#: ../../library/codecs.rst:1404 +#: ../../library/codecs.rst:1408 msgid ":meth:`bz2.compress` / :meth:`bz2.decompress`" msgstr ":meth:`bz2.compress` / :meth:`bz2.decompress`" -#: ../../library/codecs.rst:1407 +#: ../../library/codecs.rst:1411 msgid "hex_codec" msgstr "hex_codec" -#: ../../library/codecs.rst:1407 +#: ../../library/codecs.rst:1411 msgid "hex" msgstr "hex" -#: ../../library/codecs.rst:1407 +#: ../../library/codecs.rst:1411 msgid "" "Convert the operand to hexadecimal representation, with two digits per byte." msgstr "" -#: ../../library/codecs.rst:1407 +#: ../../library/codecs.rst:1411 msgid ":meth:`binascii.b2a_hex` / :meth:`binascii.a2b_hex`" msgstr ":meth:`binascii.b2a_hex` / :meth:`binascii.a2b_hex`" -#: ../../library/codecs.rst:1412 +#: ../../library/codecs.rst:1416 msgid "quopri_codec" msgstr "quopri_codec" -#: ../../library/codecs.rst:1412 +#: ../../library/codecs.rst:1416 msgid "quopri, quotedprintable, quoted_printable" msgstr "quopri, quotedprintable, quoted_printable" -#: ../../library/codecs.rst:1412 +#: ../../library/codecs.rst:1416 msgid "Convert the operand to MIME quoted printable." msgstr "" -#: ../../library/codecs.rst:1412 +#: ../../library/codecs.rst:1416 msgid ":meth:`quopri.encode` with ``quotetabs=True`` / :meth:`quopri.decode`" msgstr ":meth:`quopri.encode` with ``quotetabs=True`` / :meth:`quopri.decode`" -#: ../../library/codecs.rst:1416 +#: ../../library/codecs.rst:1420 msgid "uu_codec" msgstr "uu_codec" -#: ../../library/codecs.rst:1416 +#: ../../library/codecs.rst:1420 msgid "uu" msgstr "uu" -#: ../../library/codecs.rst:1416 +#: ../../library/codecs.rst:1420 msgid "Convert the operand using uuencode." msgstr "" -#: ../../library/codecs.rst:1416 +#: ../../library/codecs.rst:1420 msgid ":meth:`uu.encode` / :meth:`uu.decode`" msgstr ":meth:`uu.encode` / :meth:`uu.decode`" -#: ../../library/codecs.rst:1419 +#: ../../library/codecs.rst:1423 msgid "zlib_codec" msgstr "zlib_codec" -#: ../../library/codecs.rst:1419 +#: ../../library/codecs.rst:1423 msgid "zip, zlib" msgstr "zip, zlib" -#: ../../library/codecs.rst:1419 +#: ../../library/codecs.rst:1423 msgid "Compress the operand using gzip." msgstr "" -#: ../../library/codecs.rst:1419 +#: ../../library/codecs.rst:1423 msgid ":meth:`zlib.compress` / :meth:`zlib.decompress`" msgstr ":meth:`zlib.compress` / :meth:`zlib.decompress`" -#: ../../library/codecs.rst:1423 +#: ../../library/codecs.rst:1427 msgid "" "In addition to :term:`bytes-like objects `, " "``'base64_codec'`` also accepts ASCII-only instances of :class:`str` for " "decoding" msgstr "" -#: ../../library/codecs.rst:1427 +#: ../../library/codecs.rst:1431 msgid "Restoration of the binary transforms." msgstr "" -#: ../../library/codecs.rst:1430 +#: ../../library/codecs.rst:1434 msgid "Restoration of the aliases for the binary transforms." msgstr "" -#: ../../library/codecs.rst:1437 +#: ../../library/codecs.rst:1441 msgid "Text Transforms" msgstr "" -#: ../../library/codecs.rst:1439 +#: ../../library/codecs.rst:1443 msgid "" "The following codec provides a text transform: a :class:`str` to :class:" "`str` mapping. It is not supported by :meth:`str.encode` (which only " "produces :class:`bytes` output)." msgstr "" -#: ../../library/codecs.rst:1448 +#: ../../library/codecs.rst:1452 msgid "rot_13" msgstr "rot_13" -#: ../../library/codecs.rst:1448 +#: ../../library/codecs.rst:1452 msgid "rot13" msgstr "" -#: ../../library/codecs.rst:1448 +#: ../../library/codecs.rst:1452 msgid "Return the Caesar-cypher encryption of the operand." msgstr "" -#: ../../library/codecs.rst:1453 +#: ../../library/codecs.rst:1457 msgid "Restoration of the ``rot_13`` text transform." msgstr "" -#: ../../library/codecs.rst:1456 +#: ../../library/codecs.rst:1460 msgid "Restoration of the ``rot13`` alias." msgstr "" -#: ../../library/codecs.rst:1461 +#: ../../library/codecs.rst:1465 msgid "" ":mod:`encodings.idna` --- Internationalized Domain Names in Applications" msgstr "" -#: ../../library/codecs.rst:1467 +#: ../../library/codecs.rst:1471 msgid "" "This module implements :rfc:`3490` (Internationalized Domain Names in " "Applications) and :rfc:`3492` (Nameprep: A Stringprep Profile for " @@ -2578,13 +2578,13 @@ msgid "" "encoding and :mod:`stringprep`." msgstr "" -#: ../../library/codecs.rst:1472 +#: ../../library/codecs.rst:1476 msgid "" "If you need the IDNA 2008 standard from :rfc:`5891` and :rfc:`5895`, use the " "third-party `idna module `_." msgstr "" -#: ../../library/codecs.rst:1475 +#: ../../library/codecs.rst:1479 msgid "" "These RFCs together define a protocol to support non-ASCII characters in " "domain names. A domain name containing non-ASCII characters (such as ``www." @@ -2598,7 +2598,7 @@ msgid "" "presenting them to the user." msgstr "" -#: ../../library/codecs.rst:1486 +#: ../../library/codecs.rst:1490 msgid "" "Python supports this conversion in several ways: the ``idna`` codec " "performs conversion between Unicode and ACE, separating an input string into " @@ -2615,14 +2615,14 @@ msgid "" "sends that field at all)." msgstr "" -#: ../../library/codecs.rst:1499 +#: ../../library/codecs.rst:1503 msgid "" "When receiving host names from the wire (such as in reverse name lookup), no " "automatic conversion to Unicode is performed: applications wishing to " "present such host names to the user should decode them to Unicode." msgstr "" -#: ../../library/codecs.rst:1503 +#: ../../library/codecs.rst:1507 msgid "" "The module :mod:`encodings.idna` also implements the nameprep procedure, " "which performs certain normalizations on host names, to achieve case-" @@ -2630,49 +2630,49 @@ msgid "" "characters. The nameprep functions can be used directly if desired." msgstr "" -#: ../../library/codecs.rst:1511 +#: ../../library/codecs.rst:1515 msgid "" "Return the nameprepped version of *label*. The implementation currently " "assumes query strings, so ``AllowUnassigned`` is true." msgstr "" -#: ../../library/codecs.rst:1517 +#: ../../library/codecs.rst:1521 msgid "" "Convert a label to ASCII, as specified in :rfc:`3490`. ``UseSTD3ASCIIRules`` " "is assumed to be false." msgstr "" -#: ../../library/codecs.rst:1523 +#: ../../library/codecs.rst:1527 msgid "Convert a label to Unicode, as specified in :rfc:`3490`." msgstr "" -#: ../../library/codecs.rst:1527 +#: ../../library/codecs.rst:1531 msgid ":mod:`encodings.mbcs` --- Windows ANSI codepage" msgstr "" -#: ../../library/codecs.rst:1532 +#: ../../library/codecs.rst:1536 msgid "This module implements the ANSI codepage (CP_ACP)." msgstr "" -#: ../../library/codecs.rst:1534 +#: ../../library/codecs.rst:1538 msgid ":ref:`Availability `: Windows." msgstr ":ref:`適用 `:Windows。" -#: ../../library/codecs.rst:1536 +#: ../../library/codecs.rst:1540 msgid "Support any error handler." msgstr "" -#: ../../library/codecs.rst:1539 +#: ../../library/codecs.rst:1543 msgid "" "Before 3.2, the *errors* argument was ignored; ``'replace'`` was always used " "to encode, and ``'ignore'`` to decode." msgstr "" -#: ../../library/codecs.rst:1545 +#: ../../library/codecs.rst:1549 msgid ":mod:`encodings.utf_8_sig` --- UTF-8 codec with BOM signature" msgstr "" -#: ../../library/codecs.rst:1551 +#: ../../library/codecs.rst:1555 msgid "" "This module implements a variant of the UTF-8 codec. On encoding, a UTF-8 " "encoded BOM will be prepended to the UTF-8 encoded bytes. For the stateful " @@ -2705,8 +2705,8 @@ msgstr "stackable(可堆疊)" msgid "strict" msgstr "strict" -#: ../../library/codecs.rst:312 ../../library/codecs.rst:363 -#: ../../library/codecs.rst:385 +#: ../../library/codecs.rst:312 ../../library/codecs.rst:364 +#: ../../library/codecs.rst:387 msgid "error handler's name" msgstr "error handler's name(錯誤處理器名稱)" @@ -2738,7 +2738,7 @@ msgstr "replacement character(替代字元)" msgid "\\ (backslash)" msgstr "\\ (反斜線)" -#: ../../library/codecs.rst:312 ../../library/codecs.rst:363 +#: ../../library/codecs.rst:312 ../../library/codecs.rst:364 msgid "escape sequence" msgstr "escape sequence(跳脫序列)" @@ -2754,18 +2754,18 @@ msgstr "\\u" msgid "\\U" msgstr "\\U" -#: ../../library/codecs.rst:363 +#: ../../library/codecs.rst:364 msgid "xmlcharrefreplace" msgstr "xmlcharrefreplace" -#: ../../library/codecs.rst:363 +#: ../../library/codecs.rst:364 msgid "namereplace" msgstr "namereplace" -#: ../../library/codecs.rst:363 +#: ../../library/codecs.rst:364 msgid "\\N" msgstr "\\N" -#: ../../library/codecs.rst:385 +#: ../../library/codecs.rst:387 msgid "surrogatepass" msgstr "surrogatepass" diff --git a/library/compileall.po b/library/compileall.po index 705cfc98f6..8d7b047354 100644 --- a/library/compileall.po +++ b/library/compileall.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-22 00:04+0000\n" +"POT-Creation-Date: 2023-10-12 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-" @@ -48,40 +48,40 @@ msgstr "" "此模組在 WebAssembly 平台 ``wasm32-emscripten`` 和 ``wasm32-wasi`` 上無法作用" "或無法使用。有關更多資訊,請參閱 :ref:`wasm-availability`。" -#: ../../library/compileall.rst:20 +#: ../../library/compileall.rst:22 msgid "Command-line use" msgstr "" -#: ../../library/compileall.rst:22 +#: ../../library/compileall.rst:24 msgid "" "This module can work as a script (using :program:`python -m compileall`) to " "compile Python sources." msgstr "" -#: ../../library/compileall.rst:30 +#: ../../library/compileall.rst:32 msgid "" "Positional arguments are files to compile or directories that contain source " "files, traversed recursively. If no argument is given, behave as if the " -"command line was ``-l ``." +"command line was :samp:`-l {}`." msgstr "" -#: ../../library/compileall.rst:36 +#: ../../library/compileall.rst:38 msgid "" "Do not recurse into subdirectories, only compile source code files directly " "contained in the named or implied directories." msgstr "" -#: ../../library/compileall.rst:41 +#: ../../library/compileall.rst:43 msgid "Force rebuild even if timestamps are up-to-date." msgstr "" -#: ../../library/compileall.rst:45 +#: ../../library/compileall.rst:47 msgid "" "Do not print the list of files compiled. If passed once, error messages will " "still be printed. If passed twice (``-qq``), all output is suppressed." msgstr "" -#: ../../library/compileall.rst:50 +#: ../../library/compileall.rst:52 msgid "" "Directory prepended to the path to each file being compiled. This will " "appear in compilation time tracebacks, and is also compiled in to the byte-" @@ -90,26 +90,26 @@ msgid "" "executed." msgstr "" -#: ../../library/compileall.rst:59 +#: ../../library/compileall.rst:61 msgid "" "Remove (``-s``) or append (``-p``) the given prefix of paths recorded in the " "``.pyc`` files. Cannot be combined with ``-d``." msgstr "" -#: ../../library/compileall.rst:65 +#: ../../library/compileall.rst:67 msgid "" "regex is used to search the full path to each file considered for " "compilation, and if the regex produces a match, the file is skipped." msgstr "" -#: ../../library/compileall.rst:70 +#: ../../library/compileall.rst:72 msgid "" "Read the file ``list`` and add each line that it contains to the list of " "files and directories to compile. If ``list`` is ``-``, read lines from " "``stdin``." msgstr "" -#: ../../library/compileall.rst:76 +#: ../../library/compileall.rst:78 msgid "" "Write the byte-code files to their legacy locations and names, which may " "overwrite byte-code files created by another version of Python. The default " @@ -117,7 +117,7 @@ msgid "" "byte-code files from multiple versions of Python to coexist." msgstr "" -#: ../../library/compileall.rst:83 +#: ../../library/compileall.rst:85 msgid "" "Control the maximum recursion level for subdirectories. If this is given, " "then ``-l`` option will not be taken into account. :program:`python -m " @@ -125,13 +125,13 @@ msgid "" " -l`." msgstr "" -#: ../../library/compileall.rst:90 +#: ../../library/compileall.rst:92 msgid "" "Use *N* workers to compile the files within the given directory. If ``0`` is " "used, then the result of :func:`os.cpu_count()` will be used." msgstr "" -#: ../../library/compileall.rst:96 +#: ../../library/compileall.rst:98 msgid "" "Control how the generated byte-code files are invalidated at runtime. The " "``timestamp`` value, means that ``.pyc`` files with the source timestamp and " @@ -144,53 +144,53 @@ msgid "" "the ``SOURCE_DATE_EPOCH`` environment variable is set." msgstr "" -#: ../../library/compileall.rst:109 +#: ../../library/compileall.rst:111 msgid "" "Compile with the given optimization level. May be used multiple times to " "compile for multiple levels at a time (for example, ``compileall -o 1 -o " "2``)." msgstr "" -#: ../../library/compileall.rst:115 +#: ../../library/compileall.rst:117 msgid "Ignore symlinks pointing outside the given directory." msgstr "" -#: ../../library/compileall.rst:119 +#: ../../library/compileall.rst:121 msgid "" "If two ``.pyc`` files with different optimization level have the same " "content, use hard links to consolidate duplicate files." msgstr "" -#: ../../library/compileall.rst:122 +#: ../../library/compileall.rst:124 msgid "Added the ``-i``, ``-b`` and ``-h`` options." msgstr "新增選項 ``-i``\\ 、\\ ``-b`` 與 ``-h``\\ 。" -#: ../../library/compileall.rst:125 +#: ../../library/compileall.rst:127 msgid "" "Added the ``-j``, ``-r``, and ``-qq`` options. ``-q`` option was changed " "to a multilevel value. ``-b`` will always produce a byte-code file ending " "in ``.pyc``, never ``.pyo``." msgstr "" -#: ../../library/compileall.rst:130 +#: ../../library/compileall.rst:132 msgid "Added the ``--invalidation-mode`` option." msgstr "新增選項 ``--invalidation-mode``\\ 。" -#: ../../library/compileall.rst:133 +#: ../../library/compileall.rst:135 msgid "" "Added the ``-s``, ``-p``, ``-e`` and ``--hardlink-dupes`` options. Raised " "the default recursion limit from 10 to :py:func:`sys.getrecursionlimit()`. " "Added the possibility to specify the ``-o`` option multiple times." msgstr "" -#: ../../library/compileall.rst:140 +#: ../../library/compileall.rst:142 msgid "" "There is no command-line option to control the optimization level used by " "the :func:`compile` function, because the Python interpreter itself already " "provides the option: :program:`python -O -m compileall`." msgstr "" -#: ../../library/compileall.rst:144 +#: ../../library/compileall.rst:146 msgid "" "Similarly, the :func:`compile` function respects the :data:`sys." "pycache_prefix` setting. The generated bytecode cache will only be useful " @@ -198,24 +198,24 @@ msgid "" "that will be used at runtime." msgstr "" -#: ../../library/compileall.rst:150 +#: ../../library/compileall.rst:152 msgid "Public functions" msgstr "" -#: ../../library/compileall.rst:154 +#: ../../library/compileall.rst:156 msgid "" "Recursively descend the directory tree named by *dir*, compiling all :file:`." "py` files along the way. Return a true value if all the files compiled " "successfully, and a false value otherwise." msgstr "" -#: ../../library/compileall.rst:158 +#: ../../library/compileall.rst:160 msgid "" "The *maxlevels* parameter is used to limit the depth of the recursion; it " "defaults to ``sys.getrecursionlimit()``." msgstr "" -#: ../../library/compileall.rst:161 +#: ../../library/compileall.rst:163 msgid "" "If *ddir* is given, it is prepended to the path to each file being compiled " "for use in compilation time tracebacks, and is also compiled in to the byte-" @@ -224,13 +224,13 @@ msgid "" "executed." msgstr "" -#: ../../library/compileall.rst:167 +#: ../../library/compileall.rst:169 msgid "" "If *force* is true, modules are re-compiled even if the timestamps are up to " "date." msgstr "" -#: ../../library/compileall.rst:170 +#: ../../library/compileall.rst:172 msgid "" "If *rx* is given, its ``search`` method is called on the complete path to " "each file considered for compilation, and if it returns a true value, the " @@ -238,14 +238,14 @@ msgid "" "expression, given as a :ref:`re.Pattern ` object." msgstr "" -#: ../../library/compileall.rst:175 ../../library/compileall.rst:252 +#: ../../library/compileall.rst:177 ../../library/compileall.rst:254 msgid "" "If *quiet* is ``False`` or ``0`` (the default), the filenames and other " "information are printed to standard out. Set to ``1``, only errors are " "printed. Set to ``2``, all output is suppressed." msgstr "" -#: ../../library/compileall.rst:179 ../../library/compileall.rst:256 +#: ../../library/compileall.rst:181 ../../library/compileall.rst:258 msgid "" "If *legacy* is true, byte-code files are written to their legacy locations " "and names, which may overwrite byte-code files created by another version of " @@ -254,7 +254,7 @@ msgid "" "coexist." msgstr "" -#: ../../library/compileall.rst:185 ../../library/compileall.rst:262 +#: ../../library/compileall.rst:187 ../../library/compileall.rst:264 msgid "" "*optimize* specifies the optimization level for the compiler. It is passed " "to the built-in :func:`compile` function. Accepts also a sequence of " @@ -262,7 +262,7 @@ msgid "" "file in one call." msgstr "" -#: ../../library/compileall.rst:189 +#: ../../library/compileall.rst:191 msgid "" "The argument *workers* specifies how many workers are used to compile files " "in parallel. The default is to not use multiple workers. If the platform " @@ -272,79 +272,79 @@ msgid "" "`ValueError` will be raised." msgstr "" -#: ../../library/compileall.rst:196 ../../library/compileall.rst:266 +#: ../../library/compileall.rst:198 ../../library/compileall.rst:268 msgid "" "*invalidation_mode* should be a member of the :class:`py_compile." "PycInvalidationMode` enum and controls how the generated pycs are " "invalidated at runtime." msgstr "" -#: ../../library/compileall.rst:200 ../../library/compileall.rst:270 +#: ../../library/compileall.rst:202 ../../library/compileall.rst:272 msgid "" "The *stripdir*, *prependdir* and *limit_sl_dest* arguments correspond to the " "``-s``, ``-p`` and ``-e`` options described above. They may be specified as " "``str`` or :py:class:`os.PathLike`." msgstr "" -#: ../../library/compileall.rst:204 ../../library/compileall.rst:274 +#: ../../library/compileall.rst:206 ../../library/compileall.rst:276 msgid "" "If *hardlink_dupes* is true and two ``.pyc`` files with different " "optimization level have the same content, use hard links to consolidate " "duplicate files." msgstr "" -#: ../../library/compileall.rst:207 ../../library/compileall.rst:305 +#: ../../library/compileall.rst:209 ../../library/compileall.rst:307 msgid "Added the *legacy* and *optimize* parameter." msgstr "新增 *legacy* 與 *optimize* 參數。" -#: ../../library/compileall.rst:210 +#: ../../library/compileall.rst:212 msgid "Added the *workers* parameter." msgstr "新增 *workers* 參數。" -#: ../../library/compileall.rst:213 ../../library/compileall.rst:279 -#: ../../library/compileall.rst:308 +#: ../../library/compileall.rst:215 ../../library/compileall.rst:281 +#: ../../library/compileall.rst:310 msgid "*quiet* parameter was changed to a multilevel value." msgstr "" -#: ../../library/compileall.rst:216 ../../library/compileall.rst:282 -#: ../../library/compileall.rst:311 +#: ../../library/compileall.rst:218 ../../library/compileall.rst:284 +#: ../../library/compileall.rst:313 msgid "" "The *legacy* parameter only writes out ``.pyc`` files, not ``.pyo`` files no " "matter what the value of *optimize* is." msgstr "" -#: ../../library/compileall.rst:220 +#: ../../library/compileall.rst:222 msgid "Accepts a :term:`path-like object`." msgstr "" -#: ../../library/compileall.rst:223 ../../library/compileall.rst:286 -#: ../../library/compileall.rst:315 +#: ../../library/compileall.rst:225 ../../library/compileall.rst:288 +#: ../../library/compileall.rst:317 msgid "The *invalidation_mode* parameter was added." msgstr "新增 *invalidation_mode* 參數。" -#: ../../library/compileall.rst:226 ../../library/compileall.rst:289 -#: ../../library/compileall.rst:318 +#: ../../library/compileall.rst:228 ../../library/compileall.rst:291 +#: ../../library/compileall.rst:320 msgid "The *invalidation_mode* parameter's default value is updated to None." msgstr "" -#: ../../library/compileall.rst:229 +#: ../../library/compileall.rst:231 msgid "Setting *workers* to 0 now chooses the optimal number of cores." msgstr "" -#: ../../library/compileall.rst:232 +#: ../../library/compileall.rst:234 msgid "" "Added *stripdir*, *prependdir*, *limit_sl_dest* and *hardlink_dupes* " "arguments. Default value of *maxlevels* was changed from ``10`` to ``sys." "getrecursionlimit()``" msgstr "" -#: ../../library/compileall.rst:238 +#: ../../library/compileall.rst:240 msgid "" "Compile the file with path *fullname*. Return a true value if the file " "compiled successfully, and a false value otherwise." msgstr "" -#: ../../library/compileall.rst:241 +#: ../../library/compileall.rst:243 msgid "" "If *ddir* is given, it is prepended to the path to the file being compiled " "for use in compilation time tracebacks, and is also compiled in to the byte-" @@ -353,7 +353,7 @@ msgid "" "executed." msgstr "" -#: ../../library/compileall.rst:247 +#: ../../library/compileall.rst:249 msgid "" "If *rx* is given, its ``search`` method is passed the full path name to the " "file being compiled, and if it returns a true value, the file is not " @@ -362,20 +362,20 @@ msgid "" "object." msgstr "" -#: ../../library/compileall.rst:292 +#: ../../library/compileall.rst:294 msgid "" "Added *stripdir*, *prependdir*, *limit_sl_dest* and *hardlink_dupes* " "arguments." msgstr "" -#: ../../library/compileall.rst:297 +#: ../../library/compileall.rst:299 msgid "" "Byte-compile all the :file:`.py` files found along ``sys.path``. Return a " "true value if all the files compiled successfully, and a false value " "otherwise." msgstr "" -#: ../../library/compileall.rst:300 +#: ../../library/compileall.rst:302 msgid "" "If *skip_curdir* is true (the default), the current directory is not " "included in the search. All other parameters are passed to the :func:" @@ -383,16 +383,16 @@ msgid "" "``maxlevels`` defaults to ``0``." msgstr "" -#: ../../library/compileall.rst:321 +#: ../../library/compileall.rst:323 msgid "" "To force a recompile of all the :file:`.py` files in the :file:`Lib/` " "subdirectory and all its subdirectories::" msgstr "" -#: ../../library/compileall.rst:338 +#: ../../library/compileall.rst:340 msgid "Module :mod:`py_compile`" msgstr ":mod:`py_compile` 模組" -#: ../../library/compileall.rst:339 +#: ../../library/compileall.rst:341 msgid "Byte-compile a single source file." msgstr "" diff --git a/library/concurrent.futures.po b/library/concurrent.futures.po index 90ba3a62ab..d8c5ecccee 100644 --- a/library/concurrent.futures.po +++ b/library/concurrent.futures.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-10-11 17:13+0000\n" "PO-Revision-Date: 2023-01-24 03:33+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -439,15 +439,24 @@ msgid "" msgstr "" "新增了 *max_tasks_per_child* 引數以允許使用者控制池中 worker 的生命週期。" -#: ../../library/concurrent.futures.rst:299 +#: ../../library/concurrent.futures.rst:296 +msgid "" +"On POSIX systems, if your application has multiple threads and the :mod:" +"`multiprocessing` context uses the ``\"fork\"`` start method: The :func:`os." +"fork` function called internally to spawn workers may raise a :exc:" +"`DeprecationWarning`. Pass a *mp_context* configured to use a different " +"start method. See the :func:`os.fork` documentation for further explanation." +msgstr "" + +#: ../../library/concurrent.futures.rst:307 msgid "ProcessPoolExecutor Example" msgstr "ProcessPoolExecutor 範例" -#: ../../library/concurrent.futures.rst:337 +#: ../../library/concurrent.futures.rst:345 msgid "Future Objects" msgstr "Future 物件" -#: ../../library/concurrent.futures.rst:339 +#: ../../library/concurrent.futures.rst:347 msgid "" "The :class:`Future` class encapsulates the asynchronous execution of a " "callable. :class:`Future` instances are created by :meth:`Executor.submit`." @@ -455,7 +464,7 @@ msgstr "" ":class:`Future` 類別封裝了可呼叫物件的非同步執行。:class:`Future` 實例由 :" "meth:`Executor.submit` 建立。" -#: ../../library/concurrent.futures.rst:344 +#: ../../library/concurrent.futures.rst:352 msgid "" "Encapsulates the asynchronous execution of a callable. :class:`Future` " "instances are created by :meth:`Executor.submit` and should not be created " @@ -464,7 +473,7 @@ msgstr "" "封裝可呼叫物件的非同步執行。:class:`Future` 實例由 :meth:`Executor.submit` 建" "立,且除測試外不應直接建立。" -#: ../../library/concurrent.futures.rst:350 +#: ../../library/concurrent.futures.rst:358 msgid "" "Attempt to cancel the call. If the call is currently being executed or " "finished running and cannot be cancelled then the method will return " @@ -474,22 +483,22 @@ msgstr "" "嘗試取消呼叫。如果呼叫當前正在執行或已完成運行且無法取消,則該方法將回傳 " "``False``,否則呼叫將被取消並且該方法將回傳 ``True``。" -#: ../../library/concurrent.futures.rst:357 +#: ../../library/concurrent.futures.rst:365 msgid "Return ``True`` if the call was successfully cancelled." msgstr "如果該呼叫成功被取消,則回傳 ``True``。" -#: ../../library/concurrent.futures.rst:361 +#: ../../library/concurrent.futures.rst:369 msgid "" "Return ``True`` if the call is currently being executed and cannot be " "cancelled." msgstr "如果呼叫正在執行且無法取消,則回傳 ``True``。" -#: ../../library/concurrent.futures.rst:366 +#: ../../library/concurrent.futures.rst:374 msgid "" "Return ``True`` if the call was successfully cancelled or finished running." msgstr "如果呼叫成功被取消或結束運行,則回傳 ``True``。" -#: ../../library/concurrent.futures.rst:371 +#: ../../library/concurrent.futures.rst:379 msgid "" "Return the value returned by the call. If the call hasn't yet completed then " "this method will wait up to *timeout* seconds. If the call hasn't completed " @@ -501,19 +510,19 @@ msgstr "" "叫在 *timeout* 秒內未完成,則會引發 :exc:`TimeoutError`。*timeout* 可以是整數" "或浮點數。如果未指定 *timeout* 或為 ``None``,則等待時間就不會有限制。" -#: ../../library/concurrent.futures.rst:378 -#: ../../library/concurrent.futures.rst:392 +#: ../../library/concurrent.futures.rst:386 +#: ../../library/concurrent.futures.rst:400 msgid "" "If the future is cancelled before completing then :exc:`.CancelledError` " "will be raised." msgstr "如果 future 在完成之前被取消,那麼 :exc:`.CancelledError` 將被引發。" -#: ../../library/concurrent.futures.rst:381 +#: ../../library/concurrent.futures.rst:389 msgid "" "If the call raised an exception, this method will raise the same exception." msgstr "如果該呼叫引發了例外,此方法將引發相同的例外。" -#: ../../library/concurrent.futures.rst:385 +#: ../../library/concurrent.futures.rst:393 msgid "" "Return the exception raised by the call. If the call hasn't yet completed " "then this method will wait up to *timeout* seconds. If the call hasn't " @@ -525,11 +534,11 @@ msgstr "" "呼叫在 *timeout* 秒內未完成,則會引發 :exc:`TimeoutError`。 *timeout* 可以是" "整數或浮點數。如果未指定 *timeout* 或為 ``None``,則等待時間就不會有限制。" -#: ../../library/concurrent.futures.rst:395 +#: ../../library/concurrent.futures.rst:403 msgid "If the call completed without raising, ``None`` is returned." msgstr "如果呼叫在沒有引發的情況下完成,則回傳 ``None``。" -#: ../../library/concurrent.futures.rst:399 +#: ../../library/concurrent.futures.rst:407 msgid "" "Attaches the callable *fn* to the future. *fn* will be called, with the " "future as its only argument, when the future is cancelled or finishes " @@ -538,7 +547,7 @@ msgstr "" "將可呼叫的 *fn* 附加到 future 上。當 future 被取消或完成運行時,*fn* 將被以 " "future 作為其唯一引數來呼叫。" -#: ../../library/concurrent.futures.rst:403 +#: ../../library/concurrent.futures.rst:411 msgid "" "Added callables are called in the order that they were added and are always " "called in a thread belonging to the process that added them. If the " @@ -550,19 +559,19 @@ msgstr "" "如果可呼叫物件引發 :exc:`Exception` 子類別,它將被記錄 (log) 並忽略。如果可呼" "叫物件引發 :exc:`BaseException` 子類別,該行為未定義。" -#: ../../library/concurrent.futures.rst:409 +#: ../../library/concurrent.futures.rst:417 msgid "" "If the future has already completed or been cancelled, *fn* will be called " "immediately." msgstr "如果 future 已經完成或被取消,*fn* 將立即被呼叫。" -#: ../../library/concurrent.futures.rst:412 +#: ../../library/concurrent.futures.rst:420 msgid "" "The following :class:`Future` methods are meant for use in unit tests and :" "class:`Executor` implementations." msgstr "以下 :class:`Future` 方法旨在用於單元測試和 :class:`Executor` 實作。" -#: ../../library/concurrent.futures.rst:417 +#: ../../library/concurrent.futures.rst:425 msgid "" "This method should only be called by :class:`Executor` implementations " "before executing the work associated with the :class:`Future` and by unit " @@ -571,7 +580,7 @@ msgstr "" "此方法只能在與 :class:`Future` 關聯的工作被執行之前於 :class:`Executor` 實作" "中呼叫,或者在單元測試中呼叫。" -#: ../../library/concurrent.futures.rst:421 +#: ../../library/concurrent.futures.rst:429 msgid "" "If the method returns ``False`` then the :class:`Future` was cancelled, i." "e. :meth:`Future.cancel` was called and returned ``True``. Any threads " @@ -582,7 +591,7 @@ msgstr "" "cancel` 被呼叫並回傳 ``True``。任何等待 :class:`Future` 完成的執行緒(即透" "過 :func:`as_completed` 或 :func:`wait`)將被喚醒。" -#: ../../library/concurrent.futures.rst:426 +#: ../../library/concurrent.futures.rst:434 msgid "" "If the method returns ``True`` then the :class:`Future` was not cancelled " "and has been put in the running state, i.e. calls to :meth:`Future.running` " @@ -591,7 +600,7 @@ msgstr "" "如果該方法回傳 ``True`` 則代表 :class:`Future` 未被取消並已進入運行狀態,意即" "呼叫 :meth:`Future.running` 將回傳 ``True``。" -#: ../../library/concurrent.futures.rst:430 +#: ../../library/concurrent.futures.rst:438 msgid "" "This method can only be called once and cannot be called after :meth:`Future." "set_result` or :meth:`Future.set_exception` have been called." @@ -599,20 +608,20 @@ msgstr "" "此方法只能呼叫一次,且不能在呼叫 :meth:`Future.set_result` 或 :meth:`Future." "set_exception` 之後呼叫。" -#: ../../library/concurrent.futures.rst:436 +#: ../../library/concurrent.futures.rst:444 msgid "" "Sets the result of the work associated with the :class:`Future` to *result*." msgstr "將與 :class:`Future` 關聯的工作結果設定為 *result*。" -#: ../../library/concurrent.futures.rst:439 -#: ../../library/concurrent.futures.rst:452 +#: ../../library/concurrent.futures.rst:447 +#: ../../library/concurrent.futures.rst:460 msgid "" "This method should only be used by :class:`Executor` implementations and " "unit tests." msgstr "此方法只能在 :class:`Executor` 實作中和單元測試中使用。" -#: ../../library/concurrent.futures.rst:442 -#: ../../library/concurrent.futures.rst:455 +#: ../../library/concurrent.futures.rst:450 +#: ../../library/concurrent.futures.rst:463 msgid "" "This method raises :exc:`concurrent.futures.InvalidStateError` if the :class:" "`Future` is already done." @@ -620,18 +629,18 @@ msgstr "" "如果 :class:`Future` 已經完成,此方法會引發 :exc:`concurrent.futures." "InvalidStateError`。" -#: ../../library/concurrent.futures.rst:449 +#: ../../library/concurrent.futures.rst:457 msgid "" "Sets the result of the work associated with the :class:`Future` to the :" "class:`Exception` *exception*." msgstr "" "將與 :class:`Future` 關聯的工作結果設定為 :class:`Exception` *exception*。" -#: ../../library/concurrent.futures.rst:461 +#: ../../library/concurrent.futures.rst:469 msgid "Module Functions" msgstr "模組函式" -#: ../../library/concurrent.futures.rst:465 +#: ../../library/concurrent.futures.rst:473 msgid "" "Wait for the :class:`Future` instances (possibly created by different :class:" "`Executor` instances) given by *fs* to complete. Duplicate futures given to " @@ -647,7 +656,7 @@ msgstr "" "完成的 future(已完成或被取消的 future)。第二組名為 ``not_done``,包含未完成" "的 future(未定或運行中的 future)。" -#: ../../library/concurrent.futures.rst:473 +#: ../../library/concurrent.futures.rst:481 msgid "" "*timeout* can be used to control the maximum number of seconds to wait " "before returning. *timeout* can be an int or float. If *timeout* is not " @@ -656,33 +665,33 @@ msgstr "" "*timeout* 可用於控制回傳前等待的最大秒數。*timeout* 可以是整數或浮點數。如果" "未指定 *timeout* 或為 ``None``,則等待時間就沒有限制。" -#: ../../library/concurrent.futures.rst:477 +#: ../../library/concurrent.futures.rst:485 msgid "" "*return_when* indicates when this function should return. It must be one of " "the following constants:" msgstr "*return_when* 表示此函式應回傳的時間。它必須是以下常數之一:" -#: ../../library/concurrent.futures.rst:483 +#: ../../library/concurrent.futures.rst:491 msgid "Constant" msgstr "常數" -#: ../../library/concurrent.futures.rst:483 +#: ../../library/concurrent.futures.rst:491 msgid "Description" msgstr "描述" -#: ../../library/concurrent.futures.rst:485 +#: ../../library/concurrent.futures.rst:493 msgid ":const:`FIRST_COMPLETED`" msgstr ":const:`FIRST_COMPLETED`" -#: ../../library/concurrent.futures.rst:485 +#: ../../library/concurrent.futures.rst:493 msgid "The function will return when any future finishes or is cancelled." msgstr "當任何 future 完成或被取消時,該函式就會回傳。" -#: ../../library/concurrent.futures.rst:488 +#: ../../library/concurrent.futures.rst:496 msgid ":const:`FIRST_EXCEPTION`" msgstr ":const:`FIRST_EXCEPTION`" -#: ../../library/concurrent.futures.rst:488 +#: ../../library/concurrent.futures.rst:496 msgid "" "The function will return when any future finishes by raising an exception. " "If no future raises an exception then it is equivalent to :const:" @@ -691,15 +700,15 @@ msgstr "" "該函式會在任何 future 透過引發例外而完結時回傳。如果 future 沒有引發例外,那" "麼它等同於 :const:`ALL_COMPLETED`。" -#: ../../library/concurrent.futures.rst:494 +#: ../../library/concurrent.futures.rst:502 msgid ":const:`ALL_COMPLETED`" msgstr ":const:`ALL_COMPLETED`" -#: ../../library/concurrent.futures.rst:494 +#: ../../library/concurrent.futures.rst:502 msgid "The function will return when all futures finish or are cancelled." msgstr "當所有 future 都完成或被取消時,該函式才會回傳。" -#: ../../library/concurrent.futures.rst:500 +#: ../../library/concurrent.futures.rst:508 msgid "" "Returns an iterator over the :class:`Future` instances (possibly created by " "different :class:`Executor` instances) given by *fs* that yields futures as " @@ -719,36 +728,36 @@ msgstr "" "`TimeoutError`。*timeout* 可以是整數或浮點數。如果未指定 *timeout* 或為 " "``None``,則等待時間就沒有限制。" -#: ../../library/concurrent.futures.rst:514 +#: ../../library/concurrent.futures.rst:522 msgid ":pep:`3148` -- futures - execute computations asynchronously" msgstr ":pep:`3148` -- futures - 非同步地執行運算" -#: ../../library/concurrent.futures.rst:514 +#: ../../library/concurrent.futures.rst:522 msgid "" "The proposal which described this feature for inclusion in the Python " "standard library." msgstr "描述此功能並提出被包含於 Python 標準函式庫中的提案。" -#: ../../library/concurrent.futures.rst:519 +#: ../../library/concurrent.futures.rst:527 msgid "Exception classes" msgstr "例外類別" -#: ../../library/concurrent.futures.rst:525 +#: ../../library/concurrent.futures.rst:533 msgid "Raised when a future is cancelled." msgstr "當 future 被取消時引發。" -#: ../../library/concurrent.futures.rst:529 +#: ../../library/concurrent.futures.rst:537 msgid "" "A deprecated alias of :exc:`TimeoutError`, raised when a future operation " "exceeds the given timeout." msgstr "" ":exc:`TimeoutError` 的棄用別名,在 future 操作超過給定超時 (timeout) 時引發。" -#: ../../library/concurrent.futures.rst:534 +#: ../../library/concurrent.futures.rst:542 msgid "This class was made an alias of :exc:`TimeoutError`." msgstr "這個類別是 :exc:`TimeoutError` 的別名。" -#: ../../library/concurrent.futures.rst:539 +#: ../../library/concurrent.futures.rst:547 msgid "" "Derived from :exc:`RuntimeError`, this exception class is raised when an " "executor is broken for some reason, and cannot be used to submit or execute " @@ -757,13 +766,13 @@ msgstr "" "衍生自 :exc:`RuntimeError`,當執行器因某種原因損壞時會引發此例外類別,並且不" "能用於提交或執行新任務。" -#: ../../library/concurrent.futures.rst:547 +#: ../../library/concurrent.futures.rst:555 msgid "" "Raised when an operation is performed on a future that is not allowed in the " "current state." msgstr "當前狀態下不允許的 future 操作被執行時而引發。" -#: ../../library/concurrent.futures.rst:556 +#: ../../library/concurrent.futures.rst:564 msgid "" "Derived from :exc:`~concurrent.futures.BrokenExecutor`, this exception class " "is raised when one of the workers of a :class:`ThreadPoolExecutor` has " @@ -772,7 +781,7 @@ msgstr "" "衍生自 :exc:`~concurrent.futures.BrokenExecutor`,當 :class:" "`ThreadPoolExecutor` 的其中一個 worker 初始化失敗時會引發此例外類別。" -#: ../../library/concurrent.futures.rst:566 +#: ../../library/concurrent.futures.rst:574 msgid "" "Derived from :exc:`~concurrent.futures.BrokenExecutor` (formerly :exc:" "`RuntimeError`), this exception class is raised when one of the workers of " diff --git a/library/ctypes.po b/library/ctypes.po index 120a3fae5a..803aeb4d87 100644 --- a/library/ctypes.po +++ b/library/ctypes.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-20 15:45+0000\n" +"POT-Creation-Date: 2023-10-12 00:03+0000\n" "PO-Revision-Date: 2023-04-26 02:59+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -210,7 +210,7 @@ msgid "" "learn more about :mod:`ctypes` data types." msgstr "" -#: ../../library/ctypes.rst:213 ../../library/ctypes.rst:2201 +#: ../../library/ctypes.rst:213 ../../library/ctypes.rst:2203 msgid "Fundamental data types" msgstr "" @@ -1245,7 +1245,7 @@ msgid "" "If no library can be found, returns ``None``." msgstr "" -#: ../../library/ctypes.rst:1317 ../../library/ctypes.rst:1976 +#: ../../library/ctypes.rst:1317 ../../library/ctypes.rst:1977 msgid "The exact functionality is system dependent." msgstr "" @@ -1322,8 +1322,8 @@ msgid "" "determine which one is not found using Windows debugging and tracing tools." msgstr "" -#: ../../library/ctypes.rst:1388 ../../library/ctypes.rst:1410 -#: ../../library/ctypes.rst:1421 ../../library/ctypes.rst:1438 +#: ../../library/ctypes.rst:1388 ../../library/ctypes.rst:1411 +#: ../../library/ctypes.rst:1422 ../../library/ctypes.rst:1439 msgid "The *name* parameter can now be a :term:`path-like object`." msgstr "" @@ -1344,23 +1344,25 @@ msgid "" msgstr "" #: ../../library/ctypes.rst:1405 -msgid ":exc:`WindowsError` used to be raised." +msgid "" +":exc:`WindowsError` used to be raised, which is now an alias of :exc:" +"`OSError`." msgstr "" -#: ../../library/ctypes.rst:1415 +#: ../../library/ctypes.rst:1416 msgid "" "Windows only: Instances of this class represent loaded shared libraries, " "functions in these libraries use the ``stdcall`` calling convention, and are " "assumed to return :c:expr:`int` by default." msgstr "" -#: ../../library/ctypes.rst:1423 +#: ../../library/ctypes.rst:1424 msgid "" "The Python :term:`global interpreter lock` is released before calling any " "function exported by these libraries, and reacquired afterwards." msgstr "" -#: ../../library/ctypes.rst:1429 +#: ../../library/ctypes.rst:1430 msgid "" "Instances of this class behave like :class:`CDLL` instances, except that the " "Python GIL is *not* released during the function call, and after the " @@ -1368,11 +1370,11 @@ msgid "" "set, a Python exception is raised." msgstr "" -#: ../../library/ctypes.rst:1434 +#: ../../library/ctypes.rst:1435 msgid "Thus, this is only useful to call Python C api functions directly." msgstr "" -#: ../../library/ctypes.rst:1440 +#: ../../library/ctypes.rst:1441 msgid "" "All these classes can be instantiated by calling them with at least one " "argument, the pathname of the shared library. If you have an existing " @@ -1382,7 +1384,7 @@ msgid "" "the process, and to get a handle to it." msgstr "" -#: ../../library/ctypes.rst:1447 +#: ../../library/ctypes.rst:1448 msgid "" "The *mode* parameter can be used to specify how the library is loaded. For " "details, consult the :manpage:`dlopen(3)` manpage. On Windows, *mode* is " @@ -1390,7 +1392,7 @@ msgid "" "configurable." msgstr "" -#: ../../library/ctypes.rst:1452 +#: ../../library/ctypes.rst:1453 msgid "" "The *use_errno* parameter, when set to true, enables a ctypes mechanism that " "allows accessing the system :data:`errno` error number in a safe way. :mod:" @@ -1400,14 +1402,14 @@ msgid "" "private copy, the same happens immediately after the function call." msgstr "" -#: ../../library/ctypes.rst:1459 +#: ../../library/ctypes.rst:1460 msgid "" "The function :func:`ctypes.get_errno` returns the value of the ctypes " "private copy, and the function :func:`ctypes.set_errno` changes the ctypes " "private copy to a new value and returns the former value." msgstr "" -#: ../../library/ctypes.rst:1463 +#: ../../library/ctypes.rst:1464 msgid "" "The *use_last_error* parameter, when set to true, enables the same mechanism " "for the Windows error code which is managed by the :func:`GetLastError` and :" @@ -1416,7 +1418,7 @@ msgid "" "private copy of the windows error code." msgstr "" -#: ../../library/ctypes.rst:1469 +#: ../../library/ctypes.rst:1470 msgid "" "The *winmode* parameter is used on Windows to specify how the library is " "loaded (since *mode* is ignored). It takes any value that is valid for the " @@ -1426,29 +1428,29 @@ msgid "" "ensure the correct library and dependencies are loaded." msgstr "" -#: ../../library/ctypes.rst:1476 +#: ../../library/ctypes.rst:1477 msgid "Added *winmode* parameter." msgstr "新增 *winmode* 參數。" -#: ../../library/ctypes.rst:1483 +#: ../../library/ctypes.rst:1484 msgid "" "Flag to use as *mode* parameter. On platforms where this flag is not " "available, it is defined as the integer zero." msgstr "" -#: ../../library/ctypes.rst:1490 +#: ../../library/ctypes.rst:1491 msgid "" "Flag to use as *mode* parameter. On platforms where this is not available, " "it is the same as *RTLD_GLOBAL*." msgstr "" -#: ../../library/ctypes.rst:1497 +#: ../../library/ctypes.rst:1498 msgid "" "The default mode which is used to load shared libraries. On OSX 10.3, this " "is *RTLD_GLOBAL*, otherwise it is the same as *RTLD_LOCAL*." msgstr "" -#: ../../library/ctypes.rst:1500 +#: ../../library/ctypes.rst:1501 msgid "" "Instances of these classes have no public methods. Functions exported by " "the shared library can be accessed as attributes or by index. Please note " @@ -1457,21 +1459,21 @@ msgid "" "other hand, accessing it through an index returns a new object each time::" msgstr "" -#: ../../library/ctypes.rst:1513 +#: ../../library/ctypes.rst:1514 msgid "" "The following public attributes are available, their name starts with an " "underscore to not clash with exported function names:" msgstr "" -#: ../../library/ctypes.rst:1519 +#: ../../library/ctypes.rst:1520 msgid "The system handle used to access the library." msgstr "" -#: ../../library/ctypes.rst:1524 +#: ../../library/ctypes.rst:1525 msgid "The name of the library passed in the constructor." msgstr "" -#: ../../library/ctypes.rst:1526 +#: ../../library/ctypes.rst:1527 msgid "" "Shared libraries can also be loaded by using one of the prefabricated " "objects, which are instances of the :class:`LibraryLoader` class, either by " @@ -1479,13 +1481,13 @@ msgid "" "library as attribute of the loader instance." msgstr "" -#: ../../library/ctypes.rst:1534 +#: ../../library/ctypes.rst:1535 msgid "" "Class which loads shared libraries. *dlltype* should be one of the :class:" "`CDLL`, :class:`PyDLL`, :class:`WinDLL`, or :class:`OleDLL` types." msgstr "" -#: ../../library/ctypes.rst:1537 +#: ../../library/ctypes.rst:1538 msgid "" ":meth:`!__getattr__` has special behavior: It allows loading a shared " "library by accessing it as attribute of a library loader instance. The " @@ -1493,39 +1495,39 @@ msgid "" "each time." msgstr "" -#: ../../library/ctypes.rst:1543 +#: ../../library/ctypes.rst:1544 msgid "" "Load a shared library into the process and return it. This method always " "returns a new instance of the library." msgstr "" -#: ../../library/ctypes.rst:1547 +#: ../../library/ctypes.rst:1548 msgid "These prefabricated library loaders are available:" msgstr "" -#: ../../library/ctypes.rst:1552 +#: ../../library/ctypes.rst:1553 msgid "Creates :class:`CDLL` instances." msgstr "" -#: ../../library/ctypes.rst:1558 +#: ../../library/ctypes.rst:1559 msgid "Windows only: Creates :class:`WinDLL` instances." msgstr "" -#: ../../library/ctypes.rst:1564 +#: ../../library/ctypes.rst:1565 msgid "Windows only: Creates :class:`OleDLL` instances." msgstr "" -#: ../../library/ctypes.rst:1570 +#: ../../library/ctypes.rst:1571 msgid "Creates :class:`PyDLL` instances." msgstr "" -#: ../../library/ctypes.rst:1573 +#: ../../library/ctypes.rst:1574 msgid "" "For accessing the C Python api directly, a ready-to-use Python shared " "library object is available:" msgstr "" -#: ../../library/ctypes.rst:1579 +#: ../../library/ctypes.rst:1580 msgid "" "An instance of :class:`PyDLL` that exposes Python C API functions as " "attributes. Note that all these functions are assumed to return C :c:expr:" @@ -1533,21 +1535,21 @@ msgid "" "correct :attr:`!restype` attribute to use these functions." msgstr "" -#: ../../library/ctypes.rst:1584 +#: ../../library/ctypes.rst:1585 msgid "" "Raises an :ref:`auditing event ` ``ctypes.dlopen`` with argument " "``name``." msgstr "" "引發一個附帶引數 ``name`` 的\\ :ref:`稽核事件 ` ``ctypes.dlopen``。" -#: ../../library/ctypes.rst:1586 +#: ../../library/ctypes.rst:1587 msgid "" "Loading a library through any of these objects raises an :ref:`auditing " "event ` ``ctypes.dlopen`` with string argument ``name``, the name " "used to load the library." msgstr "" -#: ../../library/ctypes.rst:1590 +#: ../../library/ctypes.rst:1591 #, fuzzy msgid "" "Raises an :ref:`auditing event ` ``ctypes.dlsym`` with arguments " @@ -1556,14 +1558,14 @@ msgstr "" "引發一個附帶引數 ``library``、``name`` 的\\ :ref:`稽核事件 ` " "``ctypes.dlsym``。" -#: ../../library/ctypes.rst:1592 +#: ../../library/ctypes.rst:1593 msgid "" "Accessing a function on a loaded library raises an auditing event ``ctypes." "dlsym`` with arguments ``library`` (the library object) and ``name`` (the " "symbol's name as a string or integer)." msgstr "" -#: ../../library/ctypes.rst:1596 +#: ../../library/ctypes.rst:1597 #, fuzzy msgid "" "Raises an :ref:`auditing event ` ``ctypes.dlsym/handle`` with " @@ -1572,18 +1574,18 @@ msgstr "" "引發一個附帶引數 ``handle``、``name`` 的\\ :ref:`稽核事件 ` " "``ctypes.dlsym/handle``。" -#: ../../library/ctypes.rst:1598 +#: ../../library/ctypes.rst:1599 msgid "" "In cases when only the library handle is available rather than the object, " "accessing a function raises an auditing event ``ctypes.dlsym/handle`` with " "arguments ``handle`` (the raw library handle) and ``name``." msgstr "" -#: ../../library/ctypes.rst:1605 +#: ../../library/ctypes.rst:1606 msgid "Foreign functions" msgstr "" -#: ../../library/ctypes.rst:1607 +#: ../../library/ctypes.rst:1608 msgid "" "As explained in the previous section, foreign functions can be accessed as " "attributes of loaded shared libraries. The function objects created in this " @@ -1592,29 +1594,29 @@ msgid "" "library loader. They are instances of a private class:" msgstr "" -#: ../../library/ctypes.rst:1616 +#: ../../library/ctypes.rst:1617 msgid "Base class for C callable foreign functions." msgstr "" -#: ../../library/ctypes.rst:1618 +#: ../../library/ctypes.rst:1619 msgid "" "Instances of foreign functions are also C compatible data types; they " "represent C function pointers." msgstr "" -#: ../../library/ctypes.rst:1621 +#: ../../library/ctypes.rst:1622 msgid "" "This behavior can be customized by assigning to special attributes of the " "foreign function object." msgstr "" -#: ../../library/ctypes.rst:1626 +#: ../../library/ctypes.rst:1627 msgid "" "Assign a ctypes type to specify the result type of the foreign function. Use " "``None`` for :c:expr:`void`, a function not returning anything." msgstr "" -#: ../../library/ctypes.rst:1629 +#: ../../library/ctypes.rst:1630 msgid "" "It is possible to assign a callable Python object that is not a ctypes type, " "in this case the function is assumed to return a C :c:expr:`int`, and the " @@ -1624,7 +1626,7 @@ msgid "" "callable to the :attr:`errcheck` attribute." msgstr "" -#: ../../library/ctypes.rst:1638 +#: ../../library/ctypes.rst:1639 msgid "" "Assign a tuple of ctypes types to specify the argument types that the " "function accepts. Functions using the ``stdcall`` calling convention can " @@ -1633,7 +1635,7 @@ msgid "" "unspecified arguments as well." msgstr "" -#: ../../library/ctypes.rst:1644 +#: ../../library/ctypes.rst:1645 msgid "" "When a foreign function is called, each actual argument is passed to the :" "meth:`~_CData.from_param` class method of the items in the :attr:`argtypes` " @@ -1643,7 +1645,7 @@ msgid "" "object using ctypes conversion rules." msgstr "" -#: ../../library/ctypes.rst:1651 +#: ../../library/ctypes.rst:1652 msgid "" "New: It is now possible to put items in argtypes which are not ctypes types, " "but each item must have a :meth:`~_CData.from_param` method which returns a " @@ -1651,44 +1653,44 @@ msgid "" "defining adapters that can adapt custom objects as function parameters." msgstr "" -#: ../../library/ctypes.rst:1658 +#: ../../library/ctypes.rst:1659 msgid "" "Assign a Python function or another callable to this attribute. The callable " "will be called with three or more arguments:" msgstr "" -#: ../../library/ctypes.rst:1665 +#: ../../library/ctypes.rst:1666 msgid "" "*result* is what the foreign function returns, as specified by the :attr:`!" "restype` attribute." msgstr "" -#: ../../library/ctypes.rst:1668 +#: ../../library/ctypes.rst:1669 msgid "" "*func* is the foreign function object itself, this allows reusing the same " "callable object to check or post process the results of several functions." msgstr "" -#: ../../library/ctypes.rst:1672 +#: ../../library/ctypes.rst:1673 msgid "" "*arguments* is a tuple containing the parameters originally passed to the " "function call, this allows specializing the behavior on the arguments used." msgstr "" -#: ../../library/ctypes.rst:1676 +#: ../../library/ctypes.rst:1677 msgid "" "The object that this function returns will be returned from the foreign " "function call, but it can also check the result value and raise an exception " "if the foreign function call failed." msgstr "" -#: ../../library/ctypes.rst:1683 +#: ../../library/ctypes.rst:1684 msgid "" "This exception is raised when a foreign function call cannot convert one of " "the passed arguments." msgstr "" -#: ../../library/ctypes.rst:1687 +#: ../../library/ctypes.rst:1688 #, fuzzy msgid "" "Raises an :ref:`auditing event ` ``ctypes.set_exception`` with " @@ -1697,7 +1699,7 @@ msgstr "" "引發一個附帶引數 ``code`` 的\\ :ref:`稽核事件 ` ``ctypes." "set_exception``。" -#: ../../library/ctypes.rst:1689 +#: ../../library/ctypes.rst:1690 msgid "" "On Windows, when a foreign function call raises a system exception (for " "example, due to an access violation), it will be captured and replaced with " @@ -1706,7 +1708,7 @@ msgid "" "hook to replace the exception with its own." msgstr "" -#: ../../library/ctypes.rst:1695 +#: ../../library/ctypes.rst:1696 #, fuzzy msgid "" "Raises an :ref:`auditing event ` ``ctypes.call_function`` with " @@ -1715,18 +1717,18 @@ msgstr "" "引發一個附帶引數 ``func_pointer``、``arguments`` 的\\ :ref:`稽核事件 " "` ``ctypes.call_function``。" -#: ../../library/ctypes.rst:1697 +#: ../../library/ctypes.rst:1698 msgid "" "Some ways to invoke foreign function calls may raise an auditing event " "``ctypes.call_function`` with arguments ``function pointer`` and " "``arguments``." msgstr "" -#: ../../library/ctypes.rst:1703 +#: ../../library/ctypes.rst:1704 msgid "Function prototypes" msgstr "" -#: ../../library/ctypes.rst:1705 +#: ../../library/ctypes.rst:1706 msgid "" "Foreign functions can also be created by instantiating function prototypes. " "Function prototypes are similar to function prototypes in C; they describe a " @@ -1737,7 +1739,7 @@ msgid "" "``@wrapper`` syntax. See :ref:`ctypes-callback-functions` for examples." msgstr "" -#: ../../library/ctypes.rst:1716 +#: ../../library/ctypes.rst:1717 msgid "" "The returned function prototype creates functions that use the standard C " "calling convention. The function will release the GIL during the call. If " @@ -1746,20 +1748,20 @@ msgid "" "after the call; *use_last_error* does the same for the Windows error code." msgstr "" -#: ../../library/ctypes.rst:1726 +#: ../../library/ctypes.rst:1727 msgid "" "Windows only: The returned function prototype creates functions that use the " "``stdcall`` calling convention. The function will release the GIL during " "the call. *use_errno* and *use_last_error* have the same meaning as above." msgstr "" -#: ../../library/ctypes.rst:1734 +#: ../../library/ctypes.rst:1735 msgid "" "The returned function prototype creates functions that use the Python " "calling convention. The function will *not* release the GIL during the call." msgstr "" -#: ../../library/ctypes.rst:1737 +#: ../../library/ctypes.rst:1738 msgid "" "Function prototypes created by these factory functions can be instantiated " "in different ways, depending on the type and number of the parameters in the " @@ -1857,22 +1859,22 @@ msgstr "" msgid "The optional third item is the default value for this parameter." msgstr "" -#: ../../library/ctypes.rst:1803 +#: ../../library/ctypes.rst:1804 msgid "" -"This example demonstrates how to wrap the Windows ``MessageBoxW`` function " -"so that it supports default parameters and named arguments. The C " +"The following example demonstrates how to wrap the Windows ``MessageBoxW`` " +"function so that it supports default parameters and named arguments. The C " "declaration from the windows header file is this::" msgstr "" -#: ../../library/ctypes.rst:1814 ../../library/ctypes.rst:1837 +#: ../../library/ctypes.rst:1815 ../../library/ctypes.rst:1838 msgid "Here is the wrapping with :mod:`ctypes`::" msgstr "" -#: ../../library/ctypes.rst:1822 +#: ../../library/ctypes.rst:1823 msgid "The ``MessageBox`` foreign function can now be called in these ways::" msgstr "" -#: ../../library/ctypes.rst:1828 +#: ../../library/ctypes.rst:1829 msgid "" "A second example demonstrates output parameters. The win32 " "``GetWindowRect`` function retrieves the dimensions of a specified window by " @@ -1880,7 +1882,7 @@ msgid "" "the C declaration::" msgstr "" -#: ../../library/ctypes.rst:1846 +#: ../../library/ctypes.rst:1847 msgid "" "Functions with output parameters will automatically return the output " "parameter value if there is a single one, or a tuple containing the output " @@ -1888,7 +1890,7 @@ msgid "" "now returns a RECT instance, when called." msgstr "" -#: ../../library/ctypes.rst:1851 +#: ../../library/ctypes.rst:1852 msgid "" "Output parameters can be combined with the :attr:`~_FuncPtr.errcheck` " "protocol to do further output processing and error checking. The win32 " @@ -1897,7 +1899,7 @@ msgid "" "exception when the api call failed::" msgstr "" -#: ../../library/ctypes.rst:1864 +#: ../../library/ctypes.rst:1865 msgid "" "If the :attr:`~_FuncPtr.errcheck` function returns the argument tuple it " "receives unchanged, :mod:`ctypes` continues the normal processing it does on " @@ -1906,17 +1908,17 @@ msgid "" "and return them instead, the normal processing will no longer take place::" msgstr "" -#: ../../library/ctypes.rst:1883 +#: ../../library/ctypes.rst:1884 msgid "Utility functions" msgstr "" -#: ../../library/ctypes.rst:1887 +#: ../../library/ctypes.rst:1888 msgid "" "Returns the address of the memory buffer as integer. *obj* must be an " "instance of a ctypes type." msgstr "" -#: ../../library/ctypes.rst:1890 +#: ../../library/ctypes.rst:1891 msgid "" "Raises an :ref:`auditing event ` ``ctypes.addressof`` with " "argument ``obj``." @@ -1924,30 +1926,30 @@ msgstr "" "引發一個附帶引數 ``obj`` 的\\ :ref:`稽核事件 ` ``ctypes." "addressof``。" -#: ../../library/ctypes.rst:1895 +#: ../../library/ctypes.rst:1896 msgid "" "Returns the alignment requirements of a ctypes type. *obj_or_type* must be a " "ctypes type or instance." msgstr "" -#: ../../library/ctypes.rst:1901 +#: ../../library/ctypes.rst:1902 msgid "" "Returns a light-weight pointer to *obj*, which must be an instance of a " "ctypes type. *offset* defaults to zero, and must be an integer that will be " "added to the internal pointer value." msgstr "" -#: ../../library/ctypes.rst:1905 +#: ../../library/ctypes.rst:1906 msgid "``byref(obj, offset)`` corresponds to this C code::" msgstr "" -#: ../../library/ctypes.rst:1909 +#: ../../library/ctypes.rst:1910 msgid "" "The returned object can only be used as a foreign function call parameter. " "It behaves similar to ``pointer(obj)``, but the construction is a lot faster." msgstr "" -#: ../../library/ctypes.rst:1915 +#: ../../library/ctypes.rst:1916 msgid "" "This function is similar to the cast operator in C. It returns a new " "instance of *type* which points to the same memory block as *obj*. *type* " @@ -1955,19 +1957,19 @@ msgid "" "as a pointer." msgstr "" -#: ../../library/ctypes.rst:1923 +#: ../../library/ctypes.rst:1924 msgid "" "This function creates a mutable character buffer. The returned object is a " "ctypes array of :class:`c_char`." msgstr "" -#: ../../library/ctypes.rst:1926 +#: ../../library/ctypes.rst:1927 msgid "" "*init_or_size* must be an integer which specifies the size of the array, or " "a bytes object which will be used to initialize the array items." msgstr "" -#: ../../library/ctypes.rst:1929 +#: ../../library/ctypes.rst:1930 msgid "" "If a bytes object is specified as first argument, the buffer is made one " "item larger than its length so that the last element in the array is a NUL " @@ -1976,7 +1978,7 @@ msgid "" "not be used." msgstr "" -#: ../../library/ctypes.rst:1934 +#: ../../library/ctypes.rst:1935 msgid "" "Raises an :ref:`auditing event ` ``ctypes.create_string_buffer`` " "with arguments ``init``, ``size``." @@ -1984,19 +1986,19 @@ msgstr "" "引發一個附帶引數 ``init`` 與 ``size`` 的\\ :ref:`稽核事件 ` " "``ctypes.create_string_buffer``。" -#: ../../library/ctypes.rst:1939 +#: ../../library/ctypes.rst:1940 msgid "" "This function creates a mutable unicode character buffer. The returned " "object is a ctypes array of :class:`c_wchar`." msgstr "" -#: ../../library/ctypes.rst:1942 +#: ../../library/ctypes.rst:1943 msgid "" "*init_or_size* must be an integer which specifies the size of the array, or " "a string which will be used to initialize the array items." msgstr "" -#: ../../library/ctypes.rst:1945 +#: ../../library/ctypes.rst:1946 msgid "" "If a string is specified as first argument, the buffer is made one item " "larger than the length of the string so that the last element in the array " @@ -2005,7 +2007,7 @@ msgid "" "should not be used." msgstr "" -#: ../../library/ctypes.rst:1951 +#: ../../library/ctypes.rst:1952 msgid "" "Raises an :ref:`auditing event ` ``ctypes.create_unicode_buffer`` " "with arguments ``init``, ``size``." @@ -2013,21 +2015,21 @@ msgstr "" "引發一個附帶引數 ``init`` 與 ``size`` 的\\ :ref:`稽核事件 ` " "``ctypes.create_unicode_buffer``。" -#: ../../library/ctypes.rst:1956 +#: ../../library/ctypes.rst:1957 msgid "" "Windows only: This function is a hook which allows implementing in-process " "COM servers with ctypes. It is called from the DllCanUnloadNow function " "that the _ctypes extension dll exports." msgstr "" -#: ../../library/ctypes.rst:1963 +#: ../../library/ctypes.rst:1964 msgid "" "Windows only: This function is a hook which allows implementing in-process " "COM servers with ctypes. It is called from the DllGetClassObject function " "that the ``_ctypes`` extension dll exports." msgstr "" -#: ../../library/ctypes.rst:1971 +#: ../../library/ctypes.rst:1972 msgid "" "Try to find a library and return a pathname. *name* is the library name " "without any prefix like ``lib``, suffix like ``.so``, ``.dylib`` or version " @@ -2035,94 +2037,94 @@ msgid "" "If no library can be found, returns ``None``." msgstr "" -#: ../../library/ctypes.rst:1982 +#: ../../library/ctypes.rst:1983 msgid "" "Windows only: return the filename of the VC runtime library used by Python, " "and by the extension modules. If the name of the library cannot be " "determined, ``None`` is returned." msgstr "" -#: ../../library/ctypes.rst:1986 +#: ../../library/ctypes.rst:1987 msgid "" "If you need to free memory, for example, allocated by an extension module " "with a call to the ``free(void *)``, it is important that you use the " "function in the same library that allocated the memory." msgstr "" -#: ../../library/ctypes.rst:1993 +#: ../../library/ctypes.rst:1994 msgid "" "Windows only: Returns a textual description of the error code *code*. If no " "error code is specified, the last error code is used by calling the Windows " "api function GetLastError." msgstr "" -#: ../../library/ctypes.rst:2000 +#: ../../library/ctypes.rst:2001 msgid "" "Windows only: Returns the last error code set by Windows in the calling " "thread. This function calls the Windows ``GetLastError()`` function " "directly, it does not return the ctypes-private copy of the error code." msgstr "" -#: ../../library/ctypes.rst:2006 +#: ../../library/ctypes.rst:2007 msgid "" "Returns the current value of the ctypes-private copy of the system :data:" "`errno` variable in the calling thread." msgstr "" -#: ../../library/ctypes.rst:2009 +#: ../../library/ctypes.rst:2010 msgid "" "Raises an :ref:`auditing event ` ``ctypes.get_errno`` with no " "arguments." msgstr "" "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``ctypes.get_errno``。" -#: ../../library/ctypes.rst:2013 +#: ../../library/ctypes.rst:2014 msgid "" "Windows only: returns the current value of the ctypes-private copy of the " "system :data:`!LastError` variable in the calling thread." msgstr "" -#: ../../library/ctypes.rst:2016 +#: ../../library/ctypes.rst:2017 msgid "" "Raises an :ref:`auditing event ` ``ctypes.get_last_error`` with no " "arguments." msgstr "" "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``ctypes.get_last_error``。" -#: ../../library/ctypes.rst:2020 +#: ../../library/ctypes.rst:2021 msgid "" "Same as the standard C memmove library function: copies *count* bytes from " "*src* to *dst*. *dst* and *src* must be integers or ctypes instances that " "can be converted to pointers." msgstr "" -#: ../../library/ctypes.rst:2027 +#: ../../library/ctypes.rst:2028 msgid "" "Same as the standard C memset library function: fills the memory block at " "address *dst* with *count* bytes of value *c*. *dst* must be an integer " "specifying an address, or a ctypes instance." msgstr "" -#: ../../library/ctypes.rst:2034 +#: ../../library/ctypes.rst:2035 msgid "" "Create and return a new ctypes pointer type. Pointer types are cached and " "reused internally, so calling this function repeatedly is cheap. *type* must " "be a ctypes type." msgstr "" -#: ../../library/ctypes.rst:2041 +#: ../../library/ctypes.rst:2042 msgid "" "Create a new pointer instance, pointing to *obj*. The returned object is of " "the type ``POINTER(type(obj))``." msgstr "" -#: ../../library/ctypes.rst:2044 +#: ../../library/ctypes.rst:2045 msgid "" "Note: If you just want to pass a pointer to an object to a foreign function " "call, you should use ``byref(obj)`` which is much faster." msgstr "" -#: ../../library/ctypes.rst:2050 +#: ../../library/ctypes.rst:2051 msgid "" "This function resizes the internal memory buffer of *obj*, which must be an " "instance of a ctypes type. It is not possible to make the buffer smaller " @@ -2130,13 +2132,13 @@ msgid "" "but it is possible to enlarge the buffer." msgstr "" -#: ../../library/ctypes.rst:2058 +#: ../../library/ctypes.rst:2059 msgid "" "Set the current value of the ctypes-private copy of the system :data:`errno` " "variable in the calling thread to *value* and return the previous value." msgstr "" -#: ../../library/ctypes.rst:2061 +#: ../../library/ctypes.rst:2062 msgid "" "Raises an :ref:`auditing event ` ``ctypes.set_errno`` with " "argument ``errno``." @@ -2144,14 +2146,14 @@ msgstr "" "引發一個附帶引數 ``errno`` 的\\ :ref:`稽核事件 ` ``ctypes." "set_errno``。" -#: ../../library/ctypes.rst:2066 +#: ../../library/ctypes.rst:2067 msgid "" "Windows only: set the current value of the ctypes-private copy of the " "system :data:`!LastError` variable in the calling thread to *value* and " "return the previous value." msgstr "" -#: ../../library/ctypes.rst:2070 +#: ../../library/ctypes.rst:2071 msgid "" "Raises an :ref:`auditing event ` ``ctypes.set_last_error`` with " "argument ``error``." @@ -2159,20 +2161,20 @@ msgstr "" "引發一個附帶引數 ``error`` 的\\ :ref:`稽核事件 ` ``ctypes." "get_last_error``。" -#: ../../library/ctypes.rst:2075 +#: ../../library/ctypes.rst:2076 msgid "" "Returns the size in bytes of a ctypes type or instance memory buffer. Does " "the same as the C ``sizeof`` operator." msgstr "" -#: ../../library/ctypes.rst:2081 +#: ../../library/ctypes.rst:2082 msgid "" "This function returns the C string starting at memory address *address* as a " "bytes object. If size is specified, it is used as size, otherwise the string " "is assumed to be zero-terminated." msgstr "" -#: ../../library/ctypes.rst:2085 +#: ../../library/ctypes.rst:2086 msgid "" "Raises an :ref:`auditing event ` ``ctypes.string_at`` with " "arguments ``address``, ``size``." @@ -2180,20 +2182,22 @@ msgstr "" "引發一個附帶引數 ``error``、``size`` 的\\ :ref:`稽核事件 ` " "``ctypes.string_at``。" -#: ../../library/ctypes.rst:2090 +#: ../../library/ctypes.rst:2091 msgid "" "Windows only: this function is probably the worst-named thing in ctypes. It " -"creates an instance of OSError. If *code* is not specified, " +"creates an instance of :exc:`OSError`. If *code* is not specified, " "``GetLastError`` is called to determine the error code. If *descr* is not " "specified, :func:`FormatError` is called to get a textual description of the " "error." msgstr "" -#: ../../library/ctypes.rst:2096 -msgid "An instance of :exc:`WindowsError` used to be created." +#: ../../library/ctypes.rst:2097 +msgid "" +"An instance of :exc:`WindowsError` used to be created, which is now an alias " +"of :exc:`OSError`." msgstr "" -#: ../../library/ctypes.rst:2102 +#: ../../library/ctypes.rst:2104 msgid "" "This function returns the wide character string starting at memory address " "*address* as a string. If *size* is specified, it is used as the number of " @@ -2201,7 +2205,7 @@ msgid "" "terminated." msgstr "" -#: ../../library/ctypes.rst:2107 +#: ../../library/ctypes.rst:2109 msgid "" "Raises an :ref:`auditing event ` ``ctypes.wstring_at`` with " "arguments ``address``, ``size``." @@ -2209,11 +2213,11 @@ msgstr "" "引發一個附帶引數 ``address``、``size`` 的\\ :ref:`稽核事件 ` " "``ctypes.wstring_at``。" -#: ../../library/ctypes.rst:2113 +#: ../../library/ctypes.rst:2115 msgid "Data types" msgstr "" -#: ../../library/ctypes.rst:2118 +#: ../../library/ctypes.rst:2120 msgid "" "This non-public class is the common base class of all ctypes data types. " "Among other things, all ctypes type instances contain a memory block that " @@ -2223,13 +2227,13 @@ msgid "" "alive in case the memory block contains pointers." msgstr "" -#: ../../library/ctypes.rst:2125 +#: ../../library/ctypes.rst:2127 msgid "" "Common methods of ctypes data types, these are all class methods (to be " "exact, they are methods of the :term:`metaclass`):" msgstr "" -#: ../../library/ctypes.rst:2130 +#: ../../library/ctypes.rst:2132 msgid "" "This method returns a ctypes instance that shares the buffer of the *source* " "object. The *source* object must support the writeable buffer interface. " @@ -2238,7 +2242,7 @@ msgid "" "exc:`ValueError` is raised." msgstr "" -#: ../../library/ctypes.rst:2136 ../../library/ctypes.rst:2146 +#: ../../library/ctypes.rst:2138 ../../library/ctypes.rst:2148 msgid "" "Raises an :ref:`auditing event ` ``ctypes.cdata/buffer`` with " "arguments ``pointer``, ``size``, ``offset``." @@ -2246,7 +2250,7 @@ msgstr "" "引發一個附帶引數 ``pointer``、``size``、``offset`` 的\\ :ref:`稽核事件 " "` ``ctypes.cdata/buffer``。" -#: ../../library/ctypes.rst:2140 +#: ../../library/ctypes.rst:2142 msgid "" "This method creates a ctypes instance, copying the buffer from the *source* " "object buffer which must be readable. The optional *offset* parameter " @@ -2254,13 +2258,13 @@ msgid "" "If the source buffer is not large enough a :exc:`ValueError` is raised." msgstr "" -#: ../../library/ctypes.rst:2150 +#: ../../library/ctypes.rst:2152 msgid "" "This method returns a ctypes type instance using the memory specified by " "*address* which must be an integer." msgstr "" -#: ../../library/ctypes.rst:2153 +#: ../../library/ctypes.rst:2155 msgid "" "Raises an :ref:`auditing event ` ``ctypes.cdata`` with argument " "``address``." @@ -2268,13 +2272,13 @@ msgstr "" "引發一個附帶引數 ``address`` 的\\ :ref:`稽核事件 ` ``ctypes." "cdata``。" -#: ../../library/ctypes.rst:2155 +#: ../../library/ctypes.rst:2157 msgid "" "This method, and others that indirectly call this method, raises an :ref:" "`auditing event ` ``ctypes.cdata`` with argument ``address``." msgstr "" -#: ../../library/ctypes.rst:2161 +#: ../../library/ctypes.rst:2163 msgid "" "This method adapts *obj* to a ctypes type. It is called with the actual " "object used in a foreign function call when the type is present in the " @@ -2282,25 +2286,25 @@ msgid "" "object that can be used as a function call parameter." msgstr "" -#: ../../library/ctypes.rst:2166 +#: ../../library/ctypes.rst:2168 msgid "" "All ctypes data types have a default implementation of this classmethod that " "normally returns *obj* if that is an instance of the type. Some types " "accept other objects as well." msgstr "" -#: ../../library/ctypes.rst:2172 +#: ../../library/ctypes.rst:2174 msgid "" "This method returns a ctypes type instance exported by a shared library. " "*name* is the name of the symbol that exports the data, *library* is the " "loaded shared library." msgstr "" -#: ../../library/ctypes.rst:2176 +#: ../../library/ctypes.rst:2178 msgid "Common instance variables of ctypes data types:" msgstr "" -#: ../../library/ctypes.rst:2180 +#: ../../library/ctypes.rst:2182 msgid "" "Sometimes ctypes data instances do not own the memory block they contain, " "instead they share part of the memory block of a base object. The :attr:" @@ -2308,13 +2312,13 @@ msgid "" "block." msgstr "" -#: ../../library/ctypes.rst:2187 +#: ../../library/ctypes.rst:2189 msgid "" "This read-only variable is true when the ctypes data instance has allocated " "the memory block itself, false otherwise." msgstr "" -#: ../../library/ctypes.rst:2192 +#: ../../library/ctypes.rst:2194 msgid "" "This member is either ``None`` or a dictionary containing Python objects " "that need to be kept alive so that the memory block contents is kept valid. " @@ -2322,7 +2326,7 @@ msgid "" "dictionary." msgstr "" -#: ../../library/ctypes.rst:2205 +#: ../../library/ctypes.rst:2207 msgid "" "This non-public class is the base class of all fundamental ctypes data " "types. It is mentioned here because it contains the common attributes of the " @@ -2331,11 +2335,11 @@ msgid "" "types that are not and do not contain pointers can now be pickled." msgstr "" -#: ../../library/ctypes.rst:2211 +#: ../../library/ctypes.rst:2213 msgid "Instances have a single attribute:" msgstr "" -#: ../../library/ctypes.rst:2215 +#: ../../library/ctypes.rst:2217 msgid "" "This attribute contains the actual value of the instance. For integer and " "pointer types, it is an integer, for character types, it is a single " @@ -2343,7 +2347,7 @@ msgid "" "bytes object or string." msgstr "" -#: ../../library/ctypes.rst:2220 +#: ../../library/ctypes.rst:2222 msgid "" "When the ``value`` attribute is retrieved from a ctypes instance, usually a " "new object is returned each time. :mod:`ctypes` does *not* implement " @@ -2351,7 +2355,7 @@ msgid "" "true for all other ctypes object instances." msgstr "" -#: ../../library/ctypes.rst:2226 +#: ../../library/ctypes.rst:2228 msgid "" "Fundamental data types, when returned as foreign function call results, or, " "for example, by retrieving structure field members or array items, are " @@ -2361,7 +2365,7 @@ msgid "" "instance." msgstr "" -#: ../../library/ctypes.rst:2234 +#: ../../library/ctypes.rst:2236 msgid "" "Subclasses of fundamental data types do *not* inherit this behavior. So, if " "a foreign functions :attr:`!restype` is a subclass of :class:`c_void_p`, you " @@ -2369,25 +2373,25 @@ msgid "" "you can get the value of the pointer by accessing the ``value`` attribute." msgstr "" -#: ../../library/ctypes.rst:2239 +#: ../../library/ctypes.rst:2241 msgid "These are the fundamental ctypes data types:" msgstr "" -#: ../../library/ctypes.rst:2243 +#: ../../library/ctypes.rst:2245 msgid "" "Represents the C :c:expr:`signed char` datatype, and interprets the value as " "small integer. The constructor accepts an optional integer initializer; no " "overflow checking is done." msgstr "" -#: ../../library/ctypes.rst:2250 +#: ../../library/ctypes.rst:2252 msgid "" "Represents the C :c:expr:`char` datatype, and interprets the value as a " "single character. The constructor accepts an optional string initializer, " "the length of the string must be exactly one character." msgstr "" -#: ../../library/ctypes.rst:2257 +#: ../../library/ctypes.rst:2259 msgid "" "Represents the C :c:expr:`char *` datatype when it points to a zero-" "terminated string. For a general character pointer that may also point to " @@ -2395,182 +2399,182 @@ msgid "" "integer address, or a bytes object." msgstr "" -#: ../../library/ctypes.rst:2265 +#: ../../library/ctypes.rst:2267 msgid "" "Represents the C :c:expr:`double` datatype. The constructor accepts an " "optional float initializer." msgstr "" -#: ../../library/ctypes.rst:2271 +#: ../../library/ctypes.rst:2273 msgid "" "Represents the C :c:expr:`long double` datatype. The constructor accepts an " "optional float initializer. On platforms where ``sizeof(long double) == " "sizeof(double)`` it is an alias to :class:`c_double`." msgstr "" -#: ../../library/ctypes.rst:2277 +#: ../../library/ctypes.rst:2279 msgid "" "Represents the C :c:expr:`float` datatype. The constructor accepts an " "optional float initializer." msgstr "" -#: ../../library/ctypes.rst:2283 +#: ../../library/ctypes.rst:2285 msgid "" "Represents the C :c:expr:`signed int` datatype. The constructor accepts an " "optional integer initializer; no overflow checking is done. On platforms " "where ``sizeof(int) == sizeof(long)`` it is an alias to :class:`c_long`." msgstr "" -#: ../../library/ctypes.rst:2290 +#: ../../library/ctypes.rst:2292 msgid "" "Represents the C 8-bit :c:expr:`signed int` datatype. Usually an alias for :" "class:`c_byte`." msgstr "" -#: ../../library/ctypes.rst:2296 +#: ../../library/ctypes.rst:2298 msgid "" "Represents the C 16-bit :c:expr:`signed int` datatype. Usually an alias " "for :class:`c_short`." msgstr "" -#: ../../library/ctypes.rst:2302 +#: ../../library/ctypes.rst:2304 msgid "" "Represents the C 32-bit :c:expr:`signed int` datatype. Usually an alias " "for :class:`c_int`." msgstr "" -#: ../../library/ctypes.rst:2308 +#: ../../library/ctypes.rst:2310 msgid "" "Represents the C 64-bit :c:expr:`signed int` datatype. Usually an alias " "for :class:`c_longlong`." msgstr "" -#: ../../library/ctypes.rst:2314 +#: ../../library/ctypes.rst:2316 msgid "" "Represents the C :c:expr:`signed long` datatype. The constructor accepts an " "optional integer initializer; no overflow checking is done." msgstr "" -#: ../../library/ctypes.rst:2320 +#: ../../library/ctypes.rst:2322 msgid "" "Represents the C :c:expr:`signed long long` datatype. The constructor " "accepts an optional integer initializer; no overflow checking is done." msgstr "" -#: ../../library/ctypes.rst:2326 +#: ../../library/ctypes.rst:2328 msgid "" "Represents the C :c:expr:`signed short` datatype. The constructor accepts " "an optional integer initializer; no overflow checking is done." msgstr "" -#: ../../library/ctypes.rst:2332 +#: ../../library/ctypes.rst:2334 msgid "Represents the C :c:type:`size_t` datatype." msgstr "" -#: ../../library/ctypes.rst:2337 +#: ../../library/ctypes.rst:2339 msgid "Represents the C :c:type:`ssize_t` datatype." msgstr "" -#: ../../library/ctypes.rst:2344 +#: ../../library/ctypes.rst:2346 msgid "Represents the C :c:type:`time_t` datatype." msgstr "" -#: ../../library/ctypes.rst:2351 +#: ../../library/ctypes.rst:2353 msgid "" "Represents the C :c:expr:`unsigned char` datatype, it interprets the value " "as small integer. The constructor accepts an optional integer initializer; " "no overflow checking is done." msgstr "" -#: ../../library/ctypes.rst:2358 +#: ../../library/ctypes.rst:2360 msgid "" "Represents the C :c:expr:`unsigned int` datatype. The constructor accepts " "an optional integer initializer; no overflow checking is done. On platforms " "where ``sizeof(int) == sizeof(long)`` it is an alias for :class:`c_ulong`." msgstr "" -#: ../../library/ctypes.rst:2365 +#: ../../library/ctypes.rst:2367 msgid "" "Represents the C 8-bit :c:expr:`unsigned int` datatype. Usually an alias " "for :class:`c_ubyte`." msgstr "" -#: ../../library/ctypes.rst:2371 +#: ../../library/ctypes.rst:2373 msgid "" "Represents the C 16-bit :c:expr:`unsigned int` datatype. Usually an alias " "for :class:`c_ushort`." msgstr "" -#: ../../library/ctypes.rst:2377 +#: ../../library/ctypes.rst:2379 msgid "" "Represents the C 32-bit :c:expr:`unsigned int` datatype. Usually an alias " "for :class:`c_uint`." msgstr "" -#: ../../library/ctypes.rst:2383 +#: ../../library/ctypes.rst:2385 msgid "" "Represents the C 64-bit :c:expr:`unsigned int` datatype. Usually an alias " "for :class:`c_ulonglong`." msgstr "" -#: ../../library/ctypes.rst:2389 +#: ../../library/ctypes.rst:2391 msgid "" "Represents the C :c:expr:`unsigned long` datatype. The constructor accepts " "an optional integer initializer; no overflow checking is done." msgstr "" -#: ../../library/ctypes.rst:2395 +#: ../../library/ctypes.rst:2397 msgid "" "Represents the C :c:expr:`unsigned long long` datatype. The constructor " "accepts an optional integer initializer; no overflow checking is done." msgstr "" -#: ../../library/ctypes.rst:2401 +#: ../../library/ctypes.rst:2403 msgid "" "Represents the C :c:expr:`unsigned short` datatype. The constructor accepts " "an optional integer initializer; no overflow checking is done." msgstr "" -#: ../../library/ctypes.rst:2407 +#: ../../library/ctypes.rst:2409 msgid "" "Represents the C :c:expr:`void *` type. The value is represented as " "integer. The constructor accepts an optional integer initializer." msgstr "" -#: ../../library/ctypes.rst:2413 +#: ../../library/ctypes.rst:2415 msgid "" "Represents the C :c:type:`wchar_t` datatype, and interprets the value as a " "single character unicode string. The constructor accepts an optional string " "initializer, the length of the string must be exactly one character." msgstr "" -#: ../../library/ctypes.rst:2420 +#: ../../library/ctypes.rst:2422 msgid "" "Represents the C :c:expr:`wchar_t *` datatype, which must be a pointer to a " "zero-terminated wide character string. The constructor accepts an integer " "address, or a string." msgstr "" -#: ../../library/ctypes.rst:2427 +#: ../../library/ctypes.rst:2429 msgid "" "Represent the C :c:expr:`bool` datatype (more accurately, :c:expr:`_Bool` " "from C99). Its value can be ``True`` or ``False``, and the constructor " "accepts any object that has a truth value." msgstr "" -#: ../../library/ctypes.rst:2434 +#: ../../library/ctypes.rst:2436 msgid "" "Windows only: Represents a :c:type:`!HRESULT` value, which contains success " "or error information for a function or method call." msgstr "" -#: ../../library/ctypes.rst:2440 +#: ../../library/ctypes.rst:2442 msgid "" "Represents the C :c:expr:`PyObject *` datatype. Calling this without an " "argument creates a ``NULL`` :c:expr:`PyObject *` pointer." msgstr "" -#: ../../library/ctypes.rst:2443 +#: ../../library/ctypes.rst:2445 msgid "" "The :mod:`!ctypes.wintypes` module provides quite some other Windows " "specific data types, for example :c:type:`!HWND`, :c:type:`!WPARAM`, or :c:" @@ -2578,41 +2582,41 @@ msgid "" "are also defined." msgstr "" -#: ../../library/ctypes.rst:2451 +#: ../../library/ctypes.rst:2453 msgid "Structured data types" msgstr "" -#: ../../library/ctypes.rst:2456 +#: ../../library/ctypes.rst:2458 msgid "Abstract base class for unions in native byte order." msgstr "" -#: ../../library/ctypes.rst:2461 +#: ../../library/ctypes.rst:2463 msgid "Abstract base class for unions in *big endian* byte order." msgstr "" -#: ../../library/ctypes.rst:2467 +#: ../../library/ctypes.rst:2469 msgid "Abstract base class for unions in *little endian* byte order." msgstr "" -#: ../../library/ctypes.rst:2473 +#: ../../library/ctypes.rst:2475 msgid "Abstract base class for structures in *big endian* byte order." msgstr "" -#: ../../library/ctypes.rst:2478 +#: ../../library/ctypes.rst:2480 msgid "Abstract base class for structures in *little endian* byte order." msgstr "" -#: ../../library/ctypes.rst:2480 +#: ../../library/ctypes.rst:2482 msgid "" "Structures and unions with non-native byte order cannot contain pointer type " "fields, or any other data types containing pointer type fields." msgstr "" -#: ../../library/ctypes.rst:2486 +#: ../../library/ctypes.rst:2488 msgid "Abstract base class for structures in *native* byte order." msgstr "" -#: ../../library/ctypes.rst:2488 +#: ../../library/ctypes.rst:2490 msgid "" "Concrete structure and union types must be created by subclassing one of " "these types, and at least define a :attr:`_fields_` class variable. :mod:" @@ -2620,34 +2624,34 @@ msgid "" "the fields by direct attribute accesses. These are the" msgstr "" -#: ../../library/ctypes.rst:2496 +#: ../../library/ctypes.rst:2498 msgid "" "A sequence defining the structure fields. The items must be 2-tuples or 3-" "tuples. The first item is the name of the field, the second item specifies " "the type of the field; it can be any ctypes data type." msgstr "" -#: ../../library/ctypes.rst:2500 +#: ../../library/ctypes.rst:2502 msgid "" "For integer type fields like :class:`c_int`, a third optional item can be " "given. It must be a small positive integer defining the bit width of the " "field." msgstr "" -#: ../../library/ctypes.rst:2504 +#: ../../library/ctypes.rst:2506 msgid "" "Field names must be unique within one structure or union. This is not " "checked, only one field can be accessed when names are repeated." msgstr "" -#: ../../library/ctypes.rst:2507 +#: ../../library/ctypes.rst:2509 msgid "" "It is possible to define the :attr:`_fields_` class variable *after* the " "class statement that defines the Structure subclass, this allows creating " "data types that directly or indirectly reference themselves::" msgstr "" -#: ../../library/ctypes.rst:2517 +#: ../../library/ctypes.rst:2519 msgid "" "The :attr:`_fields_` class variable must, however, be defined before the " "type is first used (an instance is created, :func:`sizeof` is called on it, " @@ -2655,14 +2659,14 @@ msgid "" "raise an AttributeError." msgstr "" -#: ../../library/ctypes.rst:2522 +#: ../../library/ctypes.rst:2524 msgid "" "It is possible to define sub-subclasses of structure types, they inherit the " "fields of the base class plus the :attr:`_fields_` defined in the sub-" "subclass, if any." msgstr "" -#: ../../library/ctypes.rst:2529 +#: ../../library/ctypes.rst:2531 msgid "" "An optional small integer that allows overriding the alignment of structure " "fields in the instance. :attr:`_pack_` must already be defined when :attr:" @@ -2670,14 +2674,14 @@ msgid "" "attribute to 0 is the same as not setting it at all." msgstr "" -#: ../../library/ctypes.rst:2537 +#: ../../library/ctypes.rst:2539 msgid "" "An optional sequence that lists the names of unnamed (anonymous) fields. :" "attr:`_anonymous_` must be already defined when :attr:`_fields_` is " "assigned, otherwise it will have no effect." msgstr "" -#: ../../library/ctypes.rst:2541 +#: ../../library/ctypes.rst:2543 msgid "" "The fields listed in this variable must be structure or union type fields. :" "mod:`ctypes` will create descriptors in the structure type that allows " @@ -2685,11 +2689,11 @@ msgid "" "structure or union field." msgstr "" -#: ../../library/ctypes.rst:2546 +#: ../../library/ctypes.rst:2548 msgid "Here is an example type (Windows)::" msgstr "" -#: ../../library/ctypes.rst:2559 +#: ../../library/ctypes.rst:2561 msgid "" "The ``TYPEDESC`` structure describes a COM data type, the ``vt`` field " "specifies which one of the union fields is valid. Since the ``u`` field is " @@ -2699,7 +2703,7 @@ msgid "" "temporary union instance::" msgstr "" -#: ../../library/ctypes.rst:2571 +#: ../../library/ctypes.rst:2573 msgid "" "It is possible to define sub-subclasses of structures, they inherit the " "fields of the base class. If the subclass definition has a separate :attr:" @@ -2707,7 +2711,7 @@ msgid "" "of the base class." msgstr "" -#: ../../library/ctypes.rst:2576 +#: ../../library/ctypes.rst:2578 msgid "" "Structure and union constructors accept both positional and keyword " "arguments. Positional arguments are used to initialize member fields in the " @@ -2717,15 +2721,15 @@ msgid "" "names not present in :attr:`_fields_`." msgstr "" -#: ../../library/ctypes.rst:2587 +#: ../../library/ctypes.rst:2589 msgid "Arrays and pointers" msgstr "" -#: ../../library/ctypes.rst:2591 +#: ../../library/ctypes.rst:2593 msgid "Abstract base class for arrays." msgstr "" -#: ../../library/ctypes.rst:2593 +#: ../../library/ctypes.rst:2595 msgid "" "The recommended way to create concrete array types is by multiplying any :" "mod:`ctypes` data type with a non-negative integer. Alternatively, you can " @@ -2735,34 +2739,34 @@ msgid "" "an :class:`Array`." msgstr "" -#: ../../library/ctypes.rst:2603 +#: ../../library/ctypes.rst:2605 msgid "" "A positive integer specifying the number of elements in the array. Out-of-" "range subscripts result in an :exc:`IndexError`. Will be returned by :func:" "`len`." msgstr "" -#: ../../library/ctypes.rst:2610 +#: ../../library/ctypes.rst:2612 msgid "Specifies the type of each element in the array." msgstr "" -#: ../../library/ctypes.rst:2613 +#: ../../library/ctypes.rst:2615 msgid "" "Array subclass constructors accept positional arguments, used to initialize " "the elements in order." msgstr "" -#: ../../library/ctypes.rst:2619 +#: ../../library/ctypes.rst:2621 msgid "Private, abstract base class for pointers." msgstr "" -#: ../../library/ctypes.rst:2621 +#: ../../library/ctypes.rst:2623 msgid "" "Concrete pointer types are created by calling :func:`POINTER` with the type " "that will be pointed to; this is done automatically by :func:`pointer`." msgstr "" -#: ../../library/ctypes.rst:2625 +#: ../../library/ctypes.rst:2627 msgid "" "If a pointer points to an array, its elements can be read and written using " "standard subscript and slice accesses. Pointer objects have no size, so :" @@ -2771,11 +2775,11 @@ msgid "" "probably crash with an access violation (if you're lucky)." msgstr "" -#: ../../library/ctypes.rst:2635 +#: ../../library/ctypes.rst:2637 msgid "Specifies the type pointed to." msgstr "" -#: ../../library/ctypes.rst:2639 +#: ../../library/ctypes.rst:2641 msgid "" "Returns the object to which to pointer points. Assigning to this attribute " "changes the pointer to point to the assigned object." diff --git a/library/dataclasses.po b/library/dataclasses.po index 4bd6371f89..592d18ef66 100644 --- a/library/dataclasses.po +++ b/library/dataclasses.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-24 00:03+0000\n" +"POT-Creation-Date: 2023-10-12 00:03+0000\n" "PO-Revision-Date: 2023-02-11 15:02+0800\n" "Last-Translator: \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -565,12 +565,12 @@ msgstr "" msgid "``name``: The name of the field." msgstr "``name``:欄位的名稱。" -#: ../../library/dataclasses.rst:324 +#: ../../library/dataclasses.rst:323 #, fuzzy msgid "``type``: The type of the field." msgstr "``type``:欄位的型別。" -#: ../../library/dataclasses.rst:326 +#: ../../library/dataclasses.rst:324 #, fuzzy msgid "" "``default``, ``default_factory``, ``init``, ``repr``, ``hash``, ``compare``, " @@ -580,14 +580,14 @@ msgstr "" "``default``、``default_factory``、``init``、``repr``、``hash``、``compare``、" "``metadata`` 和 ``kw_only`` 有與它們在 :func:`field` 函式中的含義和值相同。" -#: ../../library/dataclasses.rst:330 +#: ../../library/dataclasses.rst:328 #, fuzzy msgid "" "Other attributes may exist, but they are private and must not be inspected " "or relied on." msgstr "可能存在其他屬性,但它們是私有的,不得檢查或依賴。" -#: ../../library/dataclasses.rst:335 +#: ../../library/dataclasses.rst:333 #, fuzzy msgid "" "Returns a tuple of :class:`Field` objects that define the fields for this " @@ -599,7 +599,7 @@ msgstr "" "如果未傳遞資料類或其中一個實例,則引發 :exc:`TypeError`。不回傳 ``ClassVar`` " "或 ``InitVar`` 的偽欄位。" -#: ../../library/dataclasses.rst:342 +#: ../../library/dataclasses.rst:340 #, fuzzy msgid "" "Converts the dataclass ``obj`` to a dict (by using the factory function " @@ -611,24 +611,24 @@ msgstr "" "為其欄位的字典,作為“名稱:值”對。資料類、字典、列表和元組被遞迴到。其他物件" "使用 :func:`copy.deepcopy` 複製。" -#: ../../library/dataclasses.rst:348 +#: ../../library/dataclasses.rst:346 #, fuzzy msgid "Example of using :func:`asdict` on nested dataclasses::" msgstr "在嵌套資料類上使用 :func:`asdict` 的示例::" -#: ../../library/dataclasses.rst:365 ../../library/dataclasses.rst:385 +#: ../../library/dataclasses.rst:363 ../../library/dataclasses.rst:383 #, fuzzy msgid "To create a shallow copy, the following workaround may be used::" msgstr "要建立淺拷貝,可以使用以下解決方法:" -#: ../../library/dataclasses.rst:369 +#: ../../library/dataclasses.rst:367 #, fuzzy msgid "" ":func:`asdict` raises :exc:`TypeError` if ``obj`` is not a dataclass " "instance." msgstr ":func:`asdict` 如果 ``obj`` 不是資料類實例,則引發 :exc:`TypeError`。" -#: ../../library/dataclasses.rst:374 +#: ../../library/dataclasses.rst:372 #, fuzzy msgid "" "Converts the dataclass ``obj`` to a tuple (by using the factory function " @@ -640,19 +640,19 @@ msgstr "" "換為其欄位值的元組。資料類、字典、列表和元組被遞迴到。其他物件使用 :func:" "`copy.deepcopy` 複製。" -#: ../../library/dataclasses.rst:380 +#: ../../library/dataclasses.rst:378 #, fuzzy msgid "Continuing from the previous example::" msgstr "從前面的例子繼續:" -#: ../../library/dataclasses.rst:389 +#: ../../library/dataclasses.rst:387 #, fuzzy msgid "" ":func:`astuple` raises :exc:`TypeError` if ``obj`` is not a dataclass " "instance." msgstr ":func:`astuple` 如果 ``obj`` 不是資料類實例,則引發 :exc:`TypeError`。" -#: ../../library/dataclasses.rst:394 +#: ../../library/dataclasses.rst:392 #, fuzzy msgid "" "Creates a new dataclass with name ``cls_name``, fields as defined in " @@ -671,13 +671,13 @@ msgstr "" "``order``、``unsafe_hash``、``frozen``、``match_args``、``kw_only`` 的值, " "``slots`` 和 ``weakref_slot`` 與它們在 :func:`dataclass` 中的含義相同。" -#: ../../library/dataclasses.rst:404 +#: ../../library/dataclasses.rst:402 msgid "" "If ``module`` is defined, the ``__module__`` attribute of the dataclass is " "set to that value. By default, it is set to the module name of the caller." msgstr "" -#: ../../library/dataclasses.rst:408 +#: ../../library/dataclasses.rst:406 #, fuzzy msgid "" "This function is not strictly required, because any Python mechanism for " @@ -689,12 +689,12 @@ msgstr "" "制都可以應用 :func:`dataclass` 函式將該類轉換為資料類。提供此功能是為了方便。" "例如::" -#: ../../library/dataclasses.rst:420 +#: ../../library/dataclasses.rst:418 #, fuzzy msgid "Is equivalent to::" msgstr "相當於::" -#: ../../library/dataclasses.rst:433 +#: ../../library/dataclasses.rst:431 #, fuzzy msgid "" "Creates a new object of the same type as ``obj``, replacing fields with " @@ -706,7 +706,7 @@ msgstr "" "``obj`` 不是資料類,則引發 :exc:`TypeError`。如果 ``changes`` 中的值未指定欄" "位,則引發:exc:`TypeError`。" -#: ../../library/dataclasses.rst:438 +#: ../../library/dataclasses.rst:436 #, fuzzy msgid "" "The newly returned object is created by calling the :meth:`~object.__init__` " @@ -716,7 +716,7 @@ msgstr "" "新回傳的對像是通過呼叫資料類的 :meth:`__init__` 方法建立的。這確保 :meth:" "`__post_init__`(如果存在)也被呼叫。" -#: ../../library/dataclasses.rst:442 +#: ../../library/dataclasses.rst:440 #, fuzzy msgid "" "Init-only variables without default values, if any exist, must be specified " @@ -726,7 +726,7 @@ msgstr "" "沒有預設值的僅初始化變數(如果存在)必須在呼叫 :func:`replace` 時指定,以便它" "們可以傳遞給 :meth:`__init__` 和 :meth:`__post_init__`。" -#: ../../library/dataclasses.rst:446 +#: ../../library/dataclasses.rst:444 #, fuzzy msgid "" "It is an error for ``changes`` to contain any fields that are defined as " @@ -735,7 +735,7 @@ msgstr "" "``changes`` 包含任何定義為具有 ``init=False`` 的欄位是錯誤的。在這種情況下將" "引發 :exc:`ValueError`。" -#: ../../library/dataclasses.rst:450 +#: ../../library/dataclasses.rst:448 #, fuzzy msgid "" "Be forewarned about how ``init=False`` fields work during a call to :func:" @@ -752,14 +752,14 @@ msgstr "" "造函式可能是明智的,或者可能是處理實例複製的自定義“replace()”(或類似命名的)" "方法。" -#: ../../library/dataclasses.rst:461 +#: ../../library/dataclasses.rst:459 #, fuzzy msgid "" "Return ``True`` if its parameter is a dataclass or an instance of one, " "otherwise return ``False``." msgstr "如果它的參數是一個資料類或一個實例,則回傳“True”,否則回傳“False”。" -#: ../../library/dataclasses.rst:464 +#: ../../library/dataclasses.rst:462 #, fuzzy msgid "" "If you need to know if a class is an instance of a dataclass (and not a " @@ -769,12 +769,12 @@ msgstr "" "如果你需要知道一個類是否是資料類的實例(而不是資料類本身),那麼新增一個進一" "步的檢查``not isinstance(obj, type)``::" -#: ../../library/dataclasses.rst:473 +#: ../../library/dataclasses.rst:471 #, fuzzy msgid "A sentinel value signifying a missing default or default_factory." msgstr "表示缺少預設值或 default_factory 的標記值。" -#: ../../library/dataclasses.rst:477 +#: ../../library/dataclasses.rst:475 #, fuzzy msgid "" "A sentinel value used as a type annotation. Any fields after a pseudo-field " @@ -790,21 +790,21 @@ msgstr "" "例,名稱 _ 用於 :const: `KW_ONLY` 欄位。僅關鍵字欄位表示 :meth:`__init__` 參" "數,在實例化類時必須將其指定為關鍵字。" -#: ../../library/dataclasses.rst:486 +#: ../../library/dataclasses.rst:484 #, fuzzy msgid "" "In this example, the fields ``y`` and ``z`` will be marked as keyword-only " "fields::" msgstr "在此示例中,欄位 ``y`` 和 ``z`` 將被標記為僅關鍵字欄位::" -#: ../../library/dataclasses.rst:497 +#: ../../library/dataclasses.rst:495 #, fuzzy msgid "" "In a single dataclass, it is an error to specify more than one field whose " "type is :const:`KW_ONLY`." msgstr "在單個資料類中,指定多個型別為 KW_ONLY 的欄位是錯誤的。" -#: ../../library/dataclasses.rst:504 +#: ../../library/dataclasses.rst:502 #, fuzzy msgid "" "Raised when an implicitly defined :meth:`~object.__setattr__` or :meth:" @@ -814,12 +814,12 @@ msgstr "" "當在使用 frozen=True 定義的資料類上呼叫隱式定義的 :meth:`__setattr__` 或 :" "meth:`__delattr__` 時引發。它是 :exc:`AttributeError` 的子類別。" -#: ../../library/dataclasses.rst:511 +#: ../../library/dataclasses.rst:509 #, fuzzy msgid "Post-init processing" msgstr "初始化後處理" -#: ../../library/dataclasses.rst:515 +#: ../../library/dataclasses.rst:513 #, fuzzy msgid "" "When defined on the class, it will be called by the generated :meth:`~object." @@ -834,7 +834,7 @@ msgstr "" "類中定義的順序傳遞給 :meth:`__post_init__` 。如果沒有生成 :meth:`__init__` 方" "法,那麼 :meth:`__post_init__` 將不會被自動呼叫。" -#: ../../library/dataclasses.rst:522 +#: ../../library/dataclasses.rst:520 #, fuzzy msgid "" "Among other uses, this allows for initializing field values that depend on " @@ -843,7 +843,7 @@ msgstr "" "在其他用途\\u200b\\u200b中,這允許初始化依賴於一個或多個其他欄位的欄位值。例" "如::" -#: ../../library/dataclasses.rst:534 +#: ../../library/dataclasses.rst:532 #, fuzzy msgid "" "The :meth:`~object.__init__` method generated by :func:`dataclass` does not " @@ -855,7 +855,7 @@ msgstr "" "方法。如果基底類別有一個必須呼叫的 :meth:`__init__` 方法,通常在 :meth:" "`__post_init__` 方法中呼叫此方法::" -#: ../../library/dataclasses.rst:551 +#: ../../library/dataclasses.rst:549 #, fuzzy msgid "" "Note, however, that in general the dataclass-generated :meth:`~object." @@ -866,7 +866,7 @@ msgstr "" "但是請注意,通常不需要呼叫資料類生成的 :meth:`__init__` 方法,因為派生資料類" "將負責初始化作為資料類本身的任何基底類別的所有欄位。" -#: ../../library/dataclasses.rst:555 +#: ../../library/dataclasses.rst:553 #, fuzzy msgid "" "See the section below on init-only variables for ways to pass parameters to :" @@ -876,12 +876,12 @@ msgstr "" "請參閱下面有關僅初始化變數的部分,了解將參數傳遞給 :meth:`__post_init__` 的方" "法。另請參閱有關 :func:`replace` 如何處理 ``init=False`` 欄位的警告。" -#: ../../library/dataclasses.rst:560 +#: ../../library/dataclasses.rst:558 #, fuzzy msgid "Class variables" msgstr "類變數" -#: ../../library/dataclasses.rst:562 +#: ../../library/dataclasses.rst:560 #, fuzzy msgid "" "One of the few places where :func:`dataclass` actually inspects the type of " @@ -896,12 +896,12 @@ msgstr "" "一個欄位是一個“ClassVar”,它就被排除在考慮之外,並被資料類機制忽略。模組級 :" "func:`fields` 函式不會回傳此類 ``ClassVar`` 偽欄位。" -#: ../../library/dataclasses.rst:571 +#: ../../library/dataclasses.rst:569 #, fuzzy msgid "Init-only variables" msgstr "僅初始化變數" -#: ../../library/dataclasses.rst:573 +#: ../../library/dataclasses.rst:571 #, fuzzy msgid "" "Another place where :func:`dataclass` inspects a type annotation is to " @@ -920,14 +920,14 @@ msgstr "" "meth:`__init__` 方法,並傳遞給可選的 :meth:`__post_init__` 方法。它們不被資料" "類使用。" -#: ../../library/dataclasses.rst:583 +#: ../../library/dataclasses.rst:581 #, fuzzy msgid "" "For example, suppose a field will be initialized from a database, if a value " "is not provided when creating the class::" msgstr "例如,假設一個欄位將從資料庫中初始化,如果在建立類時沒有提供值::" -#: ../../library/dataclasses.rst:598 +#: ../../library/dataclasses.rst:596 #, fuzzy msgid "" "In this case, :func:`fields` will return :class:`Field` objects for ``i`` " @@ -936,12 +936,12 @@ msgstr "" "在這種情況下,:func:`fields` 將為 ``i`` 和 ``j`` 回傳 :class:`Field` 物件,但" "不會為 ``database`` 回傳。" -#: ../../library/dataclasses.rst:602 +#: ../../library/dataclasses.rst:600 #, fuzzy msgid "Frozen instances" msgstr "凍結實例" -#: ../../library/dataclasses.rst:604 +#: ../../library/dataclasses.rst:602 #, fuzzy msgid "" "It is not possible to create truly immutable Python objects. However, by " @@ -955,7 +955,7 @@ msgstr "" "meth:`__setattr__` 和 :meth:`__delattr__` 方法。這些方法在呼叫時會引發:exc:" "`FrozenInstanceError`。" -#: ../../library/dataclasses.rst:610 +#: ../../library/dataclasses.rst:608 #, fuzzy msgid "" "There is a tiny performance penalty when using ``frozen=True``: :meth:" @@ -965,12 +965,12 @@ msgstr "" "使用 ``frozen=True`` 時有一個微小的性能損失::meth:`__init__` 不能使用簡單賦" "值來初始化欄位,必須使用 :meth:`object.__setattr__`。" -#: ../../library/dataclasses.rst:615 +#: ../../library/dataclasses.rst:613 #, fuzzy msgid "Inheritance" msgstr "遺產" -#: ../../library/dataclasses.rst:617 +#: ../../library/dataclasses.rst:615 #, fuzzy msgid "" "When the dataclass is being created by the :meth:`dataclass` decorator, it " @@ -988,7 +988,7 @@ msgstr "" "增到有序映射中。所有生成的方法都將使用這種組合的、計算的有序欄位映射。因為欄" "位是按插入順序排列的,所以派生類會覆蓋基底類別。一個例子::" -#: ../../library/dataclasses.rst:637 +#: ../../library/dataclasses.rst:635 #, fuzzy msgid "" "The final list of fields is, in order, ``x``, ``y``, ``z``. The final type " @@ -997,18 +997,18 @@ msgstr "" "最終的欄位列表按順序為“x”、“y”、“z”。 ``x`` 的最終型別是 ``int``,如類 ``C`` " "中指定的那樣。" -#: ../../library/dataclasses.rst:640 +#: ../../library/dataclasses.rst:638 #, fuzzy msgid "" "The generated :meth:`~object.__init__` method for ``C`` will look like::" msgstr "為 ``C`` 生成的 :meth:`__init__` 方法將如下所示:" -#: ../../library/dataclasses.rst:645 +#: ../../library/dataclasses.rst:643 #, fuzzy msgid "Re-ordering of keyword-only parameters in :meth:`~object.__init__`" msgstr ":meth:`__init__` 中僅關鍵字參數的重新排序" -#: ../../library/dataclasses.rst:647 +#: ../../library/dataclasses.rst:645 #, fuzzy msgid "" "After the parameters needed for :meth:`~object.__init__` are computed, any " @@ -1020,7 +1020,7 @@ msgstr "" "僅關鍵字)參數之後。這是如何在 Python 中實作僅關鍵字參數的要求:它們必須位於" "非僅關鍵字參數之後。" -#: ../../library/dataclasses.rst:653 +#: ../../library/dataclasses.rst:651 #, fuzzy msgid "" "In this example, ``Base.y``, ``Base.w``, and ``D.t`` are keyword-only " @@ -1029,13 +1029,13 @@ msgstr "" "在此示例中,``Base.y``、``Base.w`` 和``D.t`` 是僅限關鍵字的欄位,``Base.x`` " "和``D.z`` 是常規欄位: :" -#: ../../library/dataclasses.rst:668 +#: ../../library/dataclasses.rst:666 #, fuzzy msgid "" "The generated :meth:`~object.__init__` method for ``D`` will look like::" msgstr "為 ``D`` 生成的 :meth:`__init__` 方法將如下所示:" -#: ../../library/dataclasses.rst:672 +#: ../../library/dataclasses.rst:670 #, fuzzy msgid "" "Note that the parameters have been re-ordered from how they appear in the " @@ -1045,19 +1045,19 @@ msgstr "" "請注意,參數已根據它們在欄位列表中的顯示方式重新排序:從常規欄位派生的參數後" "跟從僅關鍵字欄位派生的參數。" -#: ../../library/dataclasses.rst:676 +#: ../../library/dataclasses.rst:674 #, fuzzy msgid "" "The relative ordering of keyword-only parameters is maintained in the re-" "ordered :meth:`~object.__init__` parameter list." msgstr "僅關鍵字參數的相對順序在重新排序的 :meth:`__init__` 參數列表中維護。" -#: ../../library/dataclasses.rst:681 +#: ../../library/dataclasses.rst:679 #, fuzzy msgid "Default factory functions" msgstr "預設工廠函式" -#: ../../library/dataclasses.rst:683 +#: ../../library/dataclasses.rst:681 #, fuzzy msgid "" "If a :func:`field` specifies a ``default_factory``, it is called with zero " @@ -1067,7 +1067,7 @@ msgstr "" "如果 :func:`field` 指定了 ``default_factory``,當需要該欄位的預設值時,它會以" "零參數呼叫。例如,要建立列表的新實例,請使用:" -#: ../../library/dataclasses.rst:689 +#: ../../library/dataclasses.rst:687 #, fuzzy msgid "" "If a field is excluded from :meth:`~object.__init__` (using ``init=False``) " @@ -1080,35 +1080,35 @@ msgstr "" "了 ``default_factory``,那麼預設工廠函式將始終從生成的 :meth:`__init__ 中呼叫" "`功能。發生這種情況是因為沒有其他方法可以為該欄位賦予初始值。" -#: ../../library/dataclasses.rst:696 +#: ../../library/dataclasses.rst:694 #, fuzzy msgid "Mutable default values" msgstr "可變預設值" -#: ../../library/dataclasses.rst:698 +#: ../../library/dataclasses.rst:696 #, fuzzy msgid "" "Python stores default member variable values in class attributes. Consider " "this example, not using dataclasses::" msgstr "Python 將預設成員變數值存儲在類屬性中。考慮這個例子,不使用資料類::" -#: ../../library/dataclasses.rst:713 +#: ../../library/dataclasses.rst:711 #, fuzzy msgid "" "Note that the two instances of class ``C`` share the same class variable " "``x``, as expected." msgstr "請注意,類“C”的兩個實例共享同一個類變數“x”,正如預期的那樣。" -#: ../../library/dataclasses.rst:716 +#: ../../library/dataclasses.rst:714 #, fuzzy msgid "Using dataclasses, *if* this code was valid::" msgstr "使用資料類,*如果*此程式碼有效::" -#: ../../library/dataclasses.rst:724 +#: ../../library/dataclasses.rst:722 msgid "it would generate code similar to::" msgstr "它會生成類似的程式碼::" -#: ../../library/dataclasses.rst:735 +#: ../../library/dataclasses.rst:733 #, fuzzy msgid "" "This has the same issue as the original example using class ``C``. That is, " @@ -1128,14 +1128,14 @@ msgstr "" "`TypeError`。假設是如果一個值是不可散列的,那麼它就是可變的。這是一個部分解決" "方案,但它確實可以防止許多常見錯誤。" -#: ../../library/dataclasses.rst:746 +#: ../../library/dataclasses.rst:744 #, fuzzy msgid "" "Using default factory functions is a way to create new instances of mutable " "types as default values for fields::" msgstr "使用預設工廠函式是一種建立可變型別的新實例作為欄位預設值的方法:" -#: ../../library/dataclasses.rst:755 +#: ../../library/dataclasses.rst:753 #, fuzzy msgid "" "Instead of looking for and disallowing objects of type ``list``, ``dict``, " @@ -1145,12 +1145,12 @@ msgstr "" "不再查找和禁止型別為“list”、“dict”或“set”的物件,現在不允許使用不可散列的對像" "作為預設值。不可散列性用於近似可變性。" -#: ../../library/dataclasses.rst:762 +#: ../../library/dataclasses.rst:760 #, fuzzy msgid "Descriptor-typed fields" msgstr "描述器型別的欄位" -#: ../../library/dataclasses.rst:764 +#: ../../library/dataclasses.rst:762 #, fuzzy msgid "" "Fields that are assigned :ref:`descriptor objects ` as their " @@ -1159,7 +1159,7 @@ msgstr "" "指定為 :ref:`descriptor objects ` 作為預設值的欄位具有以下特殊行" "為:" -#: ../../library/dataclasses.rst:767 +#: ../../library/dataclasses.rst:765 #, fuzzy msgid "" "The value for the field passed to the dataclass's ``__init__`` method is " @@ -1169,7 +1169,7 @@ msgstr "" "傳遞給資料類的“__init__”方法的欄位值被傳遞給描述器的“__set__”方法,而不是覆蓋" "描述器物件。" -#: ../../library/dataclasses.rst:770 +#: ../../library/dataclasses.rst:768 #, fuzzy msgid "" "Similarly, when getting or setting the field, the descriptor's ``__get__`` " @@ -1179,7 +1179,7 @@ msgstr "" "同樣,在獲取或設定欄位時,將呼叫描述器的“__get__”或“__set__”方法,而不是回傳" "或覆蓋描述器物件。" -#: ../../library/dataclasses.rst:773 +#: ../../library/dataclasses.rst:771 #, fuzzy msgid "" "To determine whether a field contains a default value, ``dataclasses`` will " @@ -1194,7 +1194,7 @@ msgstr "" "情況下,描述器回傳一個值,它將用作欄位的預設值。另一方面,如果描述器在這種情" "況下引發 :exc:`AttributeError`,則不會為該欄位提供預設值。" -#: ../../library/dataclasses.rst:808 +#: ../../library/dataclasses.rst:806 #, fuzzy msgid "" "Note that if a field is annotated with a descriptor type, but is not " diff --git a/library/devmode.po b/library/devmode.po index afd4426b90..f5b9098f1f 100644 --- a/library/devmode.po +++ b/library/devmode.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-22 00:04+0000\n" +"POT-Creation-Date: 2023-10-11 17:13+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -134,54 +134,55 @@ msgstr "" #: ../../library/devmode.rst:61 msgid "" "Call :func:`faulthandler.enable` at Python startup to install handlers for " -"the :const:`SIGSEGV`, :const:`SIGFPE`, :const:`SIGABRT`, :const:`SIGBUS` " -"and :const:`SIGILL` signals to dump the Python traceback on a crash." +"the :const:`~signal.SIGSEGV`, :const:`~signal.SIGFPE`, :const:`~signal." +"SIGABRT`, :const:`~signal.SIGBUS` and :const:`~signal.SIGILL` signals to " +"dump the Python traceback on a crash." msgstr "" -#: ../../library/devmode.rst:65 +#: ../../library/devmode.rst:66 msgid "" "It behaves as if the :option:`-X faulthandler <-X>` command line option is " "used or if the :envvar:`PYTHONFAULTHANDLER` environment variable is set to " "``1``." msgstr "" -#: ../../library/devmode.rst:69 +#: ../../library/devmode.rst:70 msgid "" "Enable :ref:`asyncio debug mode `. For example, :mod:" "`asyncio` checks for coroutines that were not awaited and logs them." msgstr "" -#: ../../library/devmode.rst:72 +#: ../../library/devmode.rst:73 msgid "" "It behaves as if the :envvar:`PYTHONASYNCIODEBUG` environment variable is " "set to ``1``." msgstr "" -#: ../../library/devmode.rst:75 +#: ../../library/devmode.rst:76 msgid "" "Check the *encoding* and *errors* arguments for string encoding and decoding " "operations. Examples: :func:`open`, :meth:`str.encode` and :meth:`bytes." "decode`." msgstr "" -#: ../../library/devmode.rst:79 +#: ../../library/devmode.rst:80 msgid "" "By default, for best performance, the *errors* argument is only checked at " "the first encoding/decoding error and the *encoding* argument is sometimes " "ignored for empty strings." msgstr "" -#: ../../library/devmode.rst:83 +#: ../../library/devmode.rst:84 msgid "The :class:`io.IOBase` destructor logs ``close()`` exceptions." msgstr "" -#: ../../library/devmode.rst:84 +#: ../../library/devmode.rst:85 msgid "" "Set the :attr:`~sys.flags.dev_mode` attribute of :data:`sys.flags` to " "``True``." msgstr "" -#: ../../library/devmode.rst:87 +#: ../../library/devmode.rst:88 msgid "" "The Python Development Mode does not enable the :mod:`tracemalloc` module by " "default, because the overhead cost (to performance and memory) would be too " @@ -192,63 +193,63 @@ msgid "" "allocated." msgstr "" -#: ../../library/devmode.rst:94 +#: ../../library/devmode.rst:95 msgid "" "The Python Development Mode does not prevent the :option:`-O` command line " "option from removing :keyword:`assert` statements nor from setting :const:" "`__debug__` to ``False``." msgstr "" -#: ../../library/devmode.rst:98 +#: ../../library/devmode.rst:99 msgid "" "The Python Development Mode can only be enabled at the Python startup. Its " "value can be read from :data:`sys.flags.dev_mode `." msgstr "" -#: ../../library/devmode.rst:101 +#: ../../library/devmode.rst:102 msgid "The :class:`io.IOBase` destructor now logs ``close()`` exceptions." msgstr "" -#: ../../library/devmode.rst:104 +#: ../../library/devmode.rst:105 msgid "" "The *encoding* and *errors* arguments are now checked for string encoding " "and decoding operations." msgstr "" -#: ../../library/devmode.rst:110 +#: ../../library/devmode.rst:111 msgid "ResourceWarning Example" msgstr "ResourceWarning 範例" -#: ../../library/devmode.rst:112 +#: ../../library/devmode.rst:113 msgid "" "Example of a script counting the number of lines of the text file specified " "in the command line::" msgstr "" -#: ../../library/devmode.rst:126 +#: ../../library/devmode.rst:127 msgid "" "The script does not close the file explicitly. By default, Python does not " "emit any warning. Example using README.txt, which has 269 lines:" msgstr "" -#: ../../library/devmode.rst:134 +#: ../../library/devmode.rst:135 msgid "" "Enabling the Python Development Mode displays a :exc:`ResourceWarning` " "warning:" msgstr "" -#: ../../library/devmode.rst:144 +#: ../../library/devmode.rst:145 msgid "" "In addition, enabling :mod:`tracemalloc` shows the line where the file was " "opened:" msgstr "" -#: ../../library/devmode.rst:159 +#: ../../library/devmode.rst:160 msgid "" "The fix is to close explicitly the file. Example using a context manager::" msgstr "" -#: ../../library/devmode.rst:167 +#: ../../library/devmode.rst:168 msgid "" "Not closing a resource explicitly can leave a resource open for way longer " "than expected; it can cause severe issues upon exiting Python. It is bad in " @@ -256,25 +257,25 @@ msgid "" "application more deterministic and more reliable." msgstr "" -#: ../../library/devmode.rst:174 +#: ../../library/devmode.rst:175 msgid "Bad file descriptor error example" msgstr "" -#: ../../library/devmode.rst:176 +#: ../../library/devmode.rst:177 msgid "Script displaying the first line of itself::" msgstr "" -#: ../../library/devmode.rst:189 +#: ../../library/devmode.rst:190 msgid "By default, Python does not emit any warning:" msgstr "" -#: ../../library/devmode.rst:196 +#: ../../library/devmode.rst:197 msgid "" "The Python Development Mode shows a :exc:`ResourceWarning` and logs a \"Bad " "file descriptor\" error when finalizing the file object:" msgstr "" -#: ../../library/devmode.rst:212 +#: ../../library/devmode.rst:213 msgid "" "``os.close(fp.fileno())`` closes the file descriptor. When the file object " "finalizer tries to close the file descriptor again, it fails with the ``Bad " @@ -283,7 +284,7 @@ msgid "" "`18748` for an example)." msgstr "" -#: ../../library/devmode.rst:218 +#: ../../library/devmode.rst:219 msgid "" "The fix is to remove the ``os.close(fp.fileno())`` line, or open the file " "with ``closefd=False``." diff --git a/library/difflib.po b/library/difflib.po index 2af26c0865..fd4440ff4a 100644 --- a/library/difflib.po +++ b/library/difflib.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-10-11 17:13+0000\n" "PO-Revision-Date: 2016-11-19 00:29+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -655,8 +655,9 @@ msgstr "" msgid "" "The three methods that return the ratio of matching to total characters can " "give different results due to differing levels of approximation, although :" -"meth:`quick_ratio` and :meth:`real_quick_ratio` are always at least as large " -"as :meth:`ratio`:" +"meth:`~SequenceMatcher.quick_ratio` and :meth:`~SequenceMatcher." +"real_quick_ratio` are always at least as large as :meth:`~SequenceMatcher." +"ratio`:" msgstr "" #: ../../library/difflib.rst:588 @@ -669,28 +670,29 @@ msgstr "" #: ../../library/difflib.rst:596 msgid "" -":meth:`ratio` returns a float in [0, 1], measuring the similarity of the " -"sequences. As a rule of thumb, a :meth:`ratio` value over 0.6 means the " -"sequences are close matches:" +":meth:`~SequenceMatcher.ratio` returns a float in [0, 1], measuring the " +"similarity of the sequences. As a rule of thumb, a :meth:`~SequenceMatcher." +"ratio` value over 0.6 means the sequences are close matches:" msgstr "" #: ../../library/difflib.rst:603 msgid "" "If you're only interested in where the sequences match, :meth:" -"`get_matching_blocks` is handy:" +"`~SequenceMatcher.get_matching_blocks` is handy:" msgstr "" #: ../../library/difflib.rst:612 msgid "" -"Note that the last tuple returned by :meth:`get_matching_blocks` is always a " -"dummy, ``(len(a), len(b), 0)``, and this is the only case in which the last " -"tuple element (number of elements matched) is ``0``." +"Note that the last tuple returned by :meth:`~SequenceMatcher." +"get_matching_blocks` is always a dummy, ``(len(a), len(b), 0)``, and this is " +"the only case in which the last tuple element (number of elements matched) " +"is ``0``." msgstr "" #: ../../library/difflib.rst:616 msgid "" "If you want to know how to change the first sequence into the second, use :" -"meth:`get_opcodes`:" +"meth:`~SequenceMatcher.get_opcodes`:" msgstr "" #: ../../library/difflib.rst:627 @@ -778,7 +780,7 @@ msgstr "" msgid "" "This example compares two texts. First we set up the texts, sequences of " "individual single-line strings ending with newlines (such sequences can also " -"be obtained from the :meth:`~io.BaseIO.readlines` method of file-like " +"be obtained from the :meth:`~io.IOBase.readlines` method of file-like " "objects):" msgstr "" diff --git a/library/dis.po b/library/dis.po index a8f051c8cc..149873e707 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-08-28 00:04+0000\n" +"POT-Creation-Date: 2023-10-12 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-" @@ -82,32 +82,55 @@ msgstr "" msgid "(The \"2\" is a line number)." msgstr "" -#: ../../library/dis.rst:67 -msgid "Bytecode analysis" +#: ../../library/dis.rst:69 +msgid "Command-line interface" msgstr "" #: ../../library/dis.rst:71 +msgid "The :mod:`dis` module can be invoked as a script from the command line:" +msgstr "" + +#: ../../library/dis.rst:77 +msgid "The following options are accepted:" +msgstr "" + +#: ../../library/dis.rst:83 +msgid "Display usage and exit." +msgstr "" + +#: ../../library/dis.rst:85 +msgid "" +"If :file:`infile` is specified, its disassembled code will be written to " +"stdout. Otherwise, disassembly is performed on compiled source code recieved " +"from stdin." +msgstr "" + +#: ../../library/dis.rst:89 +msgid "Bytecode analysis" +msgstr "" + +#: ../../library/dis.rst:93 msgid "" "The bytecode analysis API allows pieces of Python code to be wrapped in a :" "class:`Bytecode` object that provides easy access to details of the compiled " "code." msgstr "" -#: ../../library/dis.rst:78 +#: ../../library/dis.rst:100 msgid "" "Analyse the bytecode corresponding to a function, generator, asynchronous " "generator, coroutine, method, string of source code, or a code object (as " "returned by :func:`compile`)." msgstr "" -#: ../../library/dis.rst:82 +#: ../../library/dis.rst:104 msgid "" "This is a convenience wrapper around many of the functions listed below, " "most notably :func:`get_instructions`, as iterating over a :class:`Bytecode` " "instance yields the bytecode operations as :class:`Instruction` instances." msgstr "" -#: ../../library/dis.rst:86 ../../library/dis.rst:274 +#: ../../library/dis.rst:108 ../../library/dis.rst:296 msgid "" "If *first_line* is not ``None``, it indicates the line number that should be " "reported for the first source line in the disassembled code. Otherwise, the " @@ -115,71 +138,71 @@ msgid "" "code object." msgstr "" -#: ../../library/dis.rst:91 +#: ../../library/dis.rst:113 msgid "" "If *current_offset* is not ``None``, it refers to an instruction offset in " "the disassembled code. Setting this means :meth:`.dis` will display a " "\"current instruction\" marker against the specified opcode." msgstr "" -#: ../../library/dis.rst:95 +#: ../../library/dis.rst:117 msgid "" "If *show_caches* is ``True``, :meth:`.dis` will display inline cache entries " "used by the interpreter to specialize the bytecode." msgstr "" -#: ../../library/dis.rst:98 +#: ../../library/dis.rst:120 msgid "" "If *adaptive* is ``True``, :meth:`.dis` will display specialized bytecode " "that may be different from the original bytecode." msgstr "" -#: ../../library/dis.rst:103 +#: ../../library/dis.rst:125 msgid "" "Construct a :class:`Bytecode` instance from the given traceback, setting " "*current_offset* to the instruction responsible for the exception." msgstr "" -#: ../../library/dis.rst:108 +#: ../../library/dis.rst:130 msgid "The compiled code object." msgstr "" -#: ../../library/dis.rst:112 +#: ../../library/dis.rst:134 msgid "The first source line of the code object (if available)" msgstr "" -#: ../../library/dis.rst:116 +#: ../../library/dis.rst:138 msgid "" "Return a formatted view of the bytecode operations (the same as printed by :" "func:`dis.dis`, but returned as a multi-line string)." msgstr "" -#: ../../library/dis.rst:121 +#: ../../library/dis.rst:143 msgid "" "Return a formatted multi-line string with detailed information about the " "code object, like :func:`code_info`." msgstr "" -#: ../../library/dis.rst:124 ../../library/dis.rst:164 -#: ../../library/dis.rst:216 +#: ../../library/dis.rst:146 ../../library/dis.rst:186 +#: ../../library/dis.rst:238 msgid "This can now handle coroutine and asynchronous generator objects." msgstr "" -#: ../../library/dis.rst:127 ../../library/dis.rst:219 -#: ../../library/dis.rst:235 ../../library/dis.rst:262 -#: ../../library/dis.rst:283 +#: ../../library/dis.rst:149 ../../library/dis.rst:241 +#: ../../library/dis.rst:257 ../../library/dis.rst:284 +#: ../../library/dis.rst:305 msgid "Added the *show_caches* and *adaptive* parameters." msgstr "新增 *show_caches* 與 *adaptive* 參數。" -#: ../../library/dis.rst:130 +#: ../../library/dis.rst:152 msgid "Example:" msgstr "範例:" -#: ../../library/dis.rst:146 +#: ../../library/dis.rst:168 msgid "Analysis functions" msgstr "" -#: ../../library/dis.rst:148 +#: ../../library/dis.rst:170 msgid "" "The :mod:`dis` module also defines the following analysis functions that " "convert the input directly to the desired output. They can be useful if only " @@ -187,39 +210,39 @@ msgid "" "isn't useful:" msgstr "" -#: ../../library/dis.rst:154 +#: ../../library/dis.rst:176 msgid "" "Return a formatted multi-line string with detailed code object information " "for the supplied function, generator, asynchronous generator, coroutine, " "method, source code string or code object." msgstr "" -#: ../../library/dis.rst:158 +#: ../../library/dis.rst:180 msgid "" "Note that the exact contents of code info strings are highly implementation " "dependent and they may change arbitrarily across Python VMs or Python " "releases." msgstr "" -#: ../../library/dis.rst:170 +#: ../../library/dis.rst:192 msgid "" "Print detailed code object information for the supplied function, method, " "source code string or code object to *file* (or ``sys.stdout`` if *file* is " "not specified)." msgstr "" -#: ../../library/dis.rst:174 +#: ../../library/dis.rst:196 msgid "" "This is a convenient shorthand for ``print(code_info(x), file=file)``, " "intended for interactive exploration at the interpreter prompt." msgstr "" -#: ../../library/dis.rst:179 ../../library/dis.rst:210 -#: ../../library/dis.rst:232 ../../library/dis.rst:259 +#: ../../library/dis.rst:201 ../../library/dis.rst:232 +#: ../../library/dis.rst:254 ../../library/dis.rst:281 msgid "Added *file* parameter." msgstr "新增 *file* 參數。" -#: ../../library/dis.rst:185 +#: ../../library/dis.rst:207 msgid "" "Disassemble the *x* object. *x* can denote either a module, a class, a " "method, a function, a generator, an asynchronous generator, a coroutine, a " @@ -235,127 +258,127 @@ msgid "" "disassembles the last traceback." msgstr "" -#: ../../library/dis.rst:198 ../../library/dis.rst:229 -#: ../../library/dis.rst:256 +#: ../../library/dis.rst:220 ../../library/dis.rst:251 +#: ../../library/dis.rst:278 msgid "" "The disassembly is written as text to the supplied *file* argument if " "provided and to ``sys.stdout`` otherwise." msgstr "" -#: ../../library/dis.rst:201 +#: ../../library/dis.rst:223 msgid "" "The maximal depth of recursion is limited by *depth* unless it is ``None``. " "``depth=0`` means no recursion." msgstr "" -#: ../../library/dis.rst:204 +#: ../../library/dis.rst:226 msgid "" "If *show_caches* is ``True``, this function will display inline cache " "entries used by the interpreter to specialize the bytecode." msgstr "" -#: ../../library/dis.rst:207 +#: ../../library/dis.rst:229 msgid "" "If *adaptive* is ``True``, this function will display specialized bytecode " "that may be different from the original bytecode." msgstr "" -#: ../../library/dis.rst:213 +#: ../../library/dis.rst:235 msgid "Implemented recursive disassembling and added *depth* parameter." msgstr "" -#: ../../library/dis.rst:225 +#: ../../library/dis.rst:247 msgid "" "Disassemble the top-of-stack function of a traceback, using the last " "traceback if none was passed. The instruction causing the exception is " "indicated." msgstr "" -#: ../../library/dis.rst:242 +#: ../../library/dis.rst:264 msgid "" "Disassemble a code object, indicating the last instruction if *lasti* was " "provided. The output is divided in the following columns:" msgstr "" -#: ../../library/dis.rst:245 +#: ../../library/dis.rst:267 msgid "the line number, for the first instruction of each line" msgstr "" -#: ../../library/dis.rst:246 +#: ../../library/dis.rst:268 msgid "the current instruction, indicated as ``-->``," msgstr "" -#: ../../library/dis.rst:247 +#: ../../library/dis.rst:269 msgid "a labelled instruction, indicated with ``>>``," msgstr "" -#: ../../library/dis.rst:248 +#: ../../library/dis.rst:270 msgid "the address of the instruction," msgstr "" -#: ../../library/dis.rst:249 +#: ../../library/dis.rst:271 msgid "the operation code name," msgstr "" -#: ../../library/dis.rst:250 +#: ../../library/dis.rst:272 msgid "operation parameters, and" msgstr "" -#: ../../library/dis.rst:251 +#: ../../library/dis.rst:273 msgid "interpretation of the parameters in parentheses." msgstr "" -#: ../../library/dis.rst:253 +#: ../../library/dis.rst:275 msgid "" "The parameter interpretation recognizes local and global variable names, " "constant values, branch targets, and compare operators." msgstr "" -#: ../../library/dis.rst:268 +#: ../../library/dis.rst:290 msgid "" "Return an iterator over the instructions in the supplied function, method, " "source code string or code object." msgstr "" -#: ../../library/dis.rst:271 +#: ../../library/dis.rst:293 msgid "" "The iterator generates a series of :class:`Instruction` named tuples giving " "the details of each operation in the supplied code." msgstr "" -#: ../../library/dis.rst:279 +#: ../../library/dis.rst:301 msgid "" "The *show_caches* and *adaptive* parameters work as they do in :func:`dis`." msgstr "" -#: ../../library/dis.rst:289 +#: ../../library/dis.rst:311 msgid "" "This generator function uses the ``co_lines`` method of the code object " "*code* to find the offsets which are starts of lines in the source code. " "They are generated as ``(offset, lineno)`` pairs." msgstr "" -#: ../../library/dis.rst:293 +#: ../../library/dis.rst:315 msgid "Line numbers can be decreasing. Before, they were always increasing." msgstr "" -#: ../../library/dis.rst:296 +#: ../../library/dis.rst:318 msgid "" "The :pep:`626` ``co_lines`` method is used instead of the ``co_firstlineno`` " "and ``co_lnotab`` attributes of the code object." msgstr "" -#: ../../library/dis.rst:303 +#: ../../library/dis.rst:325 msgid "" "Detect all offsets in the raw compiled bytecode string *code* which are jump " "targets, and return a list of these offsets." msgstr "" -#: ../../library/dis.rst:309 +#: ../../library/dis.rst:331 msgid "Compute the stack effect of *opcode* with argument *oparg*." msgstr "" -#: ../../library/dis.rst:311 +#: ../../library/dis.rst:333 msgid "" "If the code has a jump target and *jump* is ``True``, :func:`~stack_effect` " "will return the stack effect of jumping. If *jump* is ``False``, it will " @@ -363,118 +386,118 @@ msgid "" "it will return the maximal stack effect of both cases." msgstr "" -#: ../../library/dis.rst:318 +#: ../../library/dis.rst:340 msgid "Added *jump* parameter." msgstr "新增 *jump* 參數。" -#: ../../library/dis.rst:325 +#: ../../library/dis.rst:347 msgid "Python Bytecode Instructions" msgstr "" -#: ../../library/dis.rst:327 +#: ../../library/dis.rst:349 msgid "" "The :func:`get_instructions` function and :class:`Bytecode` class provide " "details of bytecode instructions as :class:`Instruction` instances:" msgstr "" -#: ../../library/dis.rst:332 +#: ../../library/dis.rst:354 msgid "Details for a bytecode operation" msgstr "" -#: ../../library/dis.rst:336 +#: ../../library/dis.rst:358 msgid "" "numeric code for operation, corresponding to the opcode values listed below " "and the bytecode values in the :ref:`opcode_collections`." msgstr "" -#: ../../library/dis.rst:342 +#: ../../library/dis.rst:364 msgid "human readable name for operation" msgstr "" -#: ../../library/dis.rst:347 +#: ../../library/dis.rst:369 msgid "numeric argument to operation (if any), otherwise ``None``" msgstr "" -#: ../../library/dis.rst:352 +#: ../../library/dis.rst:374 msgid "resolved arg value (if any), otherwise ``None``" msgstr "" -#: ../../library/dis.rst:357 +#: ../../library/dis.rst:379 msgid "" "human readable description of operation argument (if any), otherwise an " "empty string." msgstr "" -#: ../../library/dis.rst:363 +#: ../../library/dis.rst:385 msgid "start index of operation within bytecode sequence" msgstr "" -#: ../../library/dis.rst:368 +#: ../../library/dis.rst:390 msgid "line started by this opcode (if any), otherwise ``None``" msgstr "" -#: ../../library/dis.rst:373 +#: ../../library/dis.rst:395 msgid "``True`` if other code jumps to here, otherwise ``False``" msgstr "" -#: ../../library/dis.rst:378 +#: ../../library/dis.rst:400 msgid "" ":class:`dis.Positions` object holding the start and end locations that are " "covered by this instruction." msgstr "" -#: ../../library/dis.rst:385 +#: ../../library/dis.rst:407 msgid "Field ``positions`` is added." msgstr "" -#: ../../library/dis.rst:390 +#: ../../library/dis.rst:412 msgid "" "In case the information is not available, some fields might be ``None``." msgstr "" -#: ../../library/dis.rst:400 +#: ../../library/dis.rst:422 msgid "" "The Python compiler currently generates the following bytecode instructions." msgstr "" -#: ../../library/dis.rst:403 +#: ../../library/dis.rst:425 msgid "**General instructions**" msgstr "" -#: ../../library/dis.rst:405 +#: ../../library/dis.rst:427 msgid "" "In the following, We will refer to the interpreter stack as ``STACK`` and " "describe operations on it as if it was a Python list. The top of the stack " "corresponds to ``STACK[-1]`` in this language." msgstr "" -#: ../../library/dis.rst:411 +#: ../../library/dis.rst:433 msgid "" "Do nothing code. Used as a placeholder by the bytecode optimizer, and to " "generate line tracing events." msgstr "" -#: ../../library/dis.rst:417 +#: ../../library/dis.rst:439 msgid "Removes the top-of-stack item::" msgstr "" -#: ../../library/dis.rst:424 +#: ../../library/dis.rst:446 msgid "" "Removes the top two values from the stack. Equivalent to ``POP_TOP``; " "``POP_TOP``. Used to clean up at the end of loops, hence the name." msgstr "" -#: ../../library/dis.rst:433 +#: ../../library/dis.rst:455 msgid "" "Push the i-th item to the top of the stack without removing it from its " "original location::" msgstr "" -#: ../../library/dis.rst:444 +#: ../../library/dis.rst:466 msgid "Swap the top of the stack with the i-th element::" msgstr "" -#: ../../library/dis.rst:453 +#: ../../library/dis.rst:475 msgid "" "Rather than being an actual instruction, this opcode is used to mark extra " "space for the interpreter to cache useful data directly in the bytecode " @@ -482,91 +505,91 @@ msgid "" "viewed with ``show_caches=True``." msgstr "" -#: ../../library/dis.rst:458 +#: ../../library/dis.rst:480 msgid "" "Logically, this space is part of the preceding instruction. Many opcodes " "expect to be followed by an exact number of caches, and will instruct the " "interpreter to skip over them at runtime." msgstr "" -#: ../../library/dis.rst:462 +#: ../../library/dis.rst:484 msgid "" "Populated caches can look like arbitrary instructions, so great care should " "be taken when reading or modifying raw, adaptive bytecode containing " "quickened data." msgstr "" -#: ../../library/dis.rst:469 +#: ../../library/dis.rst:491 msgid "**Unary operations**" msgstr "" -#: ../../library/dis.rst:471 +#: ../../library/dis.rst:493 msgid "" "Unary operations take the top of the stack, apply the operation, and push " "the result back on the stack." msgstr "" -#: ../../library/dis.rst:477 +#: ../../library/dis.rst:499 msgid "Implements ``STACK[-1] = -STACK[-1]``." msgstr "" -#: ../../library/dis.rst:482 +#: ../../library/dis.rst:504 msgid "Implements ``STACK[-1] = not STACK[-1]``." msgstr "" -#: ../../library/dis.rst:487 +#: ../../library/dis.rst:509 msgid "Implements ``STACK[-1] = ~STACK[-1]``." msgstr "" -#: ../../library/dis.rst:492 +#: ../../library/dis.rst:514 msgid "Implements ``STACK[-1] = iter(STACK[-1])``." msgstr "" -#: ../../library/dis.rst:497 +#: ../../library/dis.rst:519 msgid "" "If ``STACK[-1]`` is a :term:`generator iterator` or :term:`coroutine` object " "it is left as is. Otherwise, implements ``STACK[-1] = iter(STACK[-1])``." msgstr "" -#: ../../library/dis.rst:503 +#: ../../library/dis.rst:525 msgid "**Binary and in-place operations**" msgstr "" -#: ../../library/dis.rst:505 +#: ../../library/dis.rst:527 msgid "" "Binary operations remove the top two items from the stack (``STACK[-1]`` and " "``STACK[-2]``). They perform the operation, then put the result back on the " "stack." msgstr "" -#: ../../library/dis.rst:508 +#: ../../library/dis.rst:530 msgid "" "In-place operations are like binary operations, but the operation is done in-" "place when ``STACK[-2]`` supports it, and the resulting ``STACK[-1]`` may be " "(but does not have to be) the original ``STACK[-2]``." msgstr "" -#: ../../library/dis.rst:515 +#: ../../library/dis.rst:537 msgid "" "Implements the binary and in-place operators (depending on the value of " "*op*)::" msgstr "" -#: ../../library/dis.rst:527 ../../library/dis.rst:536 -#: ../../library/dis.rst:546 ../../library/dis.rst:554 -#: ../../library/dis.rst:566 ../../library/dis.rst:654 -#: ../../library/dis.rst:664 ../../library/dis.rst:674 -#: ../../library/dis.rst:894 ../../library/dis.rst:905 -#: ../../library/dis.rst:1005 ../../library/dis.rst:1017 -#: ../../library/dis.rst:1029 +#: ../../library/dis.rst:549 ../../library/dis.rst:558 +#: ../../library/dis.rst:568 ../../library/dis.rst:576 +#: ../../library/dis.rst:588 ../../library/dis.rst:676 +#: ../../library/dis.rst:686 ../../library/dis.rst:696 +#: ../../library/dis.rst:916 ../../library/dis.rst:927 +#: ../../library/dis.rst:1027 ../../library/dis.rst:1039 +#: ../../library/dis.rst:1051 msgid "Implements::" msgstr "" -#: ../../library/dis.rst:577 +#: ../../library/dis.rst:599 msgid "**Coroutine opcodes**" msgstr "" -#: ../../library/dis.rst:581 +#: ../../library/dis.rst:603 msgid "" "Implements ``STACK[-1] = get_awaitable(STACK[-1])``, where " "``get_awaitable(o)`` returns ``o`` if ``o`` is a coroutine object or a " @@ -574,39 +597,39 @@ msgid "" "resolves ``o.__await__``." msgstr "" -#: ../../library/dis.rst:586 +#: ../../library/dis.rst:608 msgid "" "If the ``where`` operand is nonzero, it indicates where the instruction " "occurs:" msgstr "" -#: ../../library/dis.rst:589 +#: ../../library/dis.rst:611 msgid "``1``: After a call to ``__aenter__``" msgstr "" -#: ../../library/dis.rst:590 +#: ../../library/dis.rst:612 msgid "``2``: After a call to ``__aexit__``" msgstr "" -#: ../../library/dis.rst:594 +#: ../../library/dis.rst:616 msgid "Previously, this instruction did not have an oparg." msgstr "" -#: ../../library/dis.rst:600 +#: ../../library/dis.rst:622 msgid "Implements ``STACK[-1] = STACK[-1].__aiter__()``." msgstr "" -#: ../../library/dis.rst:603 +#: ../../library/dis.rst:625 msgid "Returning awaitable objects from ``__aiter__`` is no longer supported." msgstr "" -#: ../../library/dis.rst:610 +#: ../../library/dis.rst:632 msgid "" "Implement ``STACK.append(get_awaitable(STACK[-1].__anext__()))`` to the " "stack. See ``GET_AWAITABLE`` for details about ``get_awaitable``." msgstr "" -#: ../../library/dis.rst:618 +#: ../../library/dis.rst:640 msgid "" "Terminates an :keyword:`async for` loop. Handles an exception raised when " "awaiting a next item. The stack contains the async iterable in ``STACK[-2]`` " @@ -614,13 +637,13 @@ msgid "" "is not :exc:`StopAsyncIteration`, it is re-raised." msgstr "" -#: ../../library/dis.rst:625 ../../library/dis.rst:730 -#: ../../library/dis.rst:741 +#: ../../library/dis.rst:647 ../../library/dis.rst:752 +#: ../../library/dis.rst:763 msgid "" "Exception representation on the stack now consist of one, not three, items." msgstr "" -#: ../../library/dis.rst:631 +#: ../../library/dis.rst:653 msgid "" "Handles an exception raised during a :meth:`~generator.throw` or :meth:" "`~generator.close` call through the current frame. If ``STACK[-1]`` is an " @@ -628,35 +651,35 @@ msgid "" "its ``value`` member. Otherwise, re-raise ``STACK[-1]``." msgstr "" -#: ../../library/dis.rst:641 +#: ../../library/dis.rst:663 msgid "" "Resolves ``__aenter__`` and ``__aexit__`` from ``STACK[-1]``. Pushes " "``__aexit__`` and result of ``__aenter__()`` to the stack::" msgstr "" -#: ../../library/dis.rst:650 +#: ../../library/dis.rst:672 msgid "**Miscellaneous opcodes**" msgstr "" -#: ../../library/dis.rst:659 +#: ../../library/dis.rst:681 msgid "Used to implement set comprehensions." msgstr "" -#: ../../library/dis.rst:669 +#: ../../library/dis.rst:691 msgid "Used to implement list comprehensions." msgstr "" -#: ../../library/dis.rst:680 +#: ../../library/dis.rst:702 msgid "Used to implement dict comprehensions." msgstr "" -#: ../../library/dis.rst:683 +#: ../../library/dis.rst:705 msgid "" "Map value is ``STACK[-1]`` and map key is ``STACK[-2]``. Before, those were " "reversed." msgstr "" -#: ../../library/dis.rst:687 +#: ../../library/dis.rst:709 msgid "" "For all of the :opcode:`SET_ADD`, :opcode:`LIST_APPEND` and :opcode:" "`MAP_ADD` instructions, while the added value or key/value pair is popped " @@ -664,29 +687,29 @@ msgid "" "further iterations of the loop." msgstr "" -#: ../../library/dis.rst:695 +#: ../../library/dis.rst:717 msgid "Returns with ``STACK[-1]`` to the caller of the function." msgstr "" -#: ../../library/dis.rst:700 +#: ../../library/dis.rst:722 msgid "Returns with ``co_consts[consti]`` to the caller of the function." msgstr "" -#: ../../library/dis.rst:707 +#: ../../library/dis.rst:729 msgid "Yields ``STACK.pop()`` from a :term:`generator`." msgstr "" -#: ../../library/dis.rst:709 +#: ../../library/dis.rst:731 msgid "oparg set to be the stack depth." msgstr "" -#: ../../library/dis.rst:712 +#: ../../library/dis.rst:734 msgid "" "oparg set to be the exception block depth, for efficient closing of " "generators." msgstr "" -#: ../../library/dis.rst:718 +#: ../../library/dis.rst:740 msgid "" "Checks whether ``__annotations__`` is defined in ``locals()``, if not it is " "set up to an empty ``dict``. This opcode is only emitted if a class or " @@ -694,39 +717,39 @@ msgid "" "statically." msgstr "" -#: ../../library/dis.rst:728 +#: ../../library/dis.rst:750 msgid "" "Pops a value from the stack, which is used to restore the exception state." msgstr "" -#: ../../library/dis.rst:735 +#: ../../library/dis.rst:757 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." msgstr "" -#: ../../library/dis.rst:746 +#: ../../library/dis.rst:768 msgid "" "Pops a value from the stack. Pushes the current exception to the top of the " "stack. Pushes the value originally popped back to the stack. Used in " "exception handlers." msgstr "" -#: ../../library/dis.rst:754 +#: ../../library/dis.rst:776 msgid "" "Performs exception matching for ``except``. Tests whether the ``STACK[-2]`` " "is an exception matching ``STACK[-1]``. Pops ``STACK[-1]`` and pushes the " "boolean result of the test." msgstr "" -#: ../../library/dis.rst:762 +#: ../../library/dis.rst:784 msgid "" "Performs exception matching for ``except*``. Applies ``split(STACK[-1])`` on " "the exception group representing ``STACK[-2]``." msgstr "" -#: ../../library/dis.rst:765 +#: ../../library/dis.rst:787 msgid "" "In case of a match, pops two items from the stack and pushes the non-" "matching subgroup (``None`` in case of full match) followed by the matching " @@ -734,7 +757,7 @@ msgid "" "``None``." msgstr "" -#: ../../library/dis.rst:774 +#: ../../library/dis.rst:796 msgid "" "Calls the function in position 4 on the stack with arguments (type, val, tb) " "representing the exception at the top of the stack. Used to implement the " @@ -742,25 +765,25 @@ msgid "" "occurred in a :keyword:`with` statement." msgstr "" -#: ../../library/dis.rst:781 +#: ../../library/dis.rst:803 msgid "" "The ``__exit__`` function is in position 4 of the stack rather than 7. " "Exception representation on the stack now consist of one, not three, items." msgstr "" -#: ../../library/dis.rst:788 +#: ../../library/dis.rst:810 msgid "" "Pushes :exc:`AssertionError` onto the stack. Used by the :keyword:`assert` " "statement." msgstr "" -#: ../../library/dis.rst:796 +#: ../../library/dis.rst:818 msgid "" "Pushes :func:`!builtins.__build_class__` onto the stack. It is later called " "to construct a class." msgstr "" -#: ../../library/dis.rst:802 +#: ../../library/dis.rst:824 msgid "" "This opcode performs several operations before a with block starts. First, " "it loads :meth:`~object.__exit__` from the context manager and pushes it " @@ -769,11 +792,11 @@ msgid "" "``__enter__()`` method is pushed onto the stack." msgstr "" -#: ../../library/dis.rst:813 +#: ../../library/dis.rst:835 msgid "Perform ``STACK.append(len(STACK[-1]))``." msgstr "" -#: ../../library/dis.rst:820 +#: ../../library/dis.rst:842 msgid "" "If ``STACK[-1]`` is an instance of :class:`collections.abc.Mapping` (or, " "more technically: if it has the :c:macro:`Py_TPFLAGS_MAPPING` flag set in " @@ -781,7 +804,7 @@ msgid "" "Otherwise, push ``False``." msgstr "" -#: ../../library/dis.rst:830 +#: ../../library/dis.rst:852 msgid "" "If ``STACK[-1]`` is an instance of :class:`collections.abc.Sequence` and is " "*not* an instance of :class:`str`/:class:`bytes`/:class:`bytearray` (or, " @@ -790,20 +813,20 @@ msgid "" "Otherwise, push ``False``." msgstr "" -#: ../../library/dis.rst:840 +#: ../../library/dis.rst:862 msgid "" "``STACK[-1]`` is a tuple of mapping keys, and ``STACK[-2]`` is the match " "subject. If ``STACK[-2]`` contains all of the keys in ``STACK[-1]``, push a :" "class:`tuple` containing the corresponding values. Otherwise, push ``None``." msgstr "" -#: ../../library/dis.rst:846 ../../library/dis.rst:1467 +#: ../../library/dis.rst:868 ../../library/dis.rst:1489 msgid "" "Previously, this instruction also pushed a boolean value indicating success " "(``True``) or failure (``False``)." msgstr "" -#: ../../library/dis.rst:853 +#: ../../library/dis.rst:875 msgid "" "Implements ``name = STACK.pop()``. *namei* is the index of *name* in the " "attribute :attr:`!co_names` of the :ref:`code object `. The " @@ -811,19 +834,19 @@ msgid "" "possible." msgstr "" -#: ../../library/dis.rst:860 +#: ../../library/dis.rst:882 msgid "" "Implements ``del name``, where *namei* is the index into :attr:`!co_names` " "attribute of the :ref:`code object `." msgstr "" -#: ../../library/dis.rst:866 +#: ../../library/dis.rst:888 msgid "" "Unpacks ``STACK[-1]`` into *count* individual values, which are put onto the " "stack right-to-left. Require there to be exactly *count* values.::" msgstr "" -#: ../../library/dis.rst:875 +#: ../../library/dis.rst:897 msgid "" "Implements assignment with a starred target: Unpacks an iterable in " "``STACK[-1]`` into individual values, where the total number of values can " @@ -831,11 +854,11 @@ msgid "" "will be a list of all leftover items." msgstr "" -#: ../../library/dis.rst:880 +#: ../../library/dis.rst:902 msgid "The number of values before and after the list value is limited to 255." msgstr "" -#: ../../library/dis.rst:882 +#: ../../library/dis.rst:904 msgid "" "The number of values before the list value is encoded in the argument of the " "opcode. The number of values after the list if any is encoded using an " @@ -844,50 +867,50 @@ msgid "" "list value, the high byte of *counts* the number of values after it." msgstr "" -#: ../../library/dis.rst:888 +#: ../../library/dis.rst:910 msgid "" "The extracted values are put onto the stack right-to-left, i.e. ``a, *b, c = " "d`` will be stored after execution as ``STACK.extend((a, b, c))``." msgstr "" -#: ../../library/dis.rst:900 +#: ../../library/dis.rst:922 msgid "" "where *namei* is the index of name in :attr:`!co_names` of the :ref:`code " "object `." msgstr "" -#: ../../library/dis.rst:910 +#: ../../library/dis.rst:932 msgid "" "where *namei* is the index of name into :attr:`!co_names` of the :ref:`code " "object `." msgstr "" -#: ../../library/dis.rst:916 +#: ../../library/dis.rst:938 msgid "Works as :opcode:`STORE_NAME`, but stores the name as a global." msgstr "" -#: ../../library/dis.rst:921 +#: ../../library/dis.rst:943 msgid "Works as :opcode:`DELETE_NAME`, but deletes a global name." msgstr "" -#: ../../library/dis.rst:926 +#: ../../library/dis.rst:948 msgid "Pushes ``co_consts[consti]`` onto the stack." msgstr "" -#: ../../library/dis.rst:931 +#: ../../library/dis.rst:953 msgid "" "Pushes the value associated with ``co_names[namei]`` onto the stack. The " "name is looked up within the locals, then the globals, then the builtins." msgstr "" -#: ../../library/dis.rst:937 +#: ../../library/dis.rst:959 msgid "" "Pushes a reference to the locals dictionary onto the stack. This is used to " "prepare namespace dictionaries for :opcode:`LOAD_FROM_DICT_OR_DEREF` and :" "opcode:`LOAD_FROM_DICT_OR_GLOBALS`." msgstr "" -#: ../../library/dis.rst:946 +#: ../../library/dis.rst:968 msgid "" "Pops a mapping off the stack and looks up the value for ``co_names[namei]``. " "If the name is not found there, looks it up in the globals and then the " @@ -896,69 +919,69 @@ msgid "" "bodies." msgstr "" -#: ../../library/dis.rst:957 +#: ../../library/dis.rst:979 msgid "" "Creates a tuple consuming *count* items from the stack, and pushes the " "resulting tuple onto the stack.::" msgstr "" -#: ../../library/dis.rst:967 +#: ../../library/dis.rst:989 msgid "Works as :opcode:`BUILD_TUPLE`, but creates a list." msgstr "" -#: ../../library/dis.rst:972 +#: ../../library/dis.rst:994 msgid "Works as :opcode:`BUILD_TUPLE`, but creates a set." msgstr "" -#: ../../library/dis.rst:977 +#: ../../library/dis.rst:999 msgid "" "Pushes a new dictionary object onto the stack. Pops ``2 * count`` items so " "that the dictionary holds *count* entries: ``{..., STACK[-4]: STACK[-3], " "STACK[-2]: STACK[-1]}``." msgstr "" -#: ../../library/dis.rst:981 +#: ../../library/dis.rst:1003 msgid "" "The dictionary is created from stack items instead of creating an empty " "dictionary pre-sized to hold *count* items." msgstr "" -#: ../../library/dis.rst:988 +#: ../../library/dis.rst:1010 msgid "" "The version of :opcode:`BUILD_MAP` specialized for constant keys. Pops the " "top element on the stack which contains a tuple of keys, then starting from " "``STACK[-2]``, pops *count* values to form values in the built dictionary." msgstr "" -#: ../../library/dis.rst:997 +#: ../../library/dis.rst:1019 msgid "" "Concatenates *count* strings from the stack and pushes the resulting string " "onto the stack." msgstr "" -#: ../../library/dis.rst:1010 +#: ../../library/dis.rst:1032 msgid "Used to build lists." msgstr "" -#: ../../library/dis.rst:1022 +#: ../../library/dis.rst:1044 msgid "Used to build sets." msgstr "" -#: ../../library/dis.rst:1034 +#: ../../library/dis.rst:1056 msgid "Used to build dicts." msgstr "" -#: ../../library/dis.rst:1041 +#: ../../library/dis.rst:1063 msgid "Like :opcode:`DICT_UPDATE` but raises an exception for duplicate keys." msgstr "" -#: ../../library/dis.rst:1048 +#: ../../library/dis.rst:1070 msgid "" "If the low bit of ``namei`` is not set, this replaces ``STACK[-1]`` with " "``getattr(STACK[-1], co_names[namei>>1])``." msgstr "" -#: ../../library/dis.rst:1051 +#: ../../library/dis.rst:1073 msgid "" "If the low bit of ``namei`` is set, this will attempt to load a method named " "``co_names[namei>>1]`` from the ``STACK[-1]`` object. ``STACK[-1]`` is " @@ -969,13 +992,13 @@ msgid "" "the object returned by the attribute lookup are pushed." msgstr "" -#: ../../library/dis.rst:1059 +#: ../../library/dis.rst:1081 msgid "" "If the low bit of ``namei`` is set, then a ``NULL`` or ``self`` is pushed to " "the stack before the attribute or unbound method respectively." msgstr "" -#: ../../library/dis.rst:1066 +#: ../../library/dis.rst:1088 msgid "" "This opcode implements :func:`super` (e.g. ``super().method()`` and " "``super().attr``). It works the same as :opcode:`LOAD_ATTR`, except that " @@ -985,33 +1008,33 @@ msgid "" "class within which the current method was defined), and the global ``super``." msgstr "" -#: ../../library/dis.rst:1073 +#: ../../library/dis.rst:1095 msgid "" "The low bit of ``namei`` signals to attempt a method load, as with :opcode:" "`LOAD_ATTR`." msgstr "" -#: ../../library/dis.rst:1076 +#: ../../library/dis.rst:1098 msgid "" "The second-low bit of ``namei``, if set, means that this was a two-argument " "call to :func:`super` (unset means zero-argument)." msgstr "" -#: ../../library/dis.rst:1084 +#: ../../library/dis.rst:1106 msgid "" "Performs a Boolean operation. The operation name can be found in " "``cmp_op[opname]``." msgstr "" -#: ../../library/dis.rst:1090 +#: ../../library/dis.rst:1112 msgid "Performs ``is`` comparison, or ``is not`` if ``invert`` is 1." msgstr "" -#: ../../library/dis.rst:1097 +#: ../../library/dis.rst:1119 msgid "Performs ``in`` comparison, or ``not in`` if ``invert`` is 1." msgstr "" -#: ../../library/dis.rst:1104 +#: ../../library/dis.rst:1126 msgid "" "Imports the module ``co_names[namei]``. ``STACK[-1]`` and ``STACK[-2]`` are " "popped and provide the *fromlist* and *level* arguments of :func:" @@ -1020,68 +1043,68 @@ msgid "" "opcode:`STORE_FAST` instruction modifies the namespace." msgstr "" -#: ../../library/dis.rst:1112 +#: ../../library/dis.rst:1134 msgid "" "Loads the attribute ``co_names[namei]`` from the module found in " "``STACK[-1]``. The resulting object is pushed onto the stack, to be " "subsequently stored by a :opcode:`STORE_FAST` instruction." msgstr "" -#: ../../library/dis.rst:1119 +#: ../../library/dis.rst:1141 msgid "Increments bytecode counter by *delta*." msgstr "" -#: ../../library/dis.rst:1124 +#: ../../library/dis.rst:1146 msgid "Decrements bytecode counter by *delta*. Checks for interrupts." msgstr "" -#: ../../library/dis.rst:1131 +#: ../../library/dis.rst:1153 msgid "Decrements bytecode counter by *delta*. Does not check for interrupts." msgstr "" -#: ../../library/dis.rst:1138 +#: ../../library/dis.rst:1160 msgid "" "If ``STACK[-1]`` is true, increments the bytecode counter by *delta*. " "``STACK[-1]`` is popped." msgstr "" -#: ../../library/dis.rst:1141 ../../library/dis.rst:1154 +#: ../../library/dis.rst:1163 ../../library/dis.rst:1176 msgid "" "The oparg is now a relative delta rather than an absolute target. This " "opcode is a pseudo-instruction, replaced in final bytecode by the directed " "versions (forward/backward)." msgstr "" -#: ../../library/dis.rst:1146 ../../library/dis.rst:1159 -#: ../../library/dis.rst:1172 ../../library/dis.rst:1186 +#: ../../library/dis.rst:1168 ../../library/dis.rst:1181 +#: ../../library/dis.rst:1194 ../../library/dis.rst:1208 msgid "This is no longer a pseudo-instruction." msgstr "" -#: ../../library/dis.rst:1151 +#: ../../library/dis.rst:1173 msgid "" "If ``STACK[-1]`` is false, increments the bytecode counter by *delta*. " "``STACK[-1]`` is popped." msgstr "" -#: ../../library/dis.rst:1164 +#: ../../library/dis.rst:1186 msgid "" "If ``STACK[-1]`` is not ``None``, increments the bytecode counter by " "*delta*. ``STACK[-1]`` is popped." msgstr "" -#: ../../library/dis.rst:1167 ../../library/dis.rst:1181 +#: ../../library/dis.rst:1189 ../../library/dis.rst:1203 msgid "" "This opcode is a pseudo-instruction, replaced in final bytecode by the " "directed versions (forward/backward)." msgstr "" -#: ../../library/dis.rst:1178 +#: ../../library/dis.rst:1200 msgid "" "If ``STACK[-1]`` is ``None``, increments the bytecode counter by *delta*. " "``STACK[-1]`` is popped." msgstr "" -#: ../../library/dis.rst:1191 +#: ../../library/dis.rst:1213 msgid "" "``STACK[-1]`` is an :term:`iterator`. Call its :meth:`~iterator.__next__` " "method. If this yields a new value, push it on the stack (leaving the " @@ -1089,83 +1112,83 @@ msgid "" "code counter is incremented by *delta*." msgstr "" -#: ../../library/dis.rst:1196 +#: ../../library/dis.rst:1218 msgid "Up until 3.11 the iterator was popped when it was exhausted." msgstr "" -#: ../../library/dis.rst:1201 +#: ../../library/dis.rst:1223 msgid "Loads the global named ``co_names[namei>>1]`` onto the stack." msgstr "" -#: ../../library/dis.rst:1203 +#: ../../library/dis.rst:1225 msgid "" "If the low bit of ``namei`` is set, then a ``NULL`` is pushed to the stack " "before the global variable." msgstr "" -#: ../../library/dis.rst:1209 +#: ../../library/dis.rst:1231 msgid "" "Pushes a reference to the local ``co_varnames[var_num]`` onto the stack." msgstr "" -#: ../../library/dis.rst:1211 +#: ../../library/dis.rst:1233 msgid "" "This opcode is now only used in situations where the local variable is " "guaranteed to be initialized. It cannot raise :exc:`UnboundLocalError`." msgstr "" -#: ../../library/dis.rst:1217 +#: ../../library/dis.rst:1239 msgid "" "Pushes a reference to the local ``co_varnames[var_num]`` onto the stack, " "raising an :exc:`UnboundLocalError` if the local variable has not been " "initialized." msgstr "" -#: ../../library/dis.rst:1225 +#: ../../library/dis.rst:1247 msgid "" "Pushes a reference to the local ``co_varnames[var_num]`` onto the stack (or " "pushes ``NULL`` onto the stack if the local variable has not been " "initialized) and sets ``co_varnames[var_num]`` to ``NULL``." msgstr "" -#: ../../library/dis.rst:1233 +#: ../../library/dis.rst:1255 msgid "Stores ``STACK.pop()`` into the local ``co_varnames[var_num]``." msgstr "" -#: ../../library/dis.rst:1238 +#: ../../library/dis.rst:1260 msgid "Deletes local ``co_varnames[var_num]``." msgstr "" -#: ../../library/dis.rst:1243 +#: ../../library/dis.rst:1265 msgid "" "Creates a new cell in slot ``i``. If that slot is nonempty then that value " "is stored into the new cell." msgstr "" -#: ../../library/dis.rst:1251 +#: ../../library/dis.rst:1273 msgid "" "Pushes a reference to the cell contained in slot ``i`` of the \"fast " "locals\" storage. The name of the variable is ``co_fastlocalnames[i]``." msgstr "" -#: ../../library/dis.rst:1254 +#: ../../library/dis.rst:1276 msgid "" "Note that ``LOAD_CLOSURE`` is effectively an alias for ``LOAD_FAST``. It " "exists to keep bytecode a little more readable." msgstr "" -#: ../../library/dis.rst:1257 ../../library/dis.rst:1266 -#: ../../library/dis.rst:1288 ../../library/dis.rst:1299 +#: ../../library/dis.rst:1279 ../../library/dis.rst:1288 +#: ../../library/dis.rst:1310 ../../library/dis.rst:1321 msgid "``i`` is no longer offset by the length of ``co_varnames``." msgstr "" -#: ../../library/dis.rst:1263 +#: ../../library/dis.rst:1285 msgid "" "Loads the cell contained in slot ``i`` of the \"fast locals\" storage. " "Pushes a reference to the object the cell contains on the stack." msgstr "" -#: ../../library/dis.rst:1272 +#: ../../library/dis.rst:1294 msgid "" "Pops a mapping off the stack and looks up the name associated with slot " "``i`` of the \"fast locals\" storage in this mapping. If the name is not " @@ -1175,94 +1198,94 @@ msgid "" "scopes ` within class bodies." msgstr "" -#: ../../library/dis.rst:1285 +#: ../../library/dis.rst:1307 msgid "" "Stores ``STACK.pop()`` into the cell contained in slot ``i`` of the \"fast " "locals\" storage." msgstr "" -#: ../../library/dis.rst:1294 +#: ../../library/dis.rst:1316 msgid "" "Empties the cell contained in slot ``i`` of the \"fast locals\" storage. " "Used by the :keyword:`del` statement." msgstr "" -#: ../../library/dis.rst:1305 +#: ../../library/dis.rst:1327 msgid "" "Copies the ``n`` free variables from the closure into the frame. Removes the " "need for special code on the caller's side when calling closures." msgstr "" -#: ../../library/dis.rst:1314 +#: ../../library/dis.rst:1336 msgid "" "Raises an exception using one of the 3 forms of the ``raise`` statement, " "depending on the value of *argc*:" msgstr "" -#: ../../library/dis.rst:1317 +#: ../../library/dis.rst:1339 msgid "0: ``raise`` (re-raise previous exception)" msgstr "" -#: ../../library/dis.rst:1318 +#: ../../library/dis.rst:1340 msgid "" "1: ``raise STACK[-1]`` (raise exception instance or type at ``STACK[-1]``)" msgstr "" -#: ../../library/dis.rst:1319 +#: ../../library/dis.rst:1341 msgid "" "2: ``raise STACK[-2] from STACK[-1]`` (raise exception instance or type at " "``STACK[-2]`` with ``__cause__`` set to ``STACK[-1]``)" msgstr "" -#: ../../library/dis.rst:1325 +#: ../../library/dis.rst:1347 msgid "" "Calls a callable object with the number of arguments specified by ``argc``, " "including the named arguments specified by the preceding :opcode:`KW_NAMES`, " "if any. On the stack are (in ascending order), either:" msgstr "" -#: ../../library/dis.rst:1330 +#: ../../library/dis.rst:1352 msgid "NULL" msgstr "" -#: ../../library/dis.rst:1331 ../../library/dis.rst:1337 +#: ../../library/dis.rst:1353 ../../library/dis.rst:1359 msgid "The callable" msgstr "" -#: ../../library/dis.rst:1332 +#: ../../library/dis.rst:1354 msgid "The positional arguments" msgstr "" -#: ../../library/dis.rst:1333 ../../library/dis.rst:1340 +#: ../../library/dis.rst:1355 ../../library/dis.rst:1362 msgid "The named arguments" msgstr "" -#: ../../library/dis.rst:1335 +#: ../../library/dis.rst:1357 msgid "or:" msgstr "或:" -#: ../../library/dis.rst:1338 +#: ../../library/dis.rst:1360 msgid "``self``" msgstr "``self``" -#: ../../library/dis.rst:1339 +#: ../../library/dis.rst:1361 msgid "The remaining positional arguments" msgstr "" -#: ../../library/dis.rst:1342 +#: ../../library/dis.rst:1364 msgid "" "``argc`` is the total of the positional and named arguments, excluding " "``self`` when a ``NULL`` is not present." msgstr "" -#: ../../library/dis.rst:1345 +#: ../../library/dis.rst:1367 msgid "" "``CALL`` pops all arguments and the callable object off the stack, calls the " "callable object with those arguments, and pushes the return value returned " "by the callable object." msgstr "" -#: ../../library/dis.rst:1354 +#: ../../library/dis.rst:1376 msgid "" "Calls a callable object with variable set of positional and keyword " "arguments. If the lowest bit of *flags* is set, the top of the stack " @@ -1274,70 +1297,70 @@ msgid "" "arguments, and pushes the return value returned by the callable object." msgstr "" -#: ../../library/dis.rst:1369 +#: ../../library/dis.rst:1391 msgid "" "Pushes a ``NULL`` to the stack. Used in the call sequence to match the " "``NULL`` pushed by :opcode:`LOAD_METHOD` for non-method calls." msgstr "" -#: ../../library/dis.rst:1378 +#: ../../library/dis.rst:1400 msgid "" "Prefixes :opcode:`CALL`. Stores a reference to ``co_consts[consti]`` into an " "internal variable for use by :opcode:`CALL`. ``co_consts[consti]`` must be a " "tuple of strings." msgstr "" -#: ../../library/dis.rst:1387 +#: ../../library/dis.rst:1409 msgid "" "Pushes a new function object on the stack. From bottom to top, the consumed " "stack must consist of values if the argument carries a specified flag value" msgstr "" -#: ../../library/dis.rst:1390 +#: ../../library/dis.rst:1412 msgid "" "``0x01`` a tuple of default values for positional-only and positional-or-" "keyword parameters in positional order" msgstr "" -#: ../../library/dis.rst:1392 +#: ../../library/dis.rst:1414 msgid "``0x02`` a dictionary of keyword-only parameters' default values" msgstr "" -#: ../../library/dis.rst:1393 +#: ../../library/dis.rst:1415 msgid "``0x04`` a tuple of strings containing parameters' annotations" msgstr "" -#: ../../library/dis.rst:1394 +#: ../../library/dis.rst:1416 msgid "``0x08`` a tuple containing cells for free variables, making a closure" msgstr "" -#: ../../library/dis.rst:1395 +#: ../../library/dis.rst:1417 msgid "the code associated with the function (at ``STACK[-1]``)" msgstr "" -#: ../../library/dis.rst:1397 +#: ../../library/dis.rst:1419 msgid "Flag value ``0x04`` is a tuple of strings instead of dictionary" msgstr "" -#: ../../library/dis.rst:1400 +#: ../../library/dis.rst:1422 msgid "Qualified name at ``STACK[-1]`` was removed." msgstr "" -#: ../../library/dis.rst:1408 +#: ../../library/dis.rst:1430 msgid "" "Pushes a slice object on the stack. *argc* must be 2 or 3. If it is 2, " "implements::" msgstr "" -#: ../../library/dis.rst:1414 +#: ../../library/dis.rst:1436 msgid "if it is 3, implements::" msgstr "" -#: ../../library/dis.rst:1421 +#: ../../library/dis.rst:1443 msgid "See the :func:`slice` built-in function for more information." msgstr "" -#: ../../library/dis.rst:1426 +#: ../../library/dis.rst:1448 msgid "" "Prefixes any opcode which has an argument too big to fit into the default " "one byte. *ext* holds an additional byte which act as higher bits in the " @@ -1345,54 +1368,54 @@ msgid "" "allowed, forming an argument from two-byte to four-byte." msgstr "" -#: ../../library/dis.rst:1434 +#: ../../library/dis.rst:1456 msgid "" "Used for implementing formatted literal strings (f-strings). Pops an " "optional *fmt_spec* from the stack, then a required *value*. *flags* is " "interpreted as follows:" msgstr "" -#: ../../library/dis.rst:1438 +#: ../../library/dis.rst:1460 msgid "``(flags & 0x03) == 0x00``: *value* is formatted as-is." msgstr "" -#: ../../library/dis.rst:1439 +#: ../../library/dis.rst:1461 msgid "" "``(flags & 0x03) == 0x01``: call :func:`str` on *value* before formatting it." msgstr "" -#: ../../library/dis.rst:1441 +#: ../../library/dis.rst:1463 msgid "" "``(flags & 0x03) == 0x02``: call :func:`repr` on *value* before formatting " "it." msgstr "" -#: ../../library/dis.rst:1443 +#: ../../library/dis.rst:1465 msgid "" "``(flags & 0x03) == 0x03``: call :func:`ascii` on *value* before formatting " "it." msgstr "" -#: ../../library/dis.rst:1445 +#: ../../library/dis.rst:1467 msgid "" "``(flags & 0x04) == 0x04``: pop *fmt_spec* from the stack and use it, else " "use an empty *fmt_spec*." msgstr "" -#: ../../library/dis.rst:1448 +#: ../../library/dis.rst:1470 msgid "" "Formatting is performed using :c:func:`PyObject_Format`. The result is " "pushed on the stack." msgstr "" -#: ../../library/dis.rst:1456 +#: ../../library/dis.rst:1478 msgid "" "``STACK[-1]`` is a tuple of keyword attribute names, ``STACK[-2]`` is the " "class being matched against, and ``STACK[-3]`` is the match subject. " "*count* is the number of positional sub-patterns." msgstr "" -#: ../../library/dis.rst:1460 +#: ../../library/dis.rst:1482 msgid "" "Pop ``STACK[-1]``, ``STACK[-2]``, and ``STACK[-3]``. If ``STACK[-3]`` is an " "instance of ``STACK[-2]`` and has the positional and keyword attributes " @@ -1400,258 +1423,258 @@ msgid "" "Otherwise, push ``None``." msgstr "" -#: ../../library/dis.rst:1474 +#: ../../library/dis.rst:1496 msgid "A no-op. Performs internal tracing, debugging and optimization checks." msgstr "" -#: ../../library/dis.rst:1476 +#: ../../library/dis.rst:1498 msgid "The ``where`` operand marks where the ``RESUME`` occurs:" msgstr "" -#: ../../library/dis.rst:1478 +#: ../../library/dis.rst:1500 msgid "" "``0`` The start of a function, which is neither a generator, coroutine nor " "an async generator" msgstr "" -#: ../../library/dis.rst:1480 +#: ../../library/dis.rst:1502 msgid "``1`` After a ``yield`` expression" msgstr "" -#: ../../library/dis.rst:1481 +#: ../../library/dis.rst:1503 msgid "``2`` After a ``yield from`` expression" msgstr "" -#: ../../library/dis.rst:1482 +#: ../../library/dis.rst:1504 msgid "``3`` After an ``await`` expression" msgstr "" -#: ../../library/dis.rst:1489 +#: ../../library/dis.rst:1511 msgid "" "Create a generator, coroutine, or async generator from the current frame. " "Used as first opcode of in code object for the above mentioned callables. " "Clear the current frame and return the newly created generator." msgstr "" -#: ../../library/dis.rst:1498 +#: ../../library/dis.rst:1520 msgid "" "Equivalent to ``STACK[-1] = STACK[-2].send(STACK[-1])``. Used in ``yield " "from`` and ``await`` statements." msgstr "" -#: ../../library/dis.rst:1501 +#: ../../library/dis.rst:1523 msgid "" "If the call raises :exc:`StopIteration`, pop both items, push the " "exception's ``value`` attribute, and increment the bytecode counter by " "*delta*." msgstr "" -#: ../../library/dis.rst:1510 +#: ../../library/dis.rst:1532 msgid "" "This is not really an opcode. It identifies the dividing line between " "opcodes in the range [0,255] which don't use their argument and those that " "do (``< HAVE_ARGUMENT`` and ``>= HAVE_ARGUMENT``, respectively)." msgstr "" -#: ../../library/dis.rst:1514 +#: ../../library/dis.rst:1536 msgid "" "If your application uses pseudo instructions, use the :data:`hasarg` " "collection instead." msgstr "" -#: ../../library/dis.rst:1517 +#: ../../library/dis.rst:1539 msgid "" "Now every instruction has an argument, but opcodes ``< HAVE_ARGUMENT`` " "ignore it. Before, only opcodes ``>= HAVE_ARGUMENT`` had an argument." msgstr "" -#: ../../library/dis.rst:1521 +#: ../../library/dis.rst:1543 msgid "" "Pseudo instructions were added to the :mod:`dis` module, and for them it is " "not true that comparison with ``HAVE_ARGUMENT`` indicates whether they use " "their arg." msgstr "" -#: ../../library/dis.rst:1529 +#: ../../library/dis.rst:1551 msgid "" "Calls an intrinsic function with one argument. Passes ``STACK[-1]`` as the " "argument and sets ``STACK[-1]`` to the result. Used to implement " "functionality that is necessary but not performance critical." msgstr "" -#: ../../library/dis.rst:1533 ../../library/dis.rst:1583 +#: ../../library/dis.rst:1555 ../../library/dis.rst:1605 msgid "The operand determines which intrinsic function is called:" msgstr "" -#: ../../library/dis.rst:1536 ../../library/dis.rst:1586 +#: ../../library/dis.rst:1558 ../../library/dis.rst:1608 msgid "Operand" msgstr "" -#: ../../library/dis.rst:1536 ../../library/dis.rst:1586 +#: ../../library/dis.rst:1558 ../../library/dis.rst:1608 msgid "Description" msgstr "" -#: ../../library/dis.rst:1538 +#: ../../library/dis.rst:1560 msgid "``INTRINSIC_1_INVALID``" msgstr "``INTRINSIC_1_INVALID``" -#: ../../library/dis.rst:1538 ../../library/dis.rst:1588 +#: ../../library/dis.rst:1560 ../../library/dis.rst:1610 msgid "Not valid" msgstr "" -#: ../../library/dis.rst:1540 +#: ../../library/dis.rst:1562 msgid "``INTRINSIC_PRINT``" msgstr "``INTRINSIC_PRINT``" -#: ../../library/dis.rst:1540 +#: ../../library/dis.rst:1562 msgid "Prints the argument to standard out. Used in the REPL." msgstr "" -#: ../../library/dis.rst:1543 +#: ../../library/dis.rst:1565 msgid "``INTRINSIC_IMPORT_STAR``" msgstr "``INTRINSIC_IMPORT_STAR``" -#: ../../library/dis.rst:1543 +#: ../../library/dis.rst:1565 msgid "Performs ``import *`` for the named module." msgstr "" -#: ../../library/dis.rst:1546 +#: ../../library/dis.rst:1568 msgid "``INTRINSIC_STOPITERATION_ERROR``" msgstr "``INTRINSIC_STOPITERATION_ERROR``" -#: ../../library/dis.rst:1546 +#: ../../library/dis.rst:1568 msgid "Extracts the return value from a ``StopIteration`` exception." msgstr "" -#: ../../library/dis.rst:1549 +#: ../../library/dis.rst:1571 msgid "``INTRINSIC_ASYNC_GEN_WRAP``" msgstr "``INTRINSIC_ASYNC_GEN_WRAP``" -#: ../../library/dis.rst:1549 +#: ../../library/dis.rst:1571 msgid "Wraps an aync generator value" msgstr "" -#: ../../library/dis.rst:1551 +#: ../../library/dis.rst:1573 msgid "``INTRINSIC_UNARY_POSITIVE``" msgstr "``INTRINSIC_UNARY_POSITIVE``" -#: ../../library/dis.rst:1551 +#: ../../library/dis.rst:1573 msgid "Performs the unary ``+`` operation" msgstr "" -#: ../../library/dis.rst:1554 +#: ../../library/dis.rst:1576 msgid "``INTRINSIC_LIST_TO_TUPLE``" msgstr "``INTRINSIC_LIST_TO_TUPLE``" -#: ../../library/dis.rst:1554 +#: ../../library/dis.rst:1576 msgid "Converts a list to a tuple" msgstr "" -#: ../../library/dis.rst:1556 +#: ../../library/dis.rst:1578 msgid "``INTRINSIC_TYPEVAR``" msgstr "``INTRINSIC_TYPEVAR``" -#: ../../library/dis.rst:1556 +#: ../../library/dis.rst:1578 msgid "Creates a :class:`typing.TypeVar`" msgstr "" -#: ../../library/dis.rst:1558 +#: ../../library/dis.rst:1580 msgid "``INTRINSIC_PARAMSPEC``" msgstr "``INTRINSIC_PARAMSPEC``" -#: ../../library/dis.rst:1558 +#: ../../library/dis.rst:1580 msgid "Creates a :class:`typing.ParamSpec`" msgstr "" -#: ../../library/dis.rst:1561 +#: ../../library/dis.rst:1583 msgid "``INTRINSIC_TYPEVARTUPLE``" msgstr "``INTRINSIC_TYPEVARTUPLE``" -#: ../../library/dis.rst:1561 +#: ../../library/dis.rst:1583 msgid "Creates a :class:`typing.TypeVarTuple`" msgstr "" -#: ../../library/dis.rst:1564 +#: ../../library/dis.rst:1586 msgid "``INTRINSIC_SUBSCRIPT_GENERIC``" msgstr "``INTRINSIC_SUBSCRIPT_GENERIC``" -#: ../../library/dis.rst:1564 +#: ../../library/dis.rst:1586 msgid "Returns :class:`typing.Generic` subscripted with the argument" msgstr "" -#: ../../library/dis.rst:1567 +#: ../../library/dis.rst:1589 msgid "``INTRINSIC_TYPEALIAS``" msgstr "``INTRINSIC_TYPEALIAS``" -#: ../../library/dis.rst:1567 +#: ../../library/dis.rst:1589 msgid "" "Creates a :class:`typing.TypeAliasType`; used in the :keyword:`type` " "statement. The argument is a tuple of the type alias's name, type " "parameters, and value." msgstr "" -#: ../../library/dis.rst:1579 +#: ../../library/dis.rst:1601 msgid "" "Calls an intrinsic function with two arguments. Passes ``STACK[-2]``, " "``STACK[-1]`` as the arguments and sets ``STACK[-1]`` to the result. Used to " "implement functionality that is necessary but not performance critical." msgstr "" -#: ../../library/dis.rst:1588 +#: ../../library/dis.rst:1610 msgid "``INTRINSIC_2_INVALID``" msgstr "``INTRINSIC_2_INVALID``" -#: ../../library/dis.rst:1590 +#: ../../library/dis.rst:1612 msgid "``INTRINSIC_PREP_RERAISE_STAR``" msgstr "``INTRINSIC_PREP_RERAISE_STAR``" -#: ../../library/dis.rst:1590 +#: ../../library/dis.rst:1612 msgid "Calculates the :exc:`ExceptionGroup` to raise from a ``try-except*``." msgstr "" -#: ../../library/dis.rst:1594 +#: ../../library/dis.rst:1616 msgid "``INTRINSIC_TYPEVAR_WITH_BOUND``" msgstr "``INTRINSIC_TYPEVAR_WITH_BOUND``" -#: ../../library/dis.rst:1594 +#: ../../library/dis.rst:1616 msgid "Creates a :class:`typing.TypeVar` with a bound." msgstr "" -#: ../../library/dis.rst:1597 +#: ../../library/dis.rst:1619 msgid "``INTRINSIC_TYPEVAR_WITH_CONSTRAINTS``" msgstr "``INTRINSIC_TYPEVAR_WITH_CONSTRAINTS``" -#: ../../library/dis.rst:1597 +#: ../../library/dis.rst:1619 msgid "Creates a :class:`typing.TypeVar` with constraints." msgstr "" -#: ../../library/dis.rst:1601 +#: ../../library/dis.rst:1623 msgid "``INTRINSIC_SET_FUNCTION_TYPE_PARAMS``" msgstr "``INTRINSIC_SET_FUNCTION_TYPE_PARAMS``" -#: ../../library/dis.rst:1601 +#: ../../library/dis.rst:1623 msgid "Sets the ``__type_params__`` attribute of a function." msgstr "" -#: ../../library/dis.rst:1608 +#: ../../library/dis.rst:1630 msgid "**Pseudo-instructions**" msgstr "" -#: ../../library/dis.rst:1610 +#: ../../library/dis.rst:1632 msgid "" "These opcodes do not appear in Python bytecode. They are used by the " "compiler but are replaced by real opcodes or removed before bytecode is " "generated." msgstr "" -#: ../../library/dis.rst:1615 +#: ../../library/dis.rst:1637 msgid "" "Set up an exception handler for the following code block. If an exception " "occurs, the value stack level is restored to its current state and control " "is transferred to the exception handler at ``target``." msgstr "" -#: ../../library/dis.rst:1622 +#: ../../library/dis.rst:1644 msgid "" "Like ``SETUP_FINALLY``, but in case of an exception also pushes the last " "instruction (``lasti``) to the stack so that ``RERAISE`` can restore it. If " @@ -1660,75 +1683,75 @@ msgid "" "exception handler at ``target``." msgstr "" -#: ../../library/dis.rst:1631 +#: ../../library/dis.rst:1653 msgid "" "Like ``SETUP_CLEANUP``, but in case of an exception one more item is popped " "from the stack before control is transferred to the exception handler at " "``target``." msgstr "" -#: ../../library/dis.rst:1635 +#: ../../library/dis.rst:1657 msgid "" "This variant is used in :keyword:`with` and :keyword:`async with` " "constructs, which push the return value of the context manager's :meth:" "`~object.__enter__` or :meth:`~object.__aenter__` to the stack." msgstr "" -#: ../../library/dis.rst:1642 +#: ../../library/dis.rst:1664 msgid "" "Marks the end of the code block associated with the last ``SETUP_FINALLY``, " "``SETUP_CLEANUP`` or ``SETUP_WITH``." msgstr "" -#: ../../library/dis.rst:1648 +#: ../../library/dis.rst:1670 msgid "" "Undirected relative jump instructions which are replaced by their directed " "(forward/backward) counterparts by the assembler." msgstr "" -#: ../../library/dis.rst:1653 +#: ../../library/dis.rst:1675 msgid "" "Optimized unbound method lookup. Emitted as a ``LOAD_ATTR`` opcode with a " "flag set in the arg." msgstr "" -#: ../../library/dis.rst:1660 +#: ../../library/dis.rst:1682 msgid "Opcode collections" msgstr "" -#: ../../library/dis.rst:1662 +#: ../../library/dis.rst:1684 msgid "" "These collections are provided for automatic introspection of bytecode " "instructions:" msgstr "" -#: ../../library/dis.rst:1665 +#: ../../library/dis.rst:1687 msgid "" "The collections now contain pseudo instructions as well. These are opcodes " "with values ``>= MIN_PSEUDO_OPCODE``." msgstr "" -#: ../../library/dis.rst:1671 +#: ../../library/dis.rst:1693 msgid "Sequence of operation names, indexable using the bytecode." msgstr "" -#: ../../library/dis.rst:1676 +#: ../../library/dis.rst:1698 msgid "Dictionary mapping operation names to bytecodes." msgstr "" -#: ../../library/dis.rst:1681 +#: ../../library/dis.rst:1703 msgid "Sequence of all compare operation names." msgstr "" -#: ../../library/dis.rst:1686 +#: ../../library/dis.rst:1708 msgid "Sequence of bytecodes that use their argument." msgstr "" -#: ../../library/dis.rst:1693 +#: ../../library/dis.rst:1715 msgid "Sequence of bytecodes that access a constant." msgstr "" -#: ../../library/dis.rst:1698 +#: ../../library/dis.rst:1720 msgid "" "Sequence of bytecodes that access a free variable. 'free' in this context " "refers to names in the current scope that are referenced by inner scopes or " @@ -1736,34 +1759,34 @@ msgid "" "include references to global or builtin scopes." msgstr "" -#: ../../library/dis.rst:1706 +#: ../../library/dis.rst:1728 msgid "Sequence of bytecodes that access an attribute by name." msgstr "" -#: ../../library/dis.rst:1711 +#: ../../library/dis.rst:1733 msgid "Sequence of bytecodes that have a relative jump target." msgstr "" -#: ../../library/dis.rst:1716 +#: ../../library/dis.rst:1738 msgid "Sequence of bytecodes that have an absolute jump target." msgstr "" -#: ../../library/dis.rst:1721 +#: ../../library/dis.rst:1743 msgid "Sequence of bytecodes that access a local variable." msgstr "" -#: ../../library/dis.rst:1726 +#: ../../library/dis.rst:1748 msgid "Sequence of bytecodes of Boolean operations." msgstr "" -#: ../../library/dis.rst:1730 +#: ../../library/dis.rst:1752 msgid "Sequence of bytecodes that set an exception handler." msgstr "" -#: ../../library/dis.rst:1406 +#: ../../library/dis.rst:1428 msgid "built-in function" msgstr "built-in function(內建函式)" -#: ../../library/dis.rst:1406 +#: ../../library/dis.rst:1428 msgid "slice" msgstr "slice(切片)" diff --git a/library/ensurepip.po b/library/ensurepip.po index 095fea9c59..b2b3d46843 100644 --- a/library/ensurepip.po +++ b/library/ensurepip.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-04-24 00:16+0000\n" +"POT-Creation-Date: 2023-10-11 17:13+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-" @@ -81,7 +81,7 @@ msgstr "" #: ../../library/ensurepip.rst:44 msgid "Command line interface" -msgstr "" +msgstr "命令列介面" #: ../../library/ensurepip.rst:46 msgid "" @@ -110,7 +110,7 @@ msgstr "" #: ../../library/ensurepip.rst:64 msgid "" -"``--root ``: Installs ``pip`` relative to the given root directory " +":samp:`--root {dir}`: Installs ``pip`` relative to the given root directory " "rather than the root of the currently active virtual environment (if any) or " "the default root for the current Python installation." msgstr "" @@ -215,7 +215,8 @@ msgid "" "Raises an :ref:`auditing event ` ``ensurepip.bootstrap`` with " "argument ``root``." msgstr "" -"引發一個附帶引數 ``root`` 的\\ :ref:`稽核事件 ` ``ensurepip.bootstrap``。" +"引發一個附帶引數 ``root`` 的\\ :ref:`稽核事件 ` ``ensurepip." +"bootstrap``。" #: ../../library/ensurepip.rst:129 msgid "" diff --git a/library/exceptions.po b/library/exceptions.po index ffbb21c128..903b7da466 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-07-22 00:04+0000\n" +"POT-Creation-Date: 2023-10-11 17:13+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-" @@ -267,37 +267,43 @@ msgstr "" #: ../../library/exceptions.rst:223 msgid "" -"The :attr:`name` and :attr:`path` attributes can be set using keyword-only " -"arguments to the constructor. When set they represent the name of the module " -"that was attempted to be imported and the path to any file which triggered " -"the exception, respectively." +"The optional *name* and *path* keyword-only arguments set the corresponding " +"attributes:" msgstr "" #: ../../library/exceptions.rst:228 +msgid "The name of the module that was attempted to be imported." +msgstr "" + +#: ../../library/exceptions.rst:232 +msgid "The path to any file which triggered the exception." +msgstr "" + +#: ../../library/exceptions.rst:234 msgid "Added the :attr:`name` and :attr:`path` attributes." msgstr "新增 :attr:`name` 與 :attr:`path` 屬性。" -#: ../../library/exceptions.rst:233 +#: ../../library/exceptions.rst:239 msgid "" "A subclass of :exc:`ImportError` which is raised by :keyword:`import` when a " "module could not be located. It is also raised when ``None`` is found in :" "data:`sys.modules`." msgstr "" -#: ../../library/exceptions.rst:242 +#: ../../library/exceptions.rst:248 msgid "" "Raised when a sequence subscript is out of range. (Slice indices are " "silently truncated to fall in the allowed range; if an index is not an " "integer, :exc:`TypeError` is raised.)" msgstr "" -#: ../../library/exceptions.rst:251 +#: ../../library/exceptions.rst:257 msgid "" "Raised when a mapping (dictionary) key is not found in the set of existing " "keys." msgstr "" -#: ../../library/exceptions.rst:258 +#: ../../library/exceptions.rst:264 msgid "" "Raised when the user hits the interrupt key (normally :kbd:`Control-C` or :" "kbd:`Delete`). During execution, a check for interrupts is made regularly. " @@ -306,7 +312,7 @@ msgid "" "the interpreter from exiting." msgstr "" -#: ../../library/exceptions.rst:266 +#: ../../library/exceptions.rst:272 msgid "" "Catching a :exc:`KeyboardInterrupt` requires special consideration. Because " "it can be raised at unpredictable points, it may, in some circumstances, " @@ -315,7 +321,7 @@ msgid "" "avoid raising it entirely. (See :ref:`handlers-and-exceptions`.)" msgstr "" -#: ../../library/exceptions.rst:276 +#: ../../library/exceptions.rst:282 msgid "" "Raised when an operation runs out of memory but the situation may still be " "rescued (by deleting some objects). The associated value is a string " @@ -326,25 +332,25 @@ msgid "" "stack traceback can be printed, in case a run-away program was the cause." msgstr "" -#: ../../library/exceptions.rst:287 +#: ../../library/exceptions.rst:293 msgid "" "Raised when a local or global name is not found. This applies only to " "unqualified names. The associated value is an error message that includes " "the name that could not be found." msgstr "" -#: ../../library/exceptions.rst:291 +#: ../../library/exceptions.rst:297 msgid "" "The :attr:`name` attribute can be set using a keyword-only argument to the " "constructor. When set it represent the name of the variable that was " "attempted to be accessed." msgstr "" -#: ../../library/exceptions.rst:295 +#: ../../library/exceptions.rst:301 msgid "Added the :attr:`name` attribute." msgstr "新增 :attr:`name` 屬性。" -#: ../../library/exceptions.rst:301 +#: ../../library/exceptions.rst:307 msgid "" "This exception is derived from :exc:`RuntimeError`. In user defined base " "classes, abstract methods should raise this exception when they require " @@ -352,28 +358,28 @@ msgid "" "developed to indicate that the real implementation still needs to be added." msgstr "" -#: ../../library/exceptions.rst:308 +#: ../../library/exceptions.rst:314 msgid "" "It should not be used to indicate that an operator or method is not meant to " "be supported at all -- in that case either leave the operator / method " "undefined or, if a subclass, set it to :data:`None`." msgstr "" -#: ../../library/exceptions.rst:314 +#: ../../library/exceptions.rst:320 msgid "" "``NotImplementedError`` and ``NotImplemented`` are not interchangeable, even " "though they have similar names and purposes. See :data:`NotImplemented` for " "details on when to use it." msgstr "" -#: ../../library/exceptions.rst:323 +#: ../../library/exceptions.rst:329 msgid "" "This exception is raised when a system function returns a system-related " "error, including I/O failures such as \"file not found\" or \"disk " "full\" (not for illegal argument types or other incidental errors)." msgstr "" -#: ../../library/exceptions.rst:327 +#: ../../library/exceptions.rst:333 msgid "" "The second form of the constructor sets the corresponding attributes, " "described below. The attributes default to :const:`None` if not specified. " @@ -382,7 +388,7 @@ msgid "" "constructor arguments." msgstr "" -#: ../../library/exceptions.rst:333 +#: ../../library/exceptions.rst:339 msgid "" "The constructor often actually returns a subclass of :exc:`OSError`, as " "described in `OS exceptions`_ below. The particular subclass depends on the " @@ -391,18 +397,18 @@ msgid "" "subclassing." msgstr "" -#: ../../library/exceptions.rst:341 +#: ../../library/exceptions.rst:347 msgid "A numeric error code from the C variable :c:data:`errno`." msgstr "" -#: ../../library/exceptions.rst:345 +#: ../../library/exceptions.rst:351 msgid "" "Under Windows, this gives you the native Windows error code. The :attr:`." "errno` attribute is then an approximate translation, in POSIX terms, of that " "native error code." msgstr "" -#: ../../library/exceptions.rst:349 +#: ../../library/exceptions.rst:355 msgid "" "Under Windows, if the *winerror* constructor argument is an integer, the :" "attr:`.errno` attribute is determined from the Windows error code, and the " @@ -410,14 +416,14 @@ msgid "" "ignored, and the :attr:`winerror` attribute does not exist." msgstr "" -#: ../../library/exceptions.rst:357 +#: ../../library/exceptions.rst:363 msgid "" "The corresponding error message, as provided by the operating system. It is " "formatted by the C functions :c:func:`perror` under POSIX, and :c:func:" "`FormatMessage` under Windows." msgstr "" -#: ../../library/exceptions.rst:365 +#: ../../library/exceptions.rst:371 msgid "" "For exceptions that involve a file system path (such as :func:`open` or :" "func:`os.unlink`), :attr:`filename` is the file name passed to the function. " @@ -426,14 +432,14 @@ msgid "" "the function." msgstr "" -#: ../../library/exceptions.rst:372 +#: ../../library/exceptions.rst:378 msgid "" ":exc:`EnvironmentError`, :exc:`IOError`, :exc:`WindowsError`, :exc:`socket." "error`, :exc:`select.error` and :exc:`mmap.error` have been merged into :exc:" "`OSError`, and the constructor may return a subclass." msgstr "" -#: ../../library/exceptions.rst:378 +#: ../../library/exceptions.rst:384 msgid "" "The :attr:`filename` attribute is now the original file name passed to the " "function, instead of the name encoded to or decoded from the :term:" @@ -441,7 +447,7 @@ msgid "" "argument and attribute was added." msgstr "" -#: ../../library/exceptions.rst:387 +#: ../../library/exceptions.rst:393 msgid "" "Raised when the result of an arithmetic operation is too large to be " "represented. This cannot occur for integers (which would rather raise :exc:" @@ -451,18 +457,18 @@ msgid "" "in C, most floating point operations are not checked." msgstr "" -#: ../../library/exceptions.rst:397 +#: ../../library/exceptions.rst:403 msgid "" "This exception is derived from :exc:`RuntimeError`. It is raised when the " "interpreter detects that the maximum recursion depth (see :func:`sys." "getrecursionlimit`) is exceeded." msgstr "" -#: ../../library/exceptions.rst:401 +#: ../../library/exceptions.rst:407 msgid "Previously, a plain :exc:`RuntimeError` was raised." msgstr "" -#: ../../library/exceptions.rst:407 +#: ../../library/exceptions.rst:413 msgid "" "This exception is raised when a weak reference proxy, created by the :func:" "`weakref.proxy` function, is used to access an attribute of the referent " @@ -470,65 +476,65 @@ msgid "" "references, see the :mod:`weakref` module." msgstr "" -#: ../../library/exceptions.rst:415 +#: ../../library/exceptions.rst:421 msgid "" "Raised when an error is detected that doesn't fall in any of the other " "categories. The associated value is a string indicating what precisely went " "wrong." msgstr "" -#: ../../library/exceptions.rst:422 +#: ../../library/exceptions.rst:428 msgid "" "Raised by built-in function :func:`next` and an :term:`iterator`\\'s :meth:" "`~iterator.__next__` method to signal that there are no further items " "produced by the iterator." msgstr "" -#: ../../library/exceptions.rst:426 +#: ../../library/exceptions.rst:432 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`." msgstr "" -#: ../../library/exceptions.rst:430 +#: ../../library/exceptions.rst:436 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:435 +#: ../../library/exceptions.rst:441 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:439 +#: ../../library/exceptions.rst:445 msgid "" "Added ``value`` attribute and the ability for generator functions to use it " "to return a value." msgstr "" -#: ../../library/exceptions.rst:443 +#: ../../library/exceptions.rst:449 msgid "" "Introduced the RuntimeError transformation via ``from __future__ import " "generator_stop``, see :pep:`479`." msgstr "" -#: ../../library/exceptions.rst:447 +#: ../../library/exceptions.rst:453 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:453 +#: ../../library/exceptions.rst:459 msgid "" "Must be raised by :meth:`~object.__anext__` method of an :term:`asynchronous " "iterator` object to stop the iteration." msgstr "" -#: ../../library/exceptions.rst:460 +#: ../../library/exceptions.rst:466 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:" @@ -536,45 +542,45 @@ msgid "" "or standard input (also interactively)." msgstr "" -#: ../../library/exceptions.rst:466 +#: ../../library/exceptions.rst:472 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:471 +#: ../../library/exceptions.rst:477 msgid "The name of the file the syntax error occurred in." msgstr "" -#: ../../library/exceptions.rst:475 +#: ../../library/exceptions.rst:481 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:480 +#: ../../library/exceptions.rst:486 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:485 +#: ../../library/exceptions.rst:491 msgid "The source code text involved in the error." msgstr "" -#: ../../library/exceptions.rst:489 +#: ../../library/exceptions.rst:495 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:494 +#: ../../library/exceptions.rst:500 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:497 +#: ../../library/exceptions.rst:503 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 " @@ -582,30 +588,30 @@ msgid "" "attribute: ('f-string: ...', ('', 1, 2, '(a b)\\n', 1, 5))." msgstr "" -#: ../../library/exceptions.rst:502 +#: ../../library/exceptions.rst:508 msgid "Added the :attr:`end_lineno` and :attr:`end_offset` attributes." msgstr "新增 :attr:`end_lineno` 與 :attr:`end_offset` 屬性。" -#: ../../library/exceptions.rst:507 +#: ../../library/exceptions.rst:513 msgid "" "Base class for syntax errors related to incorrect indentation. This is a " "subclass of :exc:`SyntaxError`." msgstr "" -#: ../../library/exceptions.rst:513 +#: ../../library/exceptions.rst:519 msgid "" "Raised when indentation contains an inconsistent use of tabs and spaces. " "This is a subclass of :exc:`IndentationError`." msgstr "" -#: ../../library/exceptions.rst:519 +#: ../../library/exceptions.rst:525 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:523 +#: ../../library/exceptions.rst:529 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." @@ -614,7 +620,7 @@ msgid "" "possible the source of the program that triggered the error." msgstr "" -#: ../../library/exceptions.rst:532 +#: ../../library/exceptions.rst:538 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 " @@ -628,7 +634,7 @@ msgid "" "printed and the exit status is one." msgstr "" -#: ../../library/exceptions.rst:543 +#: ../../library/exceptions.rst:549 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 " @@ -638,20 +644,20 @@ msgid "" "child process after a call to :func:`os.fork`)." msgstr "" -#: ../../library/exceptions.rst:552 +#: ../../library/exceptions.rst:558 msgid "" "The exit status or error message that is passed to the constructor. " "(Defaults to ``None``.)" msgstr "" -#: ../../library/exceptions.rst:558 +#: ../../library/exceptions.rst:564 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:561 +#: ../../library/exceptions.rst:567 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 " @@ -659,7 +665,7 @@ msgid "" "implementation, :exc:`NotImplementedError` is the proper exception to raise." msgstr "" -#: ../../library/exceptions.rst:566 +#: ../../library/exceptions.rst:572 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 " @@ -667,99 +673,99 @@ msgid "" "should result in a :exc:`ValueError`." msgstr "" -#: ../../library/exceptions.rst:573 +#: ../../library/exceptions.rst:579 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:580 +#: ../../library/exceptions.rst:586 msgid "" "Raised when a Unicode-related encoding or decoding error occurs. It is a " "subclass of :exc:`ValueError`." msgstr "" -#: ../../library/exceptions.rst:583 +#: ../../library/exceptions.rst:589 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:589 +#: ../../library/exceptions.rst:595 msgid "The name of the encoding that raised the error." msgstr "" -#: ../../library/exceptions.rst:593 +#: ../../library/exceptions.rst:599 msgid "A string describing the specific codec error." msgstr "" -#: ../../library/exceptions.rst:597 +#: ../../library/exceptions.rst:603 msgid "The object the codec was attempting to encode or decode." msgstr "" -#: ../../library/exceptions.rst:601 +#: ../../library/exceptions.rst:607 msgid "The first index of invalid data in :attr:`object`." msgstr "" -#: ../../library/exceptions.rst:605 +#: ../../library/exceptions.rst:611 msgid "The index after the last invalid data in :attr:`object`." msgstr "" -#: ../../library/exceptions.rst:610 +#: ../../library/exceptions.rst:616 msgid "" "Raised when a Unicode-related error occurs during encoding. It is a " "subclass of :exc:`UnicodeError`." msgstr "" -#: ../../library/exceptions.rst:616 +#: ../../library/exceptions.rst:622 msgid "" "Raised when a Unicode-related error occurs during decoding. It is a " "subclass of :exc:`UnicodeError`." msgstr "" -#: ../../library/exceptions.rst:622 +#: ../../library/exceptions.rst:628 msgid "" "Raised when a Unicode-related error occurs during translating. It is a " "subclass of :exc:`UnicodeError`." msgstr "" -#: ../../library/exceptions.rst:628 +#: ../../library/exceptions.rst:634 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:635 +#: ../../library/exceptions.rst:641 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:640 +#: ../../library/exceptions.rst:646 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:649 +#: ../../library/exceptions.rst:655 msgid "Only available on Windows." msgstr "" -#: ../../library/exceptions.rst:653 +#: ../../library/exceptions.rst:659 msgid "OS exceptions" msgstr "" -#: ../../library/exceptions.rst:655 +#: ../../library/exceptions.rst:661 msgid "" "The following exceptions are subclasses of :exc:`OSError`, they get raised " "depending on the system error code." msgstr "" -#: ../../library/exceptions.rst:660 +#: ../../library/exceptions.rst:666 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." @@ -767,36 +773,36 @@ msgid "" "const:`~errno.EINPROGRESS`." msgstr "" -#: ../../library/exceptions.rst:665 +#: ../../library/exceptions.rst:671 msgid "" "In addition to those of :exc:`OSError`, :exc:`BlockingIOError` can have one " "more attribute:" msgstr "" -#: ../../library/exceptions.rst:670 +#: ../../library/exceptions.rst:676 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:676 +#: ../../library/exceptions.rst:682 msgid "" "Raised when an operation on a child process failed. Corresponds to :c:data:" "`errno` :py:const:`~errno.ECHILD`." msgstr "" -#: ../../library/exceptions.rst:681 +#: ../../library/exceptions.rst:687 msgid "A base class for connection-related issues." msgstr "" -#: ../../library/exceptions.rst:683 +#: ../../library/exceptions.rst:689 msgid "" "Subclasses are :exc:`BrokenPipeError`, :exc:`ConnectionAbortedError`, :exc:" "`ConnectionRefusedError` and :exc:`ConnectionResetError`." msgstr "" -#: ../../library/exceptions.rst:688 +#: ../../library/exceptions.rst:694 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 " @@ -804,58 +810,58 @@ msgid "" "`~errno.EPIPE` and :py:const:`~errno.ESHUTDOWN`." msgstr "" -#: ../../library/exceptions.rst:695 +#: ../../library/exceptions.rst:701 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:701 +#: ../../library/exceptions.rst:707 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:707 +#: ../../library/exceptions.rst:713 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:713 +#: ../../library/exceptions.rst:719 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:718 +#: ../../library/exceptions.rst:724 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:723 +#: ../../library/exceptions.rst:729 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:726 +#: ../../library/exceptions.rst:732 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:733 +#: ../../library/exceptions.rst:739 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:739 +#: ../../library/exceptions.rst:745 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 " @@ -864,7 +870,7 @@ msgid "" "ENOTDIR`." msgstr "" -#: ../../library/exceptions.rst:747 +#: ../../library/exceptions.rst:753 msgid "" "Raised when trying to run an operation without the adequate access rights - " "for example filesystem permissions. Corresponds to :c:data:`errno` :py:const:" @@ -872,131 +878,131 @@ msgid "" "ENOTCAPABLE`." msgstr "" -#: ../../library/exceptions.rst:752 +#: ../../library/exceptions.rst:758 msgid "" "WASI's :py:const:`~errno.ENOTCAPABLE` is now mapped to :exc:" "`PermissionError`." msgstr "" -#: ../../library/exceptions.rst:758 +#: ../../library/exceptions.rst:764 msgid "" "Raised when a given process doesn't exist. Corresponds to :c:data:`errno` :" "py:const:`~errno.ESRCH`." msgstr "" -#: ../../library/exceptions.rst:763 +#: ../../library/exceptions.rst:769 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:766 +#: ../../library/exceptions.rst:772 msgid "All the above :exc:`OSError` subclasses were added." msgstr "" -#: ../../library/exceptions.rst:772 +#: ../../library/exceptions.rst:778 msgid ":pep:`3151` - Reworking the OS and IO exception hierarchy" msgstr "" -#: ../../library/exceptions.rst:778 +#: ../../library/exceptions.rst:784 msgid "Warnings" msgstr "警告" -#: ../../library/exceptions.rst:780 +#: ../../library/exceptions.rst:786 msgid "" "The following exceptions are used as warning categories; see the :ref:" "`warning-categories` documentation for more details." msgstr "" -#: ../../library/exceptions.rst:785 +#: ../../library/exceptions.rst:791 msgid "Base class for warning categories." msgstr "" -#: ../../library/exceptions.rst:790 +#: ../../library/exceptions.rst:796 msgid "Base class for warnings generated by user code." msgstr "" -#: ../../library/exceptions.rst:795 +#: ../../library/exceptions.rst:801 msgid "" "Base class for warnings about deprecated features when those warnings are " "intended for other Python developers." msgstr "" -#: ../../library/exceptions.rst:798 +#: ../../library/exceptions.rst:804 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:802 ../../library/exceptions.rst:818 +#: ../../library/exceptions.rst:808 ../../library/exceptions.rst:824 msgid "The deprecation policy is described in :pep:`387`." msgstr "" -#: ../../library/exceptions.rst:807 +#: ../../library/exceptions.rst:813 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:811 +#: ../../library/exceptions.rst:817 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:815 ../../library/exceptions.rst:841 -#: ../../library/exceptions.rst:868 +#: ../../library/exceptions.rst:821 ../../library/exceptions.rst:847 +#: ../../library/exceptions.rst:874 msgid "" "Ignored by the default warning filters. Enabling the :ref:`Python " "Development Mode ` shows this warning." msgstr "" -#: ../../library/exceptions.rst:823 +#: ../../library/exceptions.rst:829 msgid "Base class for warnings about dubious syntax." msgstr "" -#: ../../library/exceptions.rst:828 +#: ../../library/exceptions.rst:834 msgid "Base class for warnings about dubious runtime behavior." msgstr "" -#: ../../library/exceptions.rst:833 +#: ../../library/exceptions.rst:839 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:839 +#: ../../library/exceptions.rst:845 msgid "Base class for warnings about probable mistakes in module imports." msgstr "" -#: ../../library/exceptions.rst:847 +#: ../../library/exceptions.rst:853 msgid "Base class for warnings related to Unicode." msgstr "" -#: ../../library/exceptions.rst:852 +#: ../../library/exceptions.rst:858 msgid "Base class for warnings related to encodings." msgstr "" -#: ../../library/exceptions.rst:854 +#: ../../library/exceptions.rst:860 msgid "See :ref:`io-encoding-warning` for details." msgstr "細節請見 :ref:`io-encoding-warning`\\ 。" -#: ../../library/exceptions.rst:861 +#: ../../library/exceptions.rst:867 msgid "" "Base class for warnings related to :class:`bytes` and :class:`bytearray`." msgstr "" -#: ../../library/exceptions.rst:866 +#: ../../library/exceptions.rst:872 msgid "Base class for warnings related to resource usage." msgstr "" -#: ../../library/exceptions.rst:877 +#: ../../library/exceptions.rst:883 msgid "Exception groups" msgstr "" -#: ../../library/exceptions.rst:879 +#: ../../library/exceptions.rst:885 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 " @@ -1005,7 +1011,7 @@ msgid "" "based on the types of the contained exceptions." msgstr "" -#: ../../library/exceptions.rst:888 +#: ../../library/exceptions.rst:894 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 " @@ -1016,7 +1022,7 @@ msgid "" "exc:`BaseExceptionGroup`." msgstr "" -#: ../../library/exceptions.rst:896 +#: ../../library/exceptions.rst:902 msgid "" "The :exc:`BaseExceptionGroup` constructor returns an :exc:`ExceptionGroup` " "rather than a :exc:`BaseExceptionGroup` if all contained exceptions are :exc:" @@ -1025,23 +1031,23 @@ msgid "" "`TypeError` if any contained exception is not an :exc:`Exception` subclass." msgstr "" -#: ../../library/exceptions.rst:905 +#: ../../library/exceptions.rst:911 msgid "The ``msg`` argument to the constructor. This is a read-only attribute." msgstr "" -#: ../../library/exceptions.rst:909 +#: ../../library/exceptions.rst:915 msgid "" "A tuple of the exceptions in the ``excs`` sequence given to the constructor. " "This is a read-only attribute." msgstr "" -#: ../../library/exceptions.rst:914 +#: ../../library/exceptions.rst:920 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:917 +#: ../../library/exceptions.rst:923 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 " @@ -1049,7 +1055,7 @@ msgid "" "the same check that is used in an ``except`` clause." msgstr "" -#: ../../library/exceptions.rst:922 +#: ../../library/exceptions.rst:928 msgid "" "The nesting structure of the current exception is preserved in the result, " "as are the values of its :attr:`message`, :attr:`__traceback__`, :attr:" @@ -1057,34 +1063,34 @@ msgid "" "groups are omitted from the result." msgstr "" -#: ../../library/exceptions.rst:927 +#: ../../library/exceptions.rst:933 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:933 +#: ../../library/exceptions.rst:939 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:939 +#: ../../library/exceptions.rst:945 msgid "" "Returns an exception group with the same :attr:`message`, but which wraps " "the exceptions in ``excs``." msgstr "" -#: ../../library/exceptions.rst:942 +#: ../../library/exceptions.rst:948 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:947 +#: ../../library/exceptions.rst:953 msgid "" ":meth:`subgroup` and :meth:`split` copy the :attr:`__traceback__`, :attr:" "`__cause__`, :attr:`__context__` and :attr:`__notes__` fields from the " @@ -1092,7 +1098,7 @@ msgid "" "fields do not need to be updated by :meth:`derive`. ::" msgstr "" -#: ../../library/exceptions.rst:976 +#: ../../library/exceptions.rst:982 msgid "" "Note that :exc:`BaseExceptionGroup` defines :meth:`__new__`, so subclasses " "that need a different constructor signature need to override that rather " @@ -1101,18 +1107,18 @@ msgid "" "from it. ::" msgstr "" -#: ../../library/exceptions.rst:991 +#: ../../library/exceptions.rst:997 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:999 +#: ../../library/exceptions.rst:1005 msgid "Exception hierarchy" msgstr "" -#: ../../library/exceptions.rst:1001 +#: ../../library/exceptions.rst:1007 msgid "The class hierarchy for built-in exceptions is:" msgstr "" @@ -1137,10 +1143,10 @@ msgstr "raise" msgid "assert" msgstr "assert" -#: ../../library/exceptions.rst:321 +#: ../../library/exceptions.rst:327 msgid "module" msgstr "module(模組)" -#: ../../library/exceptions.rst:321 +#: ../../library/exceptions.rst:327 msgid "errno" msgstr "errno" diff --git a/library/functions.po b/library/functions.po index e26b4be9d6..85c5c1ace1 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-08-07 00:03+0000\n" +"POT-Creation-Date: 2023-10-11 17:13+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-" @@ -2167,7 +2167,7 @@ msgstr "" msgid "" "``'xmlcharrefreplace'`` is only supported when writing to a file. Characters " "not supported by the encoding are replaced with the appropriate XML " -"character reference ``&#nnn;``." +"character reference :samp:`&#{nnn};`." msgstr "" #: ../../library/functions.rst:1276 diff --git a/library/gettext.po b/library/gettext.po index 1b56ff954e..8933fb9e99 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-07-24 00:03+0000\n" +"POT-Creation-Date: 2023-10-11 17:13+0000\n" "PO-Revision-Date: 2018-05-23 16:02+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -84,7 +84,7 @@ msgstr "" msgid "" "Return the localized translation of *message*, based on the current global " "domain, language, and locale directory. This function is usually aliased " -"as :func:`_` in the local namespace (see examples below)." +"as :func:`!_` in the local namespace (see examples below)." msgstr "" #: ../../library/gettext.rst:66 @@ -124,7 +124,7 @@ msgstr "" #: ../../library/gettext.rst:101 msgid "" -"Note that GNU :program:`gettext` also defines a :func:`dcgettext` method, " +"Note that GNU :program:`gettext` also defines a :func:`!dcgettext` method, " "but this was deemed not useful and so it is currently unimplemented." msgstr "" @@ -144,7 +144,7 @@ msgid "" "gettext` defines a :class:`GNUTranslations` class which implements the " "parsing of GNU :file:`.mo` format files, and has methods for returning " "strings. Instances of this class can also install themselves in the built-in " -"namespace as the function :func:`_`." +"namespace as the function :func:`!_`." msgstr "" #: ../../library/gettext.rst:127 @@ -186,17 +186,15 @@ msgstr "" #: ../../library/gettext.rst:153 msgid "" -"Return a :class:`*Translations` instance based on the *domain*, *localedir*, " -"and *languages*, which are first passed to :func:`find` to get a list of the " +"Return a ``*Translations`` instance based on the *domain*, *localedir*, and " +"*languages*, which are first passed to :func:`find` to get a list of the " "associated :file:`.mo` file paths. Instances with identical :file:`.mo` " "file names are cached. The actual class instantiated is *class_* if " "provided, otherwise :class:`GNUTranslations`. The class's constructor must " -"take a single :term:`file object` argument. If provided, *codeset* will " -"change the charset used to encode translated strings in the :meth:" -"`~NullTranslations.lgettext` and :meth:`~NullTranslations.lngettext` methods." +"take a single :term:`file object` argument." msgstr "" -#: ../../library/gettext.rst:163 +#: ../../library/gettext.rst:160 msgid "" "If multiple files are found, later files are used as fallbacks for earlier " "ones. To allow setting the fallback, :func:`copy.copy` is used to clone each " @@ -204,57 +202,57 @@ msgid "" "with the cache." msgstr "" -#: ../../library/gettext.rst:168 +#: ../../library/gettext.rst:165 msgid "" "If no :file:`.mo` file is found, this function raises :exc:`OSError` if " "*fallback* is false (which is the default), and returns a :class:" "`NullTranslations` instance if *fallback* is true." msgstr "" -#: ../../library/gettext.rst:172 -msgid ":exc:`IOError` used to be raised instead of :exc:`OSError`." +#: ../../library/gettext.rst:169 +msgid ":exc:`IOError` used to be raised, it is now an alias of :exc:`OSError`." msgstr "" -#: ../../library/gettext.rst:175 +#: ../../library/gettext.rst:172 msgid "*codeset* parameter is removed." msgstr "*codeset* 參數被移除。" -#: ../../library/gettext.rst:180 +#: ../../library/gettext.rst:177 msgid "" -"This installs the function :func:`_` in Python's builtins namespace, based " +"This installs the function :func:`!_` in Python's builtins namespace, based " "on *domain* and *localedir* which are passed to the function :func:" "`translation`." msgstr "" -#: ../../library/gettext.rst:183 +#: ../../library/gettext.rst:180 msgid "" "For the *names* parameter, please see the description of the translation " "object's :meth:`~NullTranslations.install` method." msgstr "" -#: ../../library/gettext.rst:186 +#: ../../library/gettext.rst:183 msgid "" "As seen below, you usually mark the strings in your application that are " -"candidates for translation, by wrapping them in a call to the :func:`_` " +"candidates for translation, by wrapping them in a call to the :func:`!_` " "function, like this::" msgstr "" -#: ../../library/gettext.rst:192 +#: ../../library/gettext.rst:189 msgid "" -"For convenience, you want the :func:`_` function to be installed in Python's " -"builtins namespace, so it is easily accessible in all modules of your " -"application." +"For convenience, you want the :func:`!_` function to be installed in " +"Python's builtins namespace, so it is easily accessible in all modules of " +"your application." msgstr "" -#: ../../library/gettext.rst:196 +#: ../../library/gettext.rst:193 msgid "*names* is now a keyword-only parameter." msgstr "" -#: ../../library/gettext.rst:200 +#: ../../library/gettext.rst:197 msgid "The :class:`NullTranslations` class" msgstr "" -#: ../../library/gettext.rst:202 +#: ../../library/gettext.rst:199 msgid "" "Translation classes are what actually implement the translation of original " "source file message strings to translated message strings. The base class " @@ -263,7 +261,7 @@ msgid "" "classes. Here are the methods of :class:`!NullTranslations`:" msgstr "" -#: ../../library/gettext.rst:211 +#: ../../library/gettext.rst:208 msgid "" "Takes an optional :term:`file object` *fp*, which is ignored by the base " "class. Initializes \"protected\" instance variables *_info* and *_charset* " @@ -272,7 +270,7 @@ msgid "" "not ``None``." msgstr "" -#: ../../library/gettext.rst:219 +#: ../../library/gettext.rst:216 msgid "" "No-op in the base class, this method takes file object *fp*, and reads the " "data from the file, initializing its message catalog. If you have an " @@ -280,86 +278,86 @@ msgid "" "parse your format." msgstr "" -#: ../../library/gettext.rst:227 +#: ../../library/gettext.rst:224 msgid "" "Add *fallback* as the fallback object for the current translation object. A " "translation object should consult the fallback if it cannot provide a " "translation for a given message." msgstr "" -#: ../../library/gettext.rst:234 +#: ../../library/gettext.rst:231 msgid "" "If a fallback has been set, forward :meth:`!gettext` to the fallback. " "Otherwise, return *message*. Overridden in derived classes." msgstr "" -#: ../../library/gettext.rst:240 +#: ../../library/gettext.rst:237 msgid "" "If a fallback has been set, forward :meth:`!ngettext` to the fallback. " "Otherwise, return *singular* if *n* is 1; return *plural* otherwise. " "Overridden in derived classes." msgstr "" -#: ../../library/gettext.rst:247 +#: ../../library/gettext.rst:244 msgid "" "If a fallback has been set, forward :meth:`pgettext` to the fallback. " "Otherwise, return the translated message. Overridden in derived classes." msgstr "" -#: ../../library/gettext.rst:255 +#: ../../library/gettext.rst:252 msgid "" "If a fallback has been set, forward :meth:`npgettext` to the fallback. " "Otherwise, return the translated message. Overridden in derived classes." msgstr "" -#: ../../library/gettext.rst:263 +#: ../../library/gettext.rst:260 msgid "" "Return the \"protected\" :attr:`_info` variable, a dictionary containing the " "metadata found in the message catalog file." msgstr "" -#: ../../library/gettext.rst:269 +#: ../../library/gettext.rst:266 msgid "Return the encoding of the message catalog file." msgstr "" -#: ../../library/gettext.rst:274 +#: ../../library/gettext.rst:271 msgid "" "This method installs :meth:`.gettext` into the built-in namespace, binding " "it to ``_``." msgstr "" -#: ../../library/gettext.rst:277 +#: ../../library/gettext.rst:274 msgid "" "If the *names* parameter is given, it must be a sequence containing the " "names of functions you want to install in the builtins namespace in addition " -"to :func:`_`. Supported names are ``'gettext'``, ``'ngettext'``, " -"``'pgettext'``, ``'npgettext'``, ``'lgettext'``, and ``'lngettext'``." +"to :func:`!_`. Supported names are ``'gettext'``, ``'ngettext'``, " +"``'pgettext'``, and ``'npgettext'``." msgstr "" -#: ../../library/gettext.rst:282 +#: ../../library/gettext.rst:279 msgid "" "Note that this is only one way, albeit the most convenient way, to make the :" -"func:`_` function available to your application. Because it affects the " +"func:`!_` function available to your application. Because it affects the " "entire application globally, and specifically the built-in namespace, " -"localized modules should never install :func:`_`. Instead, they should use " -"this code to make :func:`_` available to their module::" +"localized modules should never install :func:`!_`. Instead, they should use " +"this code to make :func:`!_` available to their module::" msgstr "" -#: ../../library/gettext.rst:292 +#: ../../library/gettext.rst:289 msgid "" -"This puts :func:`_` only in the module's global namespace and so only " +"This puts :func:`!_` only in the module's global namespace and so only " "affects calls within this module." msgstr "" -#: ../../library/gettext.rst:295 +#: ../../library/gettext.rst:292 msgid "Added ``'pgettext'`` and ``'npgettext'``." msgstr "新增 ``'pgettext'`` 與 ``'npgettext'``\\ 。" -#: ../../library/gettext.rst:300 +#: ../../library/gettext.rst:297 msgid "The :class:`GNUTranslations` class" msgstr "" -#: ../../library/gettext.rst:302 +#: ../../library/gettext.rst:299 msgid "" "The :mod:`gettext` module provides one additional class derived from :class:" "`NullTranslations`: :class:`GNUTranslations`. This class overrides :meth:" @@ -367,7 +365,7 @@ msgid "" "in both big-endian and little-endian format." msgstr "" -#: ../../library/gettext.rst:307 +#: ../../library/gettext.rst:304 msgid "" ":class:`GNUTranslations` parses optional metadata out of the translation " "catalog. It is convention with GNU :program:`gettext` to include metadata as " @@ -380,31 +378,31 @@ msgid "" "to Unicode using this encoding, else ASCII is assumed." msgstr "" -#: ../../library/gettext.rst:317 +#: ../../library/gettext.rst:314 msgid "" -"Since message ids are read as Unicode strings too, all :meth:`*gettext` " +"Since message ids are read as Unicode strings too, all ``*gettext()`` " "methods will assume message ids as Unicode strings, not byte strings." msgstr "" -#: ../../library/gettext.rst:320 +#: ../../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." msgstr "" -#: ../../library/gettext.rst:323 +#: ../../library/gettext.rst:320 msgid "" "If the :file:`.mo` file's magic number is invalid, the major version number " "is unexpected, or if other problems occur while reading the file, " "instantiating a :class:`GNUTranslations` class can raise :exc:`OSError`." msgstr "" -#: ../../library/gettext.rst:329 +#: ../../library/gettext.rst:326 msgid "" "The following methods are overridden from the base class implementation:" msgstr "" -#: ../../library/gettext.rst:333 +#: ../../library/gettext.rst:330 msgid "" "Look up the *message* id in the catalog and return the corresponding message " "string, as a Unicode string. If there is no entry in the catalog for the " @@ -413,14 +411,14 @@ msgid "" "*message* id is returned." msgstr "" -#: ../../library/gettext.rst:342 +#: ../../library/gettext.rst:339 msgid "" "Do a plural-forms lookup of a message id. *singular* is used as the message " "id for purposes of lookup in the catalog, while *n* is used to determine " "which plural form to use. The returned message string is a Unicode string." msgstr "" -#: ../../library/gettext.rst:346 +#: ../../library/gettext.rst:343 msgid "" "If the message id is not found in the catalog, and a fallback is specified, " "the request is forwarded to the fallback's :meth:`~NullTranslations." @@ -428,14 +426,14 @@ msgid "" "*plural* is returned in all other cases." msgstr "" -#: ../../library/gettext.rst:351 +#: ../../library/gettext.rst:348 msgid "Here is an example::" msgstr "" "以下是個範例:\n" "\n" "::" -#: ../../library/gettext.rst:363 +#: ../../library/gettext.rst:360 msgid "" "Look up the *context* and *message* id in the catalog and return the " "corresponding message string, as a Unicode string. If there is no entry in " @@ -444,14 +442,14 @@ msgid "" "Otherwise, the *message* id is returned." msgstr "" -#: ../../library/gettext.rst:374 +#: ../../library/gettext.rst:371 msgid "" "Do a plural-forms lookup of a message id. *singular* is used as the message " "id for purposes of lookup in the catalog, while *n* is used to determine " "which plural form to use." msgstr "" -#: ../../library/gettext.rst:378 +#: ../../library/gettext.rst:375 msgid "" "If the message id for *context* is not found in the catalog, and a fallback " "is specified, the request is forwarded to the fallback's :meth:`npgettext` " @@ -459,45 +457,45 @@ msgid "" "returned in all other cases." msgstr "" -#: ../../library/gettext.rst:387 +#: ../../library/gettext.rst:384 msgid "Solaris message catalog support" msgstr "" -#: ../../library/gettext.rst:389 +#: ../../library/gettext.rst:386 msgid "" "The Solaris operating system defines its own binary :file:`.mo` file format, " "but since no documentation can be found on this format, it is not supported " "at this time." msgstr "" -#: ../../library/gettext.rst:395 +#: ../../library/gettext.rst:392 msgid "The Catalog constructor" msgstr "" -#: ../../library/gettext.rst:399 +#: ../../library/gettext.rst:396 msgid "" "GNOME uses a version of the :mod:`gettext` module by James Henstridge, but " "this version has a slightly different API. Its documented usage was::" msgstr "" -#: ../../library/gettext.rst:407 +#: ../../library/gettext.rst:404 msgid "" -"For compatibility with this older module, the function :func:`Catalog` is an " -"alias for the :func:`translation` function described above." +"For compatibility with this older module, the function :func:`!Catalog` is " +"an alias for the :func:`translation` function described above." msgstr "" -#: ../../library/gettext.rst:410 +#: ../../library/gettext.rst:407 msgid "" "One difference between this module and Henstridge's: his catalog objects " "supported access through a mapping API, but this appears to be unused and so " "is not currently supported." msgstr "" -#: ../../library/gettext.rst:417 +#: ../../library/gettext.rst:414 msgid "Internationalizing your programs and modules" msgstr "" -#: ../../library/gettext.rst:419 +#: ../../library/gettext.rst:416 msgid "" "Internationalization (I18N) refers to the operation by which a program is " "made aware of multiple languages. Localization (L10N) refers to the " @@ -506,41 +504,41 @@ msgid "" "Python programs, you need to take the following steps:" msgstr "" -#: ../../library/gettext.rst:425 +#: ../../library/gettext.rst:422 msgid "" "prepare your program or module by specially marking translatable strings" msgstr "" -#: ../../library/gettext.rst:427 +#: ../../library/gettext.rst:424 msgid "" "run a suite of tools over your marked files to generate raw messages catalogs" msgstr "" -#: ../../library/gettext.rst:429 +#: ../../library/gettext.rst:426 msgid "create language-specific translations of the message catalogs" msgstr "" -#: ../../library/gettext.rst:431 +#: ../../library/gettext.rst:428 msgid "" "use the :mod:`gettext` module so that message strings are properly translated" msgstr "" -#: ../../library/gettext.rst:433 +#: ../../library/gettext.rst:430 msgid "" "In order to prepare your code for I18N, you need to look at all the strings " "in your files. Any string that needs to be translated should be marked by " -"wrapping it in ``_('...')`` --- that is, a call to the function :func:`_`. " -"For example::" +"wrapping it in ``_('...')`` --- that is, a call to the function :func:`_ " +"`. For example::" msgstr "" -#: ../../library/gettext.rst:442 +#: ../../library/gettext.rst:439 msgid "" "In this example, the string ``'writing a log message'`` is marked as a " "candidate for translation, while the strings ``'mylog.txt'`` and ``'w'`` are " "not." msgstr "" -#: ../../library/gettext.rst:445 +#: ../../library/gettext.rst:442 msgid "" "There are a few tools to extract the strings meant for translation. The " "original GNU :program:`gettext` only supported C or C++ source code but its " @@ -553,7 +551,7 @@ msgid "" "utils>`__." msgstr "" -#: ../../library/gettext.rst:455 +#: ../../library/gettext.rst:452 msgid "" "(Python also includes pure-Python versions of these programs, called :" "program:`pygettext.py` and :program:`msgfmt.py`; some Python distributions " @@ -566,7 +564,7 @@ msgid "" "GNU :program:`gettext` package to internationalize your Python applications.)" msgstr "" -#: ../../library/gettext.rst:467 +#: ../../library/gettext.rst:464 msgid "" ":program:`xgettext`, :program:`pygettext`, and similar tools generate :file:" "`.po` files that are message catalogs. They are structured human-readable " @@ -574,7 +572,7 @@ msgid "" "placeholder for the translated versions of these strings." msgstr "" -#: ../../library/gettext.rst:473 +#: ../../library/gettext.rst:470 msgid "" "Copies of these :file:`.po` files are then handed over to the individual " "human translators who write translations for every supported natural " @@ -585,25 +583,25 @@ msgid "" "processing at run-time." msgstr "" -#: ../../library/gettext.rst:482 +#: ../../library/gettext.rst:479 msgid "" "How you use the :mod:`gettext` module in your code depends on whether you " "are internationalizing a single module or your entire application. The next " "two sections will discuss each case." msgstr "" -#: ../../library/gettext.rst:488 +#: ../../library/gettext.rst:485 msgid "Localizing your module" msgstr "" -#: ../../library/gettext.rst:490 +#: ../../library/gettext.rst:487 msgid "" "If you are localizing your module, you must take care not to make global " "changes, e.g. to the built-in namespace. You should not use the GNU :program:" "`gettext` API but instead the class-based API." msgstr "" -#: ../../library/gettext.rst:494 +#: ../../library/gettext.rst:491 msgid "" "Let's say your module is called \"spam\" and the module's various natural " "language translation :file:`.mo` files reside in :file:`/usr/share/locale` " @@ -611,143 +609,143 @@ msgid "" "your module::" msgstr "" -#: ../../library/gettext.rst:505 +#: ../../library/gettext.rst:502 msgid "Localizing your application" msgstr "" -#: ../../library/gettext.rst:507 +#: ../../library/gettext.rst:504 msgid "" -"If you are localizing your application, you can install the :func:`_` " +"If you are localizing your application, you can install the :func:`!_` " "function globally into the built-in namespace, usually in the main driver " "file of your application. This will let all your application-specific files " "just use ``_('...')`` without having to explicitly install it in each file." msgstr "" -#: ../../library/gettext.rst:512 +#: ../../library/gettext.rst:509 msgid "" "In the simple case then, you need only add the following bit of code to the " "main driver file of your application::" msgstr "" -#: ../../library/gettext.rst:518 +#: ../../library/gettext.rst:515 msgid "" "If you need to set the locale directory, you can pass it into the :func:" "`install` function::" msgstr "" -#: ../../library/gettext.rst:526 +#: ../../library/gettext.rst:523 msgid "Changing languages on the fly" msgstr "" -#: ../../library/gettext.rst:528 +#: ../../library/gettext.rst:525 msgid "" "If your program needs to support many languages at the same time, you may " "want to create multiple translation instances and then switch between them " "explicitly, like so::" msgstr "" -#: ../../library/gettext.rst:549 +#: ../../library/gettext.rst:546 msgid "Deferred translations" msgstr "" -#: ../../library/gettext.rst:551 +#: ../../library/gettext.rst:548 msgid "" "In most coding situations, strings are translated where they are coded. " "Occasionally however, you need to mark strings for translation, but defer " "actual translation until later. A classic example is::" msgstr "" -#: ../../library/gettext.rst:564 +#: ../../library/gettext.rst:561 msgid "" "Here, you want to mark the strings in the ``animals`` list as being " "translatable, but you don't actually want to translate them until they are " "printed." msgstr "" -#: ../../library/gettext.rst:568 +#: ../../library/gettext.rst:565 msgid "Here is one way you can handle this situation::" msgstr "" -#: ../../library/gettext.rst:584 +#: ../../library/gettext.rst:581 msgid "" -"This works because the dummy definition of :func:`_` simply returns the " +"This works because the dummy definition of :func:`!_` simply returns the " "string unchanged. And this dummy definition will temporarily override any " -"definition of :func:`_` in the built-in namespace (until the :keyword:`del` " -"command). Take care, though if you have a previous definition of :func:`_` " +"definition of :func:`!_` in the built-in namespace (until the :keyword:`del` " +"command). Take care, though if you have a previous definition of :func:`!_` " "in the local namespace." msgstr "" -#: ../../library/gettext.rst:590 +#: ../../library/gettext.rst:587 msgid "" -"Note that the second use of :func:`_` will not identify \"a\" as being " +"Note that the second use of :func:`!_` will not identify \"a\" as being " "translatable to the :program:`gettext` program, because the parameter is not " "a string literal." msgstr "" -#: ../../library/gettext.rst:594 +#: ../../library/gettext.rst:591 msgid "Another way to handle this is with the following example::" msgstr "" -#: ../../library/gettext.rst:608 +#: ../../library/gettext.rst:605 msgid "" -"In this case, you are marking translatable strings with the function :func:" -"`N_`, which won't conflict with any definition of :func:`_`. However, you " +"In this case, you are marking translatable strings with the function :func:`!" +"N_`, which won't conflict with any definition of :func:`!_`. However, you " "will need to teach your message extraction program to look for translatable " -"strings marked with :func:`N_`. :program:`xgettext`, :program:`pygettext`, " +"strings marked with :func:`!N_`. :program:`xgettext`, :program:`pygettext`, " "``pybabel extract``, and :program:`xpot` all support this through the use of " -"the :option:`!-k` command-line switch. The choice of :func:`N_` here is " -"totally arbitrary; it could have just as easily been :func:" -"`MarkThisStringForTranslation`." +"the :option:`!-k` command-line switch. The choice of :func:`!N_` here is " +"totally arbitrary; it could have just as easily been :func:`!" +"MarkThisStringForTranslation`." msgstr "" -#: ../../library/gettext.rst:619 +#: ../../library/gettext.rst:616 msgid "Acknowledgements" msgstr "致謝" -#: ../../library/gettext.rst:621 +#: ../../library/gettext.rst:618 msgid "" "The following people contributed code, feedback, design suggestions, " "previous implementations, and valuable experience to the creation of this " "module:" msgstr "" -#: ../../library/gettext.rst:624 +#: ../../library/gettext.rst:621 msgid "Peter Funk" msgstr "Peter Funk" -#: ../../library/gettext.rst:626 +#: ../../library/gettext.rst:623 msgid "James Henstridge" msgstr "James Henstridge" -#: ../../library/gettext.rst:628 +#: ../../library/gettext.rst:625 msgid "Juan David Ibáñez Palomar" msgstr "Juan David Ibáñez Palomar" -#: ../../library/gettext.rst:630 +#: ../../library/gettext.rst:627 msgid "Marc-André Lemburg" msgstr "Marc-André Lemburg" -#: ../../library/gettext.rst:632 +#: ../../library/gettext.rst:629 msgid "Martin von Löwis" msgstr "Martin von Löwis" -#: ../../library/gettext.rst:634 +#: ../../library/gettext.rst:631 msgid "François Pinard" msgstr "François Pinard" -#: ../../library/gettext.rst:636 +#: ../../library/gettext.rst:633 msgid "Barry Warsaw" msgstr "Barry Warsaw" -#: ../../library/gettext.rst:638 +#: ../../library/gettext.rst:635 msgid "Gustavo Niemeyer" msgstr "Gustavo Niemeyer" -#: ../../library/gettext.rst:641 +#: ../../library/gettext.rst:638 msgid "Footnotes" msgstr "註解" -#: ../../library/gettext.rst:642 +#: ../../library/gettext.rst:639 msgid "" "The default locale directory is system dependent; for example, on RedHat " "Linux it is :file:`/usr/share/locale`, but on Solaris it is :file:`/usr/lib/" @@ -758,7 +756,7 @@ msgid "" "your application." msgstr "" -#: ../../library/gettext.rst:650 +#: ../../library/gettext.rst:647 msgid "See the footnote for :func:`bindtextdomain` above." msgstr "請見上方 :func:`bindtextdomain` 之註解。" @@ -770,6 +768,6 @@ msgstr "_ (底線)" msgid "gettext" msgstr "gettext" -#: ../../library/gettext.rst:397 +#: ../../library/gettext.rst:394 msgid "GNOME" msgstr "GNOME" diff --git a/library/gzip.po b/library/gzip.po index 703b7bda25..b0564b3347 100644 --- a/library/gzip.po +++ b/library/gzip.po @@ -1,13 +1,13 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2022, Python Software Foundation +# Copyright (C) 2001-2023, Python Software Foundation # This file is distributed under the same license as the Python package. # # Translators: +# Adrian Liaw , 2018 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-10-12 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-" @@ -20,7 +20,7 @@ msgstr "" #: ../../library/gzip.rst:2 msgid ":mod:`gzip` --- Support for :program:`gzip` files" -msgstr "" +msgstr ":mod:`gzip` --- :program:`gzip` 檔案的支援" #: ../../library/gzip.rst:7 msgid "**Source code:** :source:`Lib/gzip.py`" @@ -54,7 +54,7 @@ msgstr "" #: ../../library/gzip.rst:26 msgid "The module defines the following items:" -msgstr "" +msgstr "此模組定義了以下項目:" #: ../../library/gzip.rst:31 msgid "" @@ -107,7 +107,7 @@ msgstr "新增 ``'x'``、``'xb'`` 和 ``'xt'`` 模式的支援。" #: ../../library/gzip.rst:59 ../../library/gzip.rst:171 msgid "Accepts a :term:`path-like object`." -msgstr "" +msgstr "接受\\ :term:`類路徑物件 `。" #: ../../library/gzip.rst:64 msgid "" @@ -192,7 +192,7 @@ msgstr "" #: ../../library/gzip.rst:118 msgid ":class:`GzipFile` also provides the following method and attribute:" -msgstr "" +msgstr ":class:`GzipFile` 也提供了以下的方法和屬性:" #: ../../library/gzip.rst:122 msgid "" @@ -243,7 +243,7 @@ msgstr "" #: ../../library/gzip.rst:159 msgid "The :meth:`io.BufferedIOBase.read1` method is now implemented." -msgstr "" +msgstr ":meth:`io.BufferedIOBase.read1` 方法現在已有實作。" #: ../../library/gzip.rst:162 msgid "Added support for the ``'x'`` and ``'xb'`` modes." @@ -309,19 +309,19 @@ msgstr "用法範例" #: ../../library/gzip.rst:217 msgid "Example of how to read a compressed file::" -msgstr "" +msgstr "如何讀取壓縮檔案的範例: ::" #: ../../library/gzip.rst:223 msgid "Example of how to create a compressed GZIP file::" -msgstr "" +msgstr "如何建立一個壓縮的 GZIP 檔案的範例: ::" #: ../../library/gzip.rst:230 msgid "Example of how to GZIP compress an existing file::" -msgstr "" +msgstr "如何壓縮一個已存在的檔案的範例: ::" #: ../../library/gzip.rst:238 msgid "Example of how to GZIP compress a binary string::" -msgstr "" +msgstr "如何壓縮一個二進位字串的範例: ::" #: ../../library/gzip.rst:247 msgid "Module :mod:`zlib`" @@ -333,46 +333,46 @@ msgid "" "format." msgstr "" -#: ../../library/gzip.rst:254 +#: ../../library/gzip.rst:256 msgid "Command Line Interface" -msgstr "" +msgstr "命令列介面" -#: ../../library/gzip.rst:256 +#: ../../library/gzip.rst:258 msgid "" "The :mod:`gzip` module provides a simple command line interface to compress " "or decompress files." msgstr "" -#: ../../library/gzip.rst:259 +#: ../../library/gzip.rst:261 msgid "Once executed the :mod:`gzip` module keeps the input file(s)." msgstr "" -#: ../../library/gzip.rst:263 +#: ../../library/gzip.rst:265 msgid "" "Add a new command line interface with a usage. By default, when you will " "execute the CLI, the default compression level is 6." msgstr "" -#: ../../library/gzip.rst:267 +#: ../../library/gzip.rst:269 msgid "Command line options" -msgstr "" +msgstr "命令列選項" -#: ../../library/gzip.rst:271 +#: ../../library/gzip.rst:273 msgid "If *file* is not specified, read from :data:`sys.stdin`." -msgstr "" +msgstr "如果未指定 *file*,則從 :data:`sys.stdin` 讀取。" -#: ../../library/gzip.rst:275 +#: ../../library/gzip.rst:277 msgid "Indicates the fastest compression method (less compression)." msgstr "" -#: ../../library/gzip.rst:279 +#: ../../library/gzip.rst:281 msgid "Indicates the slowest compression method (best compression)." msgstr "" -#: ../../library/gzip.rst:283 +#: ../../library/gzip.rst:285 msgid "Decompress the given file." -msgstr "" +msgstr "解壓縮指定的檔案。" -#: ../../library/gzip.rst:287 +#: ../../library/gzip.rst:289 msgid "Show the help message." -msgstr "" +msgstr "顯示幫助訊息。" diff --git a/library/html.parser.po b/library/html.parser.po index 6b2e17cfe4..3541d18e9f 100644 --- a/library/html.parser.po +++ b/library/html.parser.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-02-18 00:10+0000\n" +"POT-Creation-Date: 2023-10-11 17:13+0000\n" "PO-Revision-Date: 2023-05-04 22:54+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -231,15 +231,15 @@ msgstr "" #: ../../library/html.parser.rst:175 msgid "" "This method is called to process decimal and hexadecimal numeric character " -"references of the form ``&#NNN;`` and ``&#xNNN;``. For example, the decimal " -"equivalent for ``>`` is ``>``, whereas the hexadecimal is ``>``; " -"in this case the method will receive ``'62'`` or ``'x3E'``. This method is " -"never called if *convert_charrefs* is ``True``." +"references of the form :samp:`&#{NNN};` and :samp:`&#x{NNN};`. For example, " +"the decimal equivalent for ``>`` is ``>``, whereas the hexadecimal is " +"``>``; in this case the method will receive ``'62'`` or ``'x3E'``. " +"This method is never called if *convert_charrefs* is ``True``." msgstr "" -"呼叫此方法來處理 ``#NNN;`` 和 ``&#xNNN;`` 形式的十進位和十六進位數字字元參" -"照。例如,``>`` 的十進位等效為 ``>``,而十六進位為 ``>``;在這種" -"情況下,該方法將收到 ``'62'`` 或 ``'x3E'``。如果 *convert_charrefs* 為 " -"``True``,則永遠不會呼叫此方法。" +"呼叫此方法來處理 :samp:`&#{NNN};` 和 :samp:`&#x{NNN};` 形式的十進位和十六進位" +"數字字元參照。例如,``>`` 的十進位等效為 ``>``,而十六進位為 ``>" +"``;在這種情況下,該方法將收到 ``'62'`` 或 ``'x3E'``。如果 " +"*convert_charrefs* 為 ``True``,則永遠不會呼叫此方法。" #: ../../library/html.parser.rst:184 msgid "" diff --git a/library/http.cookiejar.po b/library/http.cookiejar.po index 022fe9d2ee..ff0abea3da 100644 --- a/library/http.cookiejar.po +++ b/library/http.cookiejar.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-15 20:43+0000\n" +"POT-Creation-Date: 2023-10-11 17:13+0000\n" "PO-Revision-Date: 2016-11-19 00:31+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -69,7 +69,8 @@ msgstr "" #: ../../library/http.cookiejar.rst:46 msgid "" -"LoadError was made a subclass of :exc:`OSError` instead of :exc:`IOError`." +":exc:`LoadError` used to be a subtype of :exc:`IOError`, which is now an " +"alias of :exc:`OSError`." msgstr "" #: ../../library/http.cookiejar.rst:51 @@ -630,10 +631,10 @@ msgid "" "cookie domain to be matched. For example, ``\"example.com\"`` matches a " "blocklist entry of ``\"example.com\"``, but ``\"www.example.com\"`` does " "not. Domains that do start with a dot are matched by more specific domains " -"too. For example, both ``\"www.example.com\"`` and ``\"www.coyote.example.com" -"\"`` match ``\".example.com\"`` (but ``\"example.com\"`` itself does not). " -"IP addresses are an exception, and must match exactly. For example, if " -"blocked_domains contains ``\"192.168.1.2\"`` and ``\".168.1.2\"``, " +"too. For example, both ``\"www.example.com\"`` and ``\"www.coyote.example." +"com\"`` match ``\".example.com\"`` (but ``\"example.com\"`` itself does " +"not). IP addresses are an exception, and must match exactly. For example, " +"if blocked_domains contains ``\"192.168.1.2\"`` and ``\".168.1.2\"``, " "192.168.1.2 is blocked, but 193.168.1.2 is not." msgstr "" diff --git a/library/http.server.po b/library/http.server.po index 1a5ec94aa5..c48bf130f8 100644 --- a/library/http.server.po +++ b/library/http.server.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-10-11 17:13+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-" @@ -265,8 +265,8 @@ msgid "" "attribute holds the default values for *message* and *explain* that will be " "used if no value is provided; for unknown codes the default value for both " "is the string ``???``. The body will be empty if the method is HEAD or the " -"response code is one of the following: ``1xx``, ``204 No Content``, ``205 " -"Reset Content``, ``304 Not Modified``." +"response code is one of the following: :samp:`1{xx}`, ``204 No Content``, " +"``205 Reset Content``, ``304 Not Modified``." msgstr "" #: ../../library/http.server.rst:223 diff --git a/library/idle.po b/library/idle.po index 521bc73b78..0046d297a0 100644 --- a/library/idle.po +++ b/library/idle.po @@ -1199,7 +1199,7 @@ msgstr "" #: ../../library/idle.rst:672 msgid "Command line usage" -msgstr "" +msgstr "命令列用法" #: ../../library/idle.rst:688 msgid "If there are arguments:" diff --git a/library/inspect.po b/library/inspect.po index 65cac3464a..8f55ff930d 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-09-06 16:53+0000\n" +"POT-Creation-Date: 2023-10-12 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-" @@ -1785,28 +1785,28 @@ msgstr "" msgid "Get current state of a generator-iterator." msgstr "" -#: ../../library/inspect.rst:1464 ../../library/inspect.rst:1479 -#: ../../library/inspect.rst:1495 +#: ../../library/inspect.rst:1460 ../../library/inspect.rst:1476 +#: ../../library/inspect.rst:1493 msgid "Possible states are:" msgstr "" -#: ../../library/inspect.rst:1461 +#: ../../library/inspect.rst:1462 msgid "GEN_CREATED: Waiting to start execution." msgstr "" -#: ../../library/inspect.rst:1462 +#: ../../library/inspect.rst:1463 msgid "GEN_RUNNING: Currently being executed by the interpreter." msgstr "" -#: ../../library/inspect.rst:1463 +#: ../../library/inspect.rst:1464 msgid "GEN_SUSPENDED: Currently suspended at a yield expression." msgstr "" -#: ../../library/inspect.rst:1464 +#: ../../library/inspect.rst:1465 msgid "GEN_CLOSED: Execution has completed." msgstr "" -#: ../../library/inspect.rst:1470 +#: ../../library/inspect.rst:1471 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 " @@ -1814,23 +1814,23 @@ msgid "" "``cr_frame`` attributes." msgstr "" -#: ../../library/inspect.rst:1476 +#: ../../library/inspect.rst:1478 msgid "CORO_CREATED: Waiting to start execution." msgstr "" -#: ../../library/inspect.rst:1477 +#: ../../library/inspect.rst:1479 msgid "CORO_RUNNING: Currently being executed by the interpreter." msgstr "" -#: ../../library/inspect.rst:1478 +#: ../../library/inspect.rst:1480 msgid "CORO_SUSPENDED: Currently suspended at an await expression." msgstr "" -#: ../../library/inspect.rst:1479 +#: ../../library/inspect.rst:1481 msgid "CORO_CLOSED: Execution has completed." msgstr "" -#: ../../library/inspect.rst:1485 +#: ../../library/inspect.rst:1487 msgid "" "Get current state of an asynchronous generator object. The function is " "intended to be used with asynchronous iterator objects created by :keyword:" @@ -1839,30 +1839,30 @@ msgid "" "``ag_frame`` attributes." msgstr "" -#: ../../library/inspect.rst:1492 +#: ../../library/inspect.rst:1495 msgid "AGEN_CREATED: Waiting to start execution." msgstr "" -#: ../../library/inspect.rst:1493 +#: ../../library/inspect.rst:1496 msgid "AGEN_RUNNING: Currently being executed by the interpreter." msgstr "" -#: ../../library/inspect.rst:1494 +#: ../../library/inspect.rst:1497 msgid "AGEN_SUSPENDED: Currently suspended at a yield expression." msgstr "" -#: ../../library/inspect.rst:1495 +#: ../../library/inspect.rst:1498 msgid "AGEN_CLOSED: Execution has completed." msgstr "" -#: ../../library/inspect.rst:1499 +#: ../../library/inspect.rst:1502 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:1505 +#: ../../library/inspect.rst:1508 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. " @@ -1870,14 +1870,14 @@ msgid "" "generator, and all the same caveats apply." msgstr "" -#: ../../library/inspect.rst:1510 +#: ../../library/inspect.rst:1513 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:1516 +#: ../../library/inspect.rst:1519 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 " @@ -1885,79 +1885,79 @@ msgid "" "dictionary." msgstr "" -#: ../../library/inspect.rst:1525 +#: ../../library/inspect.rst:1528 msgid "" "This function is analogous to :func:`~inspect.getgeneratorlocals`, but works " "for coroutine objects created by :keyword:`async def` functions." msgstr "" -#: ../../library/inspect.rst:1532 +#: ../../library/inspect.rst:1535 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:1542 +#: ../../library/inspect.rst:1545 msgid "Code Objects Bit Flags" msgstr "" -#: ../../library/inspect.rst:1544 +#: ../../library/inspect.rst:1547 msgid "" "Python code objects have a ``co_flags`` attribute, which is a bitmap of the " "following flags:" msgstr "" -#: ../../library/inspect.rst:1549 +#: ../../library/inspect.rst:1552 msgid "The code object is optimized, using fast locals." msgstr "" -#: ../../library/inspect.rst:1553 +#: ../../library/inspect.rst:1556 msgid "" "If set, a new dict will be created for the frame's ``f_locals`` when the " "code object is executed." msgstr "" -#: ../../library/inspect.rst:1558 +#: ../../library/inspect.rst:1561 msgid "The code object has a variable positional parameter (``*args``-like)." msgstr "" -#: ../../library/inspect.rst:1562 +#: ../../library/inspect.rst:1565 msgid "The code object has a variable keyword parameter (``**kwargs``-like)." msgstr "" -#: ../../library/inspect.rst:1566 +#: ../../library/inspect.rst:1569 msgid "The flag is set when the code object is a nested function." msgstr "" -#: ../../library/inspect.rst:1570 +#: ../../library/inspect.rst:1573 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:1575 +#: ../../library/inspect.rst:1578 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:1583 +#: ../../library/inspect.rst:1586 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:1592 +#: ../../library/inspect.rst:1595 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:1599 +#: ../../library/inspect.rst:1602 msgid "" "The flags are specific to CPython, and may not be defined in other Python " "implementations. Furthermore, the flags are an implementation detail, and " @@ -1965,39 +1965,39 @@ msgid "" "use public APIs from the :mod:`inspect` module for any introspection needs." msgstr "" -#: ../../library/inspect.rst:1607 +#: ../../library/inspect.rst:1610 msgid "Buffer flags" msgstr "" -#: ../../library/inspect.rst:1611 +#: ../../library/inspect.rst:1614 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:1615 +#: ../../library/inspect.rst:1618 msgid "The meaning of the flags is explained at :ref:`buffer-request-types`." msgstr "" -#: ../../library/inspect.rst:1642 +#: ../../library/inspect.rst:1645 msgid "Command Line Interface" -msgstr "" +msgstr "命令列介面" -#: ../../library/inspect.rst:1644 +#: ../../library/inspect.rst:1647 msgid "" "The :mod:`inspect` module also provides a basic introspection capability " "from the command line." msgstr "" -#: ../../library/inspect.rst:1649 +#: ../../library/inspect.rst:1652 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:1655 +#: ../../library/inspect.rst:1658 msgid "" "Print information about the specified object rather than the source code" msgstr "" diff --git a/library/json.po b/library/json.po index 34790dc35c..f7702f267a 100644 --- a/library/json.po +++ b/library/json.po @@ -50,8 +50,8 @@ msgid "" "string may cause the decoder to consume considerable CPU and memory " "resources. Limiting the size of data to be parsed is recommended." msgstr "" -"當剖析無法信任來源的 JSON 資料時要小心。一段惡意的 JSON 字串可能會導致" -"解碼器耗費大量 CPU 與記憶體資源。建議限制剖析資料的大小。" +"當剖析無法信任來源的 JSON 資料時要小心。一段惡意的 JSON 字串可能會導致解碼器" +"耗費大量 CPU 與記憶體資源。建議限制剖析資料的大小。" #: ../../library/json.rst:26 msgid "" @@ -778,7 +778,7 @@ msgstr "" #: ../../library/json.rst:673 msgid "Command Line Interface" -msgstr "" +msgstr "命令列介面" #: ../../library/json.rst:678 msgid "**Source code:** :source:`Lib/json/tool.py`" @@ -804,7 +804,7 @@ msgstr "" #: ../../library/json.rst:704 msgid "Command line options" -msgstr "" +msgstr "命令列選項" #: ../../library/json.rst:708 msgid "The JSON file to be validated or pretty-printed:" diff --git a/library/logging.po b/library/logging.po index a01a4bd182..b3823e886e 100644 --- a/library/logging.po +++ b/library/logging.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-29 10:36+0000\n" +"POT-Creation-Date: 2023-10-11 17:13+0000\n" "PO-Revision-Date: 2023-08-20 16:49+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -51,8 +51,7 @@ msgid "" "This module defines functions and classes which implement a flexible event " "logging system for applications and libraries." msgstr "" -"這個模組定義了函式與類別 (class),為應用程式和函式庫實作彈性的日誌管理系" -"統。" +"這個模組定義了函式與類別 (class),為應用程式和函式庫實作彈性的日誌管理系統。" #: ../../library/logging.rst:28 msgid "" @@ -61,10 +60,9 @@ msgid "" "application log can include your own messages integrated with messages from " "third-party modules." msgstr "" -"由標準函式庫模組提供的日誌記錄 API 的主要好處是," -"所有的 Python 模組都能參與日誌記錄," -"因此您的應用程式日誌可以包含您自己的訊息," -"並與來自第三方模組的訊息整合在一起。" +"由標準函式庫模組提供的日誌記錄 API 的主要好處是,所有的 Python 模組都能參與日" +"誌記錄,因此您的應用程式日誌可以包含您自己的訊息,並與來自第三方模組的訊息整" +"合在一起。" #: ../../library/logging.rst:33 msgid "The simplest example:" @@ -1117,7 +1115,7 @@ msgstr "" msgid "" "In the case of {}-formatting, you can specify formatting flags by placing " "them after the attribute name, separated from it with a colon. For example: " -"a placeholder of ``{msecs:03d}`` would format a millisecond value of ``4`` " +"a placeholder of ``{msecs:03.0f}`` would format a millisecond value of ``4`` " "as ``004``. Refer to the :meth:`str.format` documentation for full details " "on the options available to you." msgstr "" diff --git a/library/lzma.po b/library/lzma.po index 9ccd407592..245b87f7f2 100644 --- a/library/lzma.po +++ b/library/lzma.po @@ -1,5 +1,4 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2022, Python Software Foundation +# Copyright (C) 2001-2023, Python Software Foundation # This file is distributed under the same license as the Python package. # # Translators: @@ -7,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-29 10:36+0000\n" +"POT-Creation-Date: 2023-10-12 00:03+0000\n" "PO-Revision-Date: 2018-05-23 16:05+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -475,15 +474,15 @@ msgid "" "filter-dependent options. Valid filter IDs are as follows:" msgstr "" -#: ../../library/lzma.rst:337 +#: ../../library/lzma.rst:335 msgid "Compression filters:" msgstr "" -#: ../../library/lzma.rst:336 +#: ../../library/lzma.rst:337 msgid ":const:`FILTER_LZMA1` (for use with :const:`FORMAT_ALONE`)" msgstr "" -#: ../../library/lzma.rst:337 +#: ../../library/lzma.rst:338 msgid "" ":const:`FILTER_LZMA2` (for use with :const:`FORMAT_XZ` and :const:" "`FORMAT_RAW`)" @@ -493,100 +492,100 @@ msgstr "" msgid "Delta filter:" msgstr "" -#: ../../library/lzma.rst:340 +#: ../../library/lzma.rst:342 msgid ":const:`FILTER_DELTA`" msgstr ":const:`FILTER_DELTA`" -#: ../../library/lzma.rst:348 +#: ../../library/lzma.rst:344 msgid "Branch-Call-Jump (BCJ) filters:" msgstr "" -#: ../../library/lzma.rst:343 +#: ../../library/lzma.rst:346 msgid ":const:`FILTER_X86`" msgstr ":const:`FILTER_X86`" -#: ../../library/lzma.rst:344 +#: ../../library/lzma.rst:347 msgid ":const:`FILTER_IA64`" msgstr ":const:`FILTER_IA64`" -#: ../../library/lzma.rst:345 +#: ../../library/lzma.rst:348 msgid ":const:`FILTER_ARM`" msgstr ":const:`FILTER_ARM`" -#: ../../library/lzma.rst:346 +#: ../../library/lzma.rst:349 msgid ":const:`FILTER_ARMTHUMB`" msgstr ":const:`FILTER_ARMTHUMB`" -#: ../../library/lzma.rst:347 +#: ../../library/lzma.rst:350 msgid ":const:`FILTER_POWERPC`" msgstr ":const:`FILTER_POWERPC`" -#: ../../library/lzma.rst:348 +#: ../../library/lzma.rst:351 msgid ":const:`FILTER_SPARC`" msgstr ":const:`FILTER_SPARC`" -#: ../../library/lzma.rst:350 +#: ../../library/lzma.rst:353 msgid "" "A filter chain can consist of up to 4 filters, and cannot be empty. The last " "filter in the chain must be a compression filter, and any other filters must " "be delta or BCJ filters." msgstr "" -#: ../../library/lzma.rst:354 +#: ../../library/lzma.rst:357 msgid "" "Compression filters support the following options (specified as additional " "entries in the dictionary representing the filter):" msgstr "" -#: ../../library/lzma.rst:357 +#: ../../library/lzma.rst:360 msgid "" "``preset``: A compression preset to use as a source of default values for " "options that are not specified explicitly." msgstr "" -#: ../../library/lzma.rst:359 +#: ../../library/lzma.rst:362 msgid "" "``dict_size``: Dictionary size in bytes. This should be between 4 KiB and " "1.5 GiB (inclusive)." msgstr "" -#: ../../library/lzma.rst:361 +#: ../../library/lzma.rst:364 msgid "``lc``: Number of literal context bits." msgstr "" -#: ../../library/lzma.rst:362 +#: ../../library/lzma.rst:365 msgid "" "``lp``: Number of literal position bits. The sum ``lc + lp`` must be at most " "4." msgstr "" -#: ../../library/lzma.rst:364 +#: ../../library/lzma.rst:367 msgid "``pb``: Number of position bits; must be at most 4." msgstr "" -#: ../../library/lzma.rst:365 +#: ../../library/lzma.rst:368 msgid "``mode``: :const:`MODE_FAST` or :const:`MODE_NORMAL`." msgstr "" -#: ../../library/lzma.rst:366 +#: ../../library/lzma.rst:369 msgid "" "``nice_len``: What should be considered a \"nice length\" for a match. This " "should be 273 or less." msgstr "" -#: ../../library/lzma.rst:368 +#: ../../library/lzma.rst:371 msgid "" "``mf``: What match finder to use -- :const:`MF_HC3`, :const:`MF_HC4`, :const:" "`MF_BT2`, :const:`MF_BT3`, or :const:`MF_BT4`." msgstr "" -#: ../../library/lzma.rst:370 +#: ../../library/lzma.rst:373 msgid "" "``depth``: Maximum search depth used by match finder. 0 (default) means to " "select automatically based on other filter options." msgstr "" -#: ../../library/lzma.rst:373 +#: ../../library/lzma.rst:376 msgid "" "The delta filter stores the differences between bytes, producing more " "repetitive input for the compressor in certain circumstances. It supports " @@ -595,7 +594,7 @@ msgid "" "bytes." msgstr "" -#: ../../library/lzma.rst:378 +#: ../../library/lzma.rst:381 msgid "" "The BCJ filters are intended to be applied to machine code. They convert " "relative branches, calls and jumps in the code to use absolute addressing, " @@ -605,30 +604,30 @@ msgid "" "data. The default is 0." msgstr "" -#: ../../library/lzma.rst:386 +#: ../../library/lzma.rst:389 msgid "Examples" msgstr "範例" -#: ../../library/lzma.rst:388 +#: ../../library/lzma.rst:391 msgid "Reading in a compressed file::" msgstr "" -#: ../../library/lzma.rst:394 +#: ../../library/lzma.rst:397 msgid "Creating a compressed file::" msgstr "" -#: ../../library/lzma.rst:401 +#: ../../library/lzma.rst:404 msgid "Compressing data in memory::" msgstr "" -#: ../../library/lzma.rst:407 +#: ../../library/lzma.rst:410 msgid "Incremental compression::" msgstr "" -#: ../../library/lzma.rst:418 +#: ../../library/lzma.rst:421 msgid "Writing compressed data to an already-open file::" msgstr "" -#: ../../library/lzma.rst:427 +#: ../../library/lzma.rst:430 msgid "Creating a compressed file using a custom filter chain::" msgstr "" diff --git a/library/multiprocessing.po b/library/multiprocessing.po index 2d6e9bd948..38134ab93d 100644 --- a/library/multiprocessing.po +++ b/library/multiprocessing.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-31 00:03+0000\n" +"POT-Creation-Date: 2023-10-11 17:13+0000\n" "PO-Revision-Date: 2018-05-23 16:06+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -133,7 +133,7 @@ msgid "" "Available on POSIX and Windows platforms. The default on Windows and macOS." msgstr "" -#: ../../library/multiprocessing.rst:132 +#: ../../library/multiprocessing.rst:138 msgid "*fork*" msgstr "" @@ -157,11 +157,19 @@ msgid "" "or :func:`set_start_method`." msgstr "" -#: ../../library/multiprocessing.rst:145 +#: ../../library/multiprocessing.rst:134 +msgid "" +"If Python is able to detect that your process has multiple threads, the :" +"func:`os.fork` function that this start method calls internally will raise " +"a :exc:`DeprecationWarning`. Use a different start method. See the :func:`os." +"fork` documentation for further explanation." +msgstr "" + +#: ../../library/multiprocessing.rst:151 msgid "*forkserver*" msgstr "" -#: ../../library/multiprocessing.rst:135 +#: ../../library/multiprocessing.rst:141 msgid "" "When the program starts and selects the *forkserver* start method, a server " "process is spawned. From then on, whenever a new process is needed, the " @@ -171,27 +179,27 @@ msgid "" "for it to use :func:`os.fork`. No unnecessary resources are inherited." msgstr "" -#: ../../library/multiprocessing.rst:143 +#: ../../library/multiprocessing.rst:149 msgid "" "Available on POSIX platforms which support passing file descriptors over " "Unix pipes such as Linux." msgstr "" -#: ../../library/multiprocessing.rst:149 +#: ../../library/multiprocessing.rst:155 msgid "" "On macOS, the *spawn* start method is now the default. The *fork* start " "method should be considered unsafe as it can lead to crashes of the " "subprocess as macOS system libraries may start threads. See :issue:`33725`." msgstr "" -#: ../../library/multiprocessing.rst:153 +#: ../../library/multiprocessing.rst:159 msgid "" "*spawn* added on all POSIX platforms, and *forkserver* added for some POSIX " "platforms. Child processes no longer inherit all of the parents inheritable " "handles on Windows." msgstr "" -#: ../../library/multiprocessing.rst:159 +#: ../../library/multiprocessing.rst:165 msgid "" "On POSIX using the *spawn* or *forkserver* start methods will also start a " "*resource tracker* process which tracks the unlinked named system resources " @@ -206,25 +214,25 @@ msgid "" "space in the main memory.)" msgstr "" -#: ../../library/multiprocessing.rst:172 +#: ../../library/multiprocessing.rst:178 msgid "" "To select a start method you use the :func:`set_start_method` in the ``if " "__name__ == '__main__'`` clause of the main module. For example::" msgstr "" -#: ../../library/multiprocessing.rst:189 +#: ../../library/multiprocessing.rst:195 msgid "" ":func:`set_start_method` should not be used more than once in the program." msgstr "" -#: ../../library/multiprocessing.rst:192 +#: ../../library/multiprocessing.rst:198 msgid "" "Alternatively, you can use :func:`get_context` to obtain a context object. " "Context objects have the same API as the multiprocessing module, and allow " "one to use multiple start methods in the same program. ::" msgstr "" -#: ../../library/multiprocessing.rst:210 +#: ../../library/multiprocessing.rst:216 msgid "" "Note that objects related to one context may not be compatible with " "processes for a different context. In particular, locks created using the " @@ -232,13 +240,13 @@ msgid "" "*forkserver* start methods." msgstr "" -#: ../../library/multiprocessing.rst:215 +#: ../../library/multiprocessing.rst:221 msgid "" "A library which wants to use a particular start method should probably use :" "func:`get_context` to avoid interfering with the choice of the library user." msgstr "" -#: ../../library/multiprocessing.rst:221 +#: ../../library/multiprocessing.rst:227 msgid "" "The ``'spawn'`` and ``'forkserver'`` start methods generally cannot be used " "with \"frozen\" executables (i.e., binaries produced by packages like " @@ -246,41 +254,41 @@ msgid "" "method may work if code does not use threads." msgstr "" -#: ../../library/multiprocessing.rst:228 +#: ../../library/multiprocessing.rst:234 msgid "Exchanging objects between processes" msgstr "" -#: ../../library/multiprocessing.rst:230 +#: ../../library/multiprocessing.rst:236 msgid "" ":mod:`multiprocessing` supports two types of communication channel between " "processes:" msgstr "" -#: ../../library/multiprocessing.rst:233 +#: ../../library/multiprocessing.rst:239 msgid "**Queues**" msgstr "" -#: ../../library/multiprocessing.rst:235 +#: ../../library/multiprocessing.rst:241 msgid "" "The :class:`Queue` class is a near clone of :class:`queue.Queue`. For " "example::" msgstr "" -#: ../../library/multiprocessing.rst:250 +#: ../../library/multiprocessing.rst:256 msgid "Queues are thread and process safe." msgstr "" -#: ../../library/multiprocessing.rst:252 +#: ../../library/multiprocessing.rst:258 msgid "**Pipes**" msgstr "" -#: ../../library/multiprocessing.rst:254 +#: ../../library/multiprocessing.rst:260 msgid "" "The :func:`Pipe` function returns a pair of connection objects connected by " "a pipe which by default is duplex (two-way). For example::" msgstr "" -#: ../../library/multiprocessing.rst:270 +#: ../../library/multiprocessing.rst:276 msgid "" "The two connection objects returned by :func:`Pipe` represent the two ends " "of the pipe. Each connection object has :meth:`~Connection.send` and :meth:" @@ -290,55 +298,55 @@ msgid "" "corruption from processes using different ends of the pipe at the same time." msgstr "" -#: ../../library/multiprocessing.rst:280 +#: ../../library/multiprocessing.rst:286 msgid "Synchronization between processes" msgstr "" -#: ../../library/multiprocessing.rst:282 +#: ../../library/multiprocessing.rst:288 msgid "" ":mod:`multiprocessing` contains equivalents of all the synchronization " "primitives from :mod:`threading`. For instance one can use a lock to ensure " "that only one process prints to standard output at a time::" msgstr "" -#: ../../library/multiprocessing.rst:301 +#: ../../library/multiprocessing.rst:307 msgid "" "Without using the lock output from the different processes is liable to get " "all mixed up." msgstr "" -#: ../../library/multiprocessing.rst:306 +#: ../../library/multiprocessing.rst:312 msgid "Sharing state between processes" msgstr "" -#: ../../library/multiprocessing.rst:308 +#: ../../library/multiprocessing.rst:314 msgid "" "As mentioned above, when doing concurrent programming it is usually best to " "avoid using shared state as far as possible. This is particularly true when " "using multiple processes." msgstr "" -#: ../../library/multiprocessing.rst:312 +#: ../../library/multiprocessing.rst:318 msgid "" "However, if you really do need to use some shared data then :mod:" "`multiprocessing` provides a couple of ways of doing so." msgstr "" -#: ../../library/multiprocessing.rst:315 +#: ../../library/multiprocessing.rst:321 msgid "**Shared memory**" msgstr "" -#: ../../library/multiprocessing.rst:317 +#: ../../library/multiprocessing.rst:323 msgid "" "Data can be stored in a shared memory map using :class:`Value` or :class:" "`Array`. For example, the following code ::" msgstr "" -#: ../../library/multiprocessing.rst:338 ../../library/multiprocessing.rst:384 +#: ../../library/multiprocessing.rst:344 ../../library/multiprocessing.rst:390 msgid "will print ::" msgstr "" -#: ../../library/multiprocessing.rst:343 +#: ../../library/multiprocessing.rst:349 msgid "" "The ``'d'`` and ``'i'`` arguments used when creating ``num`` and ``arr`` are " "typecodes of the kind used by the :mod:`array` module: ``'d'`` indicates a " @@ -346,25 +354,25 @@ msgid "" "objects will be process and thread-safe." msgstr "" -#: ../../library/multiprocessing.rst:348 +#: ../../library/multiprocessing.rst:354 msgid "" "For more flexibility in using shared memory one can use the :mod:" "`multiprocessing.sharedctypes` module which supports the creation of " "arbitrary ctypes objects allocated from shared memory." msgstr "" -#: ../../library/multiprocessing.rst:352 +#: ../../library/multiprocessing.rst:358 msgid "**Server process**" msgstr "" -#: ../../library/multiprocessing.rst:354 +#: ../../library/multiprocessing.rst:360 msgid "" "A manager object returned by :func:`Manager` controls a server process which " "holds Python objects and allows other processes to manipulate them using " "proxies." msgstr "" -#: ../../library/multiprocessing.rst:358 +#: ../../library/multiprocessing.rst:364 msgid "" "A manager returned by :func:`Manager` will support types :class:`list`, :" "class:`dict`, :class:`~managers.Namespace`, :class:`Lock`, :class:`RLock`, :" @@ -373,7 +381,7 @@ msgid "" "`Array`. For example, ::" msgstr "" -#: ../../library/multiprocessing.rst:389 +#: ../../library/multiprocessing.rst:395 msgid "" "Server process managers are more flexible than using shared memory objects " "because they can be made to support arbitrary object types. Also, a single " @@ -381,31 +389,31 @@ msgid "" "They are, however, slower than using shared memory." msgstr "" -#: ../../library/multiprocessing.rst:396 +#: ../../library/multiprocessing.rst:402 msgid "Using a pool of workers" msgstr "" -#: ../../library/multiprocessing.rst:398 +#: ../../library/multiprocessing.rst:404 msgid "" "The :class:`~multiprocessing.pool.Pool` class represents a pool of worker " "processes. It has methods which allows tasks to be offloaded to the worker " "processes in a few different ways." msgstr "" -#: ../../library/multiprocessing.rst:402 +#: ../../library/multiprocessing.rst:408 msgid "For example::" msgstr "" "舉例來說:\n" "\n" "::" -#: ../../library/multiprocessing.rst:446 +#: ../../library/multiprocessing.rst:452 msgid "" "Note that the methods of a pool should only ever be used by the process " "which created it." msgstr "" -#: ../../library/multiprocessing.rst:451 +#: ../../library/multiprocessing.rst:457 msgid "" "Functionality within this package requires that the ``__main__`` module be " "importable by the children. This is covered in :ref:`multiprocessing-" @@ -414,35 +422,35 @@ msgid "" "work in the interactive interpreter. For example::" msgstr "" -#: ../../library/multiprocessing.rst:474 +#: ../../library/multiprocessing.rst:480 msgid "" "(If you try this it will actually output three full tracebacks interleaved " "in a semi-random fashion, and then you may have to stop the parent process " "somehow.)" msgstr "" -#: ../../library/multiprocessing.rst:480 +#: ../../library/multiprocessing.rst:486 msgid "Reference" msgstr "" -#: ../../library/multiprocessing.rst:482 +#: ../../library/multiprocessing.rst:488 msgid "" "The :mod:`multiprocessing` package mostly replicates the API of the :mod:" "`threading` module." msgstr "" -#: ../../library/multiprocessing.rst:487 +#: ../../library/multiprocessing.rst:493 msgid ":class:`Process` and exceptions" msgstr ":class:`Process` 與例外" -#: ../../library/multiprocessing.rst:492 +#: ../../library/multiprocessing.rst:498 msgid "" "Process objects represent activity that is run in a separate process. The :" "class:`Process` class has equivalents of all the methods of :class:" "`threading.Thread`." msgstr "" -#: ../../library/multiprocessing.rst:496 +#: ../../library/multiprocessing.rst:502 msgid "" "The constructor should always be called with keyword arguments. *group* " "should always be ``None``; it exists solely for compatibility with :class:" @@ -456,29 +464,29 @@ msgid "" "creating process." msgstr "" -#: ../../library/multiprocessing.rst:507 +#: ../../library/multiprocessing.rst:513 msgid "" "By default, no arguments are passed to *target*. The *args* argument, which " "defaults to ``()``, can be used to specify a list or tuple of the arguments " "to pass to *target*." msgstr "" -#: ../../library/multiprocessing.rst:511 +#: ../../library/multiprocessing.rst:517 msgid "" "If a subclass overrides the constructor, it must make sure it invokes the " "base class constructor (:meth:`Process.__init__`) before doing anything else " "to the process." msgstr "" -#: ../../library/multiprocessing.rst:515 +#: ../../library/multiprocessing.rst:521 msgid "Added the *daemon* argument." msgstr "新增 *daemon* 引數。" -#: ../../library/multiprocessing.rst:520 +#: ../../library/multiprocessing.rst:526 msgid "Method representing the process's activity." msgstr "" -#: ../../library/multiprocessing.rst:522 +#: ../../library/multiprocessing.rst:528 msgid "" "You may override this method in a subclass. The standard :meth:`run` method " "invokes the callable object passed to the object's constructor as the target " @@ -486,30 +494,30 @@ msgid "" "*args* and *kwargs* arguments, respectively." msgstr "" -#: ../../library/multiprocessing.rst:527 +#: ../../library/multiprocessing.rst:533 msgid "" "Using a list or tuple as the *args* argument passed to :class:`Process` " "achieves the same effect." msgstr "" -#: ../../library/multiprocessing.rst:530 +#: ../../library/multiprocessing.rst:536 msgid "Example::" msgstr "" "範例:\n" "\n" "::" -#: ../../library/multiprocessing.rst:542 +#: ../../library/multiprocessing.rst:548 msgid "Start the process's activity." msgstr "" -#: ../../library/multiprocessing.rst:544 +#: ../../library/multiprocessing.rst:550 msgid "" "This must be called at most once per process object. It arranges for the " "object's :meth:`run` method to be invoked in a separate process." msgstr "" -#: ../../library/multiprocessing.rst:549 +#: ../../library/multiprocessing.rst:555 msgid "" "If the optional argument *timeout* is ``None`` (the default), the method " "blocks until the process whose :meth:`join` method is called terminates. If " @@ -519,23 +527,23 @@ msgid "" "terminated." msgstr "" -#: ../../library/multiprocessing.rst:556 +#: ../../library/multiprocessing.rst:562 msgid "A process can be joined many times." msgstr "" -#: ../../library/multiprocessing.rst:558 +#: ../../library/multiprocessing.rst:564 msgid "" "A process cannot join itself because this would cause a deadlock. It is an " "error to attempt to join a process before it has been started." msgstr "" -#: ../../library/multiprocessing.rst:563 +#: ../../library/multiprocessing.rst:569 msgid "" "The process's name. The name is a string used for identification purposes " "only. It has no semantics. Multiple processes may be given the same name." msgstr "" -#: ../../library/multiprocessing.rst:567 +#: ../../library/multiprocessing.rst:573 msgid "" "The initial name is set by the constructor. If no explicit name is provided " "to the constructor, a name of the form 'Process-N\\ :sub:`1`:N\\ :sub:" @@ -543,33 +551,33 @@ msgid "" "child of its parent." msgstr "" -#: ../../library/multiprocessing.rst:574 +#: ../../library/multiprocessing.rst:580 msgid "Return whether the process is alive." msgstr "" -#: ../../library/multiprocessing.rst:576 +#: ../../library/multiprocessing.rst:582 msgid "" "Roughly, a process object is alive from the moment the :meth:`start` method " "returns until the child process terminates." msgstr "" -#: ../../library/multiprocessing.rst:581 +#: ../../library/multiprocessing.rst:587 msgid "" "The process's daemon flag, a Boolean value. This must be set before :meth:" "`start` is called." msgstr "" -#: ../../library/multiprocessing.rst:584 +#: ../../library/multiprocessing.rst:590 msgid "The initial value is inherited from the creating process." msgstr "" -#: ../../library/multiprocessing.rst:586 +#: ../../library/multiprocessing.rst:592 msgid "" "When a process exits, it attempts to terminate all of its daemonic child " "processes." msgstr "" -#: ../../library/multiprocessing.rst:589 +#: ../../library/multiprocessing.rst:595 msgid "" "Note that a daemonic process is not allowed to create child processes. " "Otherwise a daemonic process would leave its children orphaned if it gets " @@ -578,92 +586,92 @@ msgid "" "(and not joined) if non-daemonic processes have exited." msgstr "" -#: ../../library/multiprocessing.rst:595 +#: ../../library/multiprocessing.rst:601 msgid "" "In addition to the :class:`threading.Thread` API, :class:`Process` objects " "also support the following attributes and methods:" msgstr "" -#: ../../library/multiprocessing.rst:600 +#: ../../library/multiprocessing.rst:606 msgid "" "Return the process ID. Before the process is spawned, this will be ``None``." msgstr "" -#: ../../library/multiprocessing.rst:605 +#: ../../library/multiprocessing.rst:611 msgid "" "The child's exit code. This will be ``None`` if the process has not yet " "terminated." msgstr "" -#: ../../library/multiprocessing.rst:608 +#: ../../library/multiprocessing.rst:614 msgid "" "If the child's :meth:`run` method returned normally, the exit code will be " "0. If it terminated via :func:`sys.exit` with an integer argument *N*, the " "exit code will be *N*." msgstr "" -#: ../../library/multiprocessing.rst:612 +#: ../../library/multiprocessing.rst:618 msgid "" "If the child terminated due to an exception not caught within :meth:`run`, " "the exit code will be 1. If it was terminated by signal *N*, the exit code " "will be the negative value *-N*." msgstr "" -#: ../../library/multiprocessing.rst:618 +#: ../../library/multiprocessing.rst:624 msgid "The process's authentication key (a byte string)." msgstr "" -#: ../../library/multiprocessing.rst:620 +#: ../../library/multiprocessing.rst:626 msgid "" "When :mod:`multiprocessing` is initialized the main process is assigned a " "random string using :func:`os.urandom`." msgstr "" -#: ../../library/multiprocessing.rst:623 +#: ../../library/multiprocessing.rst:629 msgid "" "When a :class:`Process` object is created, it will inherit the " "authentication key of its parent process, although this may be changed by " "setting :attr:`authkey` to another byte string." msgstr "" -#: ../../library/multiprocessing.rst:627 +#: ../../library/multiprocessing.rst:633 msgid "See :ref:`multiprocessing-auth-keys`." msgstr "參閱 :ref:`multiprocessing-auth-keys`\\ 。" -#: ../../library/multiprocessing.rst:631 +#: ../../library/multiprocessing.rst:637 msgid "" "A numeric handle of a system object which will become \"ready\" when the " "process ends." msgstr "" -#: ../../library/multiprocessing.rst:634 +#: ../../library/multiprocessing.rst:640 msgid "" "You can use this value if you want to wait on several events at once using :" "func:`multiprocessing.connection.wait`. Otherwise calling :meth:`join()` is " "simpler." msgstr "" -#: ../../library/multiprocessing.rst:638 +#: ../../library/multiprocessing.rst:644 msgid "" "On Windows, this is an OS handle usable with the ``WaitForSingleObject`` and " "``WaitForMultipleObjects`` family of API calls. On POSIX, this is a file " "descriptor usable with primitives from the :mod:`select` module." msgstr "" -#: ../../library/multiprocessing.rst:646 +#: ../../library/multiprocessing.rst:652 msgid "" "Terminate the process. On POSIX this is done using the ``SIGTERM`` signal; " "on Windows :c:func:`TerminateProcess` is used. Note that exit handlers and " "finally clauses, etc., will not be executed." msgstr "" -#: ../../library/multiprocessing.rst:650 +#: ../../library/multiprocessing.rst:656 msgid "" "Note that descendant processes of the process will *not* be terminated -- " "they will simply become orphaned." msgstr "" -#: ../../library/multiprocessing.rst:655 +#: ../../library/multiprocessing.rst:661 msgid "" "If this method is used when the associated process is using a pipe or queue " "then the pipe or queue is liable to become corrupted and may become unusable " @@ -672,11 +680,11 @@ msgid "" "deadlock." msgstr "" -#: ../../library/multiprocessing.rst:663 +#: ../../library/multiprocessing.rst:669 msgid "Same as :meth:`terminate()` but using the ``SIGKILL`` signal on POSIX." msgstr "" -#: ../../library/multiprocessing.rst:669 +#: ../../library/multiprocessing.rst:675 msgid "" "Close the :class:`Process` object, releasing all resources associated with " "it. :exc:`ValueError` is raised if the underlying process is still " @@ -684,59 +692,59 @@ msgid "" "attributes of the :class:`Process` object will raise :exc:`ValueError`." msgstr "" -#: ../../library/multiprocessing.rst:677 +#: ../../library/multiprocessing.rst:683 msgid "" "Note that the :meth:`start`, :meth:`join`, :meth:`is_alive`, :meth:" "`terminate` and :attr:`exitcode` methods should only be called by the " "process that created the process object." msgstr "" -#: ../../library/multiprocessing.rst:681 +#: ../../library/multiprocessing.rst:687 msgid "Example usage of some of the methods of :class:`Process`:" msgstr "" -#: ../../library/multiprocessing.rst:702 +#: ../../library/multiprocessing.rst:708 msgid "The base class of all :mod:`multiprocessing` exceptions." msgstr "" -#: ../../library/multiprocessing.rst:706 +#: ../../library/multiprocessing.rst:712 msgid "" "Exception raised by :meth:`Connection.recv_bytes_into()` when the supplied " "buffer object is too small for the message read." msgstr "" -#: ../../library/multiprocessing.rst:709 +#: ../../library/multiprocessing.rst:715 msgid "" "If ``e`` is an instance of :exc:`BufferTooShort` then ``e.args[0]`` will " "give the message as a byte string." msgstr "" -#: ../../library/multiprocessing.rst:714 +#: ../../library/multiprocessing.rst:720 msgid "Raised when there is an authentication error." msgstr "" -#: ../../library/multiprocessing.rst:718 +#: ../../library/multiprocessing.rst:724 msgid "Raised by methods with a timeout when the timeout expires." msgstr "" -#: ../../library/multiprocessing.rst:721 +#: ../../library/multiprocessing.rst:727 msgid "Pipes and Queues" msgstr "" -#: ../../library/multiprocessing.rst:723 +#: ../../library/multiprocessing.rst:729 msgid "" "When using multiple processes, one generally uses message passing for " "communication between processes and avoids having to use any synchronization " "primitives like locks." msgstr "" -#: ../../library/multiprocessing.rst:727 +#: ../../library/multiprocessing.rst:733 msgid "" "For passing messages one can use :func:`Pipe` (for a connection between two " "processes) or a queue (which allows multiple producers and consumers)." msgstr "" -#: ../../library/multiprocessing.rst:730 +#: ../../library/multiprocessing.rst:736 msgid "" "The :class:`Queue`, :class:`SimpleQueue` and :class:`JoinableQueue` types " "are multi-producer, multi-consumer :abbr:`FIFO (first-in, first-out)` queues " @@ -746,7 +754,7 @@ msgid "" "Queue` class." msgstr "" -#: ../../library/multiprocessing.rst:737 +#: ../../library/multiprocessing.rst:743 msgid "" "If you use :class:`JoinableQueue` then you **must** call :meth:" "`JoinableQueue.task_done` for each task removed from the queue or else the " @@ -754,20 +762,20 @@ msgid "" "overflow, raising an exception." msgstr "" -#: ../../library/multiprocessing.rst:742 +#: ../../library/multiprocessing.rst:748 msgid "" "Note that one can also create a shared queue by using a manager object -- " "see :ref:`multiprocessing-managers`." msgstr "" -#: ../../library/multiprocessing.rst:747 +#: ../../library/multiprocessing.rst:753 msgid "" ":mod:`multiprocessing` uses the usual :exc:`queue.Empty` and :exc:`queue." "Full` exceptions to signal a timeout. They are not available in the :mod:" "`multiprocessing` namespace so you need to import them from :mod:`queue`." msgstr "" -#: ../../library/multiprocessing.rst:754 +#: ../../library/multiprocessing.rst:760 msgid "" "When an object is put on a queue, the object is pickled and a background " "thread later flushes the pickled data to an underlying pipe. This has some " @@ -776,14 +784,14 @@ msgid "" "a queue created with a :ref:`manager `." msgstr "" -#: ../../library/multiprocessing.rst:761 +#: ../../library/multiprocessing.rst:767 msgid "" "After putting an object on an empty queue there may be an infinitesimal " "delay before the queue's :meth:`~Queue.empty` method returns :const:`False` " "and :meth:`~Queue.get_nowait` can return without raising :exc:`queue.Empty`." msgstr "" -#: ../../library/multiprocessing.rst:766 +#: ../../library/multiprocessing.rst:772 msgid "" "If multiple processes are enqueuing objects, it is possible for the objects " "to be received at the other end out-of-order. However, objects enqueued by " @@ -791,7 +799,7 @@ msgid "" "other." msgstr "" -#: ../../library/multiprocessing.rst:773 +#: ../../library/multiprocessing.rst:779 msgid "" "If a process is killed using :meth:`Process.terminate` or :func:`os.kill` " "while it is trying to use a :class:`Queue`, then the data in the queue is " @@ -799,7 +807,7 @@ msgid "" "exception when it tries to use the queue later on." msgstr "" -#: ../../library/multiprocessing.rst:780 +#: ../../library/multiprocessing.rst:786 msgid "" "As mentioned above, if a child process has put items on a queue (and it has " "not used :meth:`JoinableQueue.cancel_join_thread ` -- see also :ref:`multiprocessing-listeners-clients`." msgstr "" -#: ../../library/multiprocessing.rst:1155 +#: ../../library/multiprocessing.rst:1161 msgid "" "Send an object to the other end of the connection which should be read " "using :meth:`recv`." msgstr "" -#: ../../library/multiprocessing.rst:1158 +#: ../../library/multiprocessing.rst:1164 msgid "" "The object must be picklable. Very large pickles (approximately 32 MiB+, " "though it depends on the OS) may raise a :exc:`ValueError` exception." msgstr "" -#: ../../library/multiprocessing.rst:1163 +#: ../../library/multiprocessing.rst:1169 msgid "" "Return an object sent from the other end of the connection using :meth:" "`send`. Blocks until there is something to receive. Raises :exc:`EOFError` " "if there is nothing left to receive and the other end was closed." msgstr "" -#: ../../library/multiprocessing.rst:1170 +#: ../../library/multiprocessing.rst:1176 msgid "Return the file descriptor or handle used by the connection." msgstr "" -#: ../../library/multiprocessing.rst:1174 +#: ../../library/multiprocessing.rst:1180 msgid "Close the connection." msgstr "" -#: ../../library/multiprocessing.rst:1176 +#: ../../library/multiprocessing.rst:1182 msgid "This is called automatically when the connection is garbage collected." msgstr "" -#: ../../library/multiprocessing.rst:1180 +#: ../../library/multiprocessing.rst:1186 msgid "Return whether there is any data available to be read." msgstr "" -#: ../../library/multiprocessing.rst:1182 +#: ../../library/multiprocessing.rst:1188 msgid "" "If *timeout* is not specified then it will return immediately. If *timeout* " "is a number then this specifies the maximum time in seconds to block. If " "*timeout* is ``None`` then an infinite timeout is used." msgstr "" -#: ../../library/multiprocessing.rst:1186 +#: ../../library/multiprocessing.rst:1192 msgid "" "Note that multiple connection objects may be polled at once by using :func:" "`multiprocessing.connection.wait`." msgstr "" -#: ../../library/multiprocessing.rst:1191 +#: ../../library/multiprocessing.rst:1197 msgid "Send byte data from a :term:`bytes-like object` as a complete message." msgstr "" -#: ../../library/multiprocessing.rst:1193 +#: ../../library/multiprocessing.rst:1199 msgid "" "If *offset* is given then data is read from that position in *buffer*. If " "*size* is given then that many bytes will be read from buffer. Very large " @@ -1316,7 +1324,7 @@ msgid "" "exc:`ValueError` exception" msgstr "" -#: ../../library/multiprocessing.rst:1200 +#: ../../library/multiprocessing.rst:1206 msgid "" "Return a complete message of byte data sent from the other end of the " "connection as a string. Blocks until there is something to receive. Raises :" @@ -1324,19 +1332,19 @@ msgid "" "closed." msgstr "" -#: ../../library/multiprocessing.rst:1205 +#: ../../library/multiprocessing.rst:1211 msgid "" "If *maxlength* is specified and the message is longer than *maxlength* then :" "exc:`OSError` is raised and the connection will no longer be readable." msgstr "" -#: ../../library/multiprocessing.rst:1209 +#: ../../library/multiprocessing.rst:1215 msgid "" "This function used to raise :exc:`IOError`, which is now an alias of :exc:" "`OSError`." msgstr "" -#: ../../library/multiprocessing.rst:1216 +#: ../../library/multiprocessing.rst:1222 msgid "" "Read into *buffer* a complete message of byte data sent from the other end " "of the connection and return the number of bytes in the message. Blocks " @@ -1344,45 +1352,45 @@ msgid "" "nothing left to receive and the other end was closed." msgstr "" -#: ../../library/multiprocessing.rst:1222 +#: ../../library/multiprocessing.rst:1228 msgid "" "*buffer* must be a writable :term:`bytes-like object`. If *offset* is given " "then the message will be written into the buffer from that position. Offset " "must be a non-negative integer less than the length of *buffer* (in bytes)." msgstr "" -#: ../../library/multiprocessing.rst:1227 +#: ../../library/multiprocessing.rst:1233 msgid "" "If the buffer is too short then a :exc:`BufferTooShort` exception is raised " "and the complete message is available as ``e.args[0]`` where ``e`` is the " "exception instance." msgstr "" -#: ../../library/multiprocessing.rst:1231 +#: ../../library/multiprocessing.rst:1237 msgid "" "Connection objects themselves can now be transferred between processes " "using :meth:`Connection.send` and :meth:`Connection.recv`." msgstr "" -#: ../../library/multiprocessing.rst:1235 +#: ../../library/multiprocessing.rst:1241 msgid "" "Connection objects now support the context management protocol -- see :ref:" "`typecontextmanager`. :meth:`~contextmanager.__enter__` returns the " "connection object, and :meth:`~contextmanager.__exit__` calls :meth:`close`." msgstr "" -#: ../../library/multiprocessing.rst:1240 +#: ../../library/multiprocessing.rst:1246 msgid "For example:" msgstr "" -#: ../../library/multiprocessing.rst:1265 +#: ../../library/multiprocessing.rst:1271 msgid "" "The :meth:`Connection.recv` method automatically unpickles the data it " "receives, which can be a security risk unless you can trust the process " "which sent the message." msgstr "" -#: ../../library/multiprocessing.rst:1269 +#: ../../library/multiprocessing.rst:1275 msgid "" "Therefore, unless the connection object was produced using :func:`Pipe` you " "should only use the :meth:`~Connection.recv` and :meth:`~Connection.send` " @@ -1390,73 +1398,73 @@ msgid "" "`multiprocessing-auth-keys`." msgstr "" -#: ../../library/multiprocessing.rst:1276 +#: ../../library/multiprocessing.rst:1282 msgid "" "If a process is killed while it is trying to read or write to a pipe then " "the data in the pipe is likely to become corrupted, because it may become " "impossible to be sure where the message boundaries lie." msgstr "" -#: ../../library/multiprocessing.rst:1282 +#: ../../library/multiprocessing.rst:1288 msgid "Synchronization primitives" msgstr "" -#: ../../library/multiprocessing.rst:1286 +#: ../../library/multiprocessing.rst:1292 msgid "" "Generally synchronization primitives are not as necessary in a multiprocess " "program as they are in a multithreaded program. See the documentation for :" "mod:`threading` module." msgstr "" -#: ../../library/multiprocessing.rst:1290 +#: ../../library/multiprocessing.rst:1296 msgid "" "Note that one can also create synchronization primitives by using a manager " "object -- see :ref:`multiprocessing-managers`." msgstr "" -#: ../../library/multiprocessing.rst:1295 +#: ../../library/multiprocessing.rst:1301 msgid "A barrier object: a clone of :class:`threading.Barrier`." msgstr "" -#: ../../library/multiprocessing.rst:1301 +#: ../../library/multiprocessing.rst:1307 msgid "" "A bounded semaphore object: a close analog of :class:`threading." "BoundedSemaphore`." msgstr "" -#: ../../library/multiprocessing.rst:1304 -#: ../../library/multiprocessing.rst:1442 +#: ../../library/multiprocessing.rst:1310 +#: ../../library/multiprocessing.rst:1448 msgid "" "A solitary difference from its close analog exists: its ``acquire`` method's " "first argument is named *block*, as is consistent with :meth:`Lock.acquire`." msgstr "" -#: ../../library/multiprocessing.rst:1308 +#: ../../library/multiprocessing.rst:1314 msgid "" "On macOS, this is indistinguishable from :class:`Semaphore` because " "``sem_getvalue()`` is not implemented on that platform." msgstr "" -#: ../../library/multiprocessing.rst:1313 +#: ../../library/multiprocessing.rst:1319 msgid "A condition variable: an alias for :class:`threading.Condition`." msgstr "" -#: ../../library/multiprocessing.rst:1315 +#: ../../library/multiprocessing.rst:1321 msgid "" "If *lock* is specified then it should be a :class:`Lock` or :class:`RLock` " "object from :mod:`multiprocessing`." msgstr "" -#: ../../library/multiprocessing.rst:1318 -#: ../../library/multiprocessing.rst:1867 +#: ../../library/multiprocessing.rst:1324 +#: ../../library/multiprocessing.rst:1873 msgid "The :meth:`~threading.Condition.wait_for` method was added." msgstr "" -#: ../../library/multiprocessing.rst:1323 +#: ../../library/multiprocessing.rst:1329 msgid "A clone of :class:`threading.Event`." msgstr "" -#: ../../library/multiprocessing.rst:1328 +#: ../../library/multiprocessing.rst:1334 msgid "" "A non-recursive lock object: a close analog of :class:`threading.Lock`. Once " "a process or thread has acquired a lock, subsequent attempts to acquire it " @@ -1467,25 +1475,25 @@ msgid "" "as noted." msgstr "" -#: ../../library/multiprocessing.rst:1336 +#: ../../library/multiprocessing.rst:1342 msgid "" "Note that :class:`Lock` is actually a factory function which returns an " "instance of ``multiprocessing.synchronize.Lock`` initialized with a default " "context." msgstr "" -#: ../../library/multiprocessing.rst:1340 +#: ../../library/multiprocessing.rst:1346 msgid "" ":class:`Lock` supports the :term:`context manager` protocol and thus may be " "used in :keyword:`with` statements." msgstr "" -#: ../../library/multiprocessing.rst:1345 -#: ../../library/multiprocessing.rst:1396 +#: ../../library/multiprocessing.rst:1351 +#: ../../library/multiprocessing.rst:1402 msgid "Acquire a lock, blocking or non-blocking." msgstr "" -#: ../../library/multiprocessing.rst:1347 +#: ../../library/multiprocessing.rst:1353 msgid "" "With the *block* argument set to ``True`` (the default), the method call " "will block until the lock is in an unlocked state, then set it to locked and " @@ -1493,14 +1501,14 @@ msgid "" "that in :meth:`threading.Lock.acquire`." msgstr "" -#: ../../library/multiprocessing.rst:1352 +#: ../../library/multiprocessing.rst:1358 msgid "" "With the *block* argument set to ``False``, the method call does not block. " "If the lock is currently in a locked state, return ``False``; otherwise set " "the lock to a locked state and return ``True``." msgstr "" -#: ../../library/multiprocessing.rst:1356 +#: ../../library/multiprocessing.rst:1362 msgid "" "When invoked with a positive, floating-point value for *timeout*, block for " "at most the number of seconds specified by *timeout* as long as the lock can " @@ -1514,19 +1522,19 @@ msgid "" "acquired or ``False`` if the timeout period has elapsed." msgstr "" -#: ../../library/multiprocessing.rst:1371 +#: ../../library/multiprocessing.rst:1377 msgid "" "Release a lock. This can be called from any process or thread, not only the " "process or thread which originally acquired the lock." msgstr "" -#: ../../library/multiprocessing.rst:1374 +#: ../../library/multiprocessing.rst:1380 msgid "" "Behavior is the same as in :meth:`threading.Lock.release` except that when " "invoked on an unlocked lock, a :exc:`ValueError` is raised." msgstr "" -#: ../../library/multiprocessing.rst:1380 +#: ../../library/multiprocessing.rst:1386 msgid "" "A recursive lock object: a close analog of :class:`threading.RLock`. A " "recursive lock must be released by the process or thread that acquired it. " @@ -1535,20 +1543,20 @@ msgid "" "release it once for each time it has been acquired." msgstr "" -#: ../../library/multiprocessing.rst:1386 +#: ../../library/multiprocessing.rst:1392 msgid "" "Note that :class:`RLock` is actually a factory function which returns an " "instance of ``multiprocessing.synchronize.RLock`` initialized with a default " "context." msgstr "" -#: ../../library/multiprocessing.rst:1390 +#: ../../library/multiprocessing.rst:1396 msgid "" ":class:`RLock` supports the :term:`context manager` protocol and thus may be " "used in :keyword:`with` statements." msgstr "" -#: ../../library/multiprocessing.rst:1398 +#: ../../library/multiprocessing.rst:1404 msgid "" "When invoked with the *block* argument set to ``True``, block until the lock " "is in an unlocked state (not owned by any process or thread) unless the lock " @@ -1561,7 +1569,7 @@ msgid "" "itself." msgstr "" -#: ../../library/multiprocessing.rst:1408 +#: ../../library/multiprocessing.rst:1414 msgid "" "When invoked with the *block* argument set to ``False``, do not block. If " "the lock has already been acquired (and thus is owned) by another process or " @@ -1572,14 +1580,14 @@ msgid "" "a return value of ``True``." msgstr "" -#: ../../library/multiprocessing.rst:1416 +#: ../../library/multiprocessing.rst:1422 msgid "" "Use and behaviors of the *timeout* argument are the same as in :meth:`Lock." "acquire`. Note that some of these behaviors of *timeout* differ from the " "implemented behaviors in :meth:`threading.RLock.acquire`." msgstr "" -#: ../../library/multiprocessing.rst:1423 +#: ../../library/multiprocessing.rst:1429 msgid "" "Release a lock, decrementing the recursion level. If after the decrement " "the recursion level is zero, reset the lock to unlocked (not owned by any " @@ -1589,7 +1597,7 @@ msgid "" "locked and owned by the calling process or thread." msgstr "" -#: ../../library/multiprocessing.rst:1431 +#: ../../library/multiprocessing.rst:1437 msgid "" "Only call this method when the calling process or thread owns the lock. An :" "exc:`AssertionError` is raised if this method is called by a process or " @@ -1598,17 +1606,17 @@ msgid "" "from the implemented behavior in :meth:`threading.RLock.release`." msgstr "" -#: ../../library/multiprocessing.rst:1440 +#: ../../library/multiprocessing.rst:1446 msgid "A semaphore object: a close analog of :class:`threading.Semaphore`." msgstr "" -#: ../../library/multiprocessing.rst:1447 +#: ../../library/multiprocessing.rst:1453 msgid "" "On macOS, ``sem_timedwait`` is unsupported, so calling ``acquire()`` with a " "timeout will emulate that function's behavior using a sleeping loop." msgstr "" -#: ../../library/multiprocessing.rst:1452 +#: ../../library/multiprocessing.rst:1458 msgid "" "If the SIGINT signal generated by :kbd:`Ctrl-C` arrives while the main " "thread is blocked by a call to :meth:`BoundedSemaphore.acquire`, :meth:`Lock." @@ -1617,13 +1625,13 @@ msgid "" "interrupted and :exc:`KeyboardInterrupt` will be raised." msgstr "" -#: ../../library/multiprocessing.rst:1458 +#: ../../library/multiprocessing.rst:1464 msgid "" "This differs from the behaviour of :mod:`threading` where SIGINT will be " "ignored while the equivalent blocking calls are in progress." msgstr "" -#: ../../library/multiprocessing.rst:1463 +#: ../../library/multiprocessing.rst:1469 msgid "" "Some of this package's functionality requires a functioning shared semaphore " "implementation on the host operating system. Without one, the :mod:" @@ -1632,32 +1640,32 @@ msgid "" "additional information." msgstr "" -#: ../../library/multiprocessing.rst:1471 +#: ../../library/multiprocessing.rst:1477 msgid "Shared :mod:`ctypes` Objects" msgstr "" -#: ../../library/multiprocessing.rst:1473 +#: ../../library/multiprocessing.rst:1479 msgid "" "It is possible to create shared objects using shared memory which can be " "inherited by child processes." msgstr "" -#: ../../library/multiprocessing.rst:1478 +#: ../../library/multiprocessing.rst:1484 msgid "" "Return a :mod:`ctypes` object allocated from shared memory. By default the " "return value is actually a synchronized wrapper for the object. The object " "itself can be accessed via the *value* attribute of a :class:`Value`." msgstr "" -#: ../../library/multiprocessing.rst:1482 -#: ../../library/multiprocessing.rst:1569 +#: ../../library/multiprocessing.rst:1488 +#: ../../library/multiprocessing.rst:1575 msgid "" "*typecode_or_type* determines the type of the returned object: it is either " "a ctypes type or a one character typecode of the kind used by the :mod:" "`array` module. *\\*args* is passed on to the constructor for the type." msgstr "" -#: ../../library/multiprocessing.rst:1486 +#: ../../library/multiprocessing.rst:1492 msgid "" "If *lock* is ``True`` (the default) then a new recursive lock object is " "created to synchronize access to the value. If *lock* is a :class:`Lock` " @@ -1667,32 +1675,32 @@ msgid "" "\"process-safe\"." msgstr "" -#: ../../library/multiprocessing.rst:1493 +#: ../../library/multiprocessing.rst:1499 msgid "" "Operations like ``+=`` which involve a read and write are not atomic. So " "if, for instance, you want to atomically increment a shared value it is " "insufficient to just do ::" msgstr "" -#: ../../library/multiprocessing.rst:1499 +#: ../../library/multiprocessing.rst:1505 msgid "" "Assuming the associated lock is recursive (which it is by default) you can " "instead do ::" msgstr "" -#: ../../library/multiprocessing.rst:1505 -#: ../../library/multiprocessing.rst:1595 -#: ../../library/multiprocessing.rst:1610 +#: ../../library/multiprocessing.rst:1511 +#: ../../library/multiprocessing.rst:1601 +#: ../../library/multiprocessing.rst:1616 msgid "Note that *lock* is a keyword-only argument." msgstr "" -#: ../../library/multiprocessing.rst:1509 +#: ../../library/multiprocessing.rst:1515 msgid "" "Return a ctypes array allocated from shared memory. By default the return " "value is actually a synchronized wrapper for the array." msgstr "" -#: ../../library/multiprocessing.rst:1512 +#: ../../library/multiprocessing.rst:1518 msgid "" "*typecode_or_type* determines the type of the elements of the returned " "array: it is either a ctypes type or a one character typecode of the kind " @@ -1702,7 +1710,7 @@ msgid "" "initialize the array and whose length determines the length of the array." msgstr "" -#: ../../library/multiprocessing.rst:1519 +#: ../../library/multiprocessing.rst:1525 msgid "" "If *lock* is ``True`` (the default) then a new lock object is created to " "synchronize access to the value. If *lock* is a :class:`Lock` or :class:" @@ -1712,28 +1720,28 @@ msgid "" "safe\"." msgstr "" -#: ../../library/multiprocessing.rst:1526 +#: ../../library/multiprocessing.rst:1532 msgid "Note that *lock* is a keyword only argument." msgstr "" -#: ../../library/multiprocessing.rst:1528 +#: ../../library/multiprocessing.rst:1534 msgid "" "Note that an array of :data:`ctypes.c_char` has *value* and *raw* attributes " "which allow one to use it to store and retrieve strings." msgstr "" -#: ../../library/multiprocessing.rst:1533 +#: ../../library/multiprocessing.rst:1539 msgid "The :mod:`multiprocessing.sharedctypes` module" msgstr "" -#: ../../library/multiprocessing.rst:1538 +#: ../../library/multiprocessing.rst:1544 msgid "" "The :mod:`multiprocessing.sharedctypes` module provides functions for " "allocating :mod:`ctypes` objects from shared memory which can be inherited " "by child processes." msgstr "" -#: ../../library/multiprocessing.rst:1544 +#: ../../library/multiprocessing.rst:1550 msgid "" "Although it is possible to store a pointer in shared memory remember that " "this will refer to a location in the address space of a specific process. " @@ -1742,11 +1750,11 @@ msgid "" "may cause a crash." msgstr "" -#: ../../library/multiprocessing.rst:1552 +#: ../../library/multiprocessing.rst:1558 msgid "Return a ctypes array allocated from shared memory." msgstr "" -#: ../../library/multiprocessing.rst:1554 +#: ../../library/multiprocessing.rst:1560 msgid "" "*typecode_or_type* determines the type of the elements of the returned " "array: it is either a ctypes type or a one character typecode of the kind " @@ -1756,40 +1764,40 @@ msgid "" "initialize the array and whose length determines the length of the array." msgstr "" -#: ../../library/multiprocessing.rst:1561 +#: ../../library/multiprocessing.rst:1567 msgid "" "Note that setting and getting an element is potentially non-atomic -- use :" "func:`Array` instead to make sure that access is automatically synchronized " "using a lock." msgstr "" -#: ../../library/multiprocessing.rst:1567 +#: ../../library/multiprocessing.rst:1573 msgid "Return a ctypes object allocated from shared memory." msgstr "" -#: ../../library/multiprocessing.rst:1573 +#: ../../library/multiprocessing.rst:1579 msgid "" "Note that setting and getting the value is potentially non-atomic -- use :" "func:`Value` instead to make sure that access is automatically synchronized " "using a lock." msgstr "" -#: ../../library/multiprocessing.rst:1577 +#: ../../library/multiprocessing.rst:1583 msgid "" "Note that an array of :data:`ctypes.c_char` has ``value`` and ``raw`` " "attributes which allow one to use it to store and retrieve strings -- see " "documentation for :mod:`ctypes`." msgstr "" -#: ../../library/multiprocessing.rst:1583 +#: ../../library/multiprocessing.rst:1589 msgid "" "The same as :func:`RawArray` except that depending on the value of *lock* a " "process-safe synchronization wrapper may be returned instead of a raw ctypes " "array." msgstr "" -#: ../../library/multiprocessing.rst:1587 -#: ../../library/multiprocessing.rst:1603 +#: ../../library/multiprocessing.rst:1593 +#: ../../library/multiprocessing.rst:1609 msgid "" "If *lock* is ``True`` (the default) then a new lock object is created to " "synchronize access to the value. If *lock* is a :class:`~multiprocessing." @@ -1799,121 +1807,121 @@ msgid "" "not necessarily be \"process-safe\"." msgstr "" -#: ../../library/multiprocessing.rst:1599 +#: ../../library/multiprocessing.rst:1605 msgid "" "The same as :func:`RawValue` except that depending on the value of *lock* a " "process-safe synchronization wrapper may be returned instead of a raw ctypes " "object." msgstr "" -#: ../../library/multiprocessing.rst:1614 +#: ../../library/multiprocessing.rst:1620 msgid "" "Return a ctypes object allocated from shared memory which is a copy of the " "ctypes object *obj*." msgstr "" -#: ../../library/multiprocessing.rst:1619 +#: ../../library/multiprocessing.rst:1625 msgid "" "Return a process-safe wrapper object for a ctypes object which uses *lock* " "to synchronize access. If *lock* is ``None`` (the default) then a :class:" "`multiprocessing.RLock` object is created automatically." msgstr "" -#: ../../library/multiprocessing.rst:1623 +#: ../../library/multiprocessing.rst:1629 msgid "" "A synchronized wrapper will have two methods in addition to those of the " "object it wraps: :meth:`get_obj` returns the wrapped object and :meth:" "`get_lock` returns the lock object used for synchronization." msgstr "" -#: ../../library/multiprocessing.rst:1627 +#: ../../library/multiprocessing.rst:1633 msgid "" "Note that accessing the ctypes object through the wrapper can be a lot " "slower than accessing the raw ctypes object." msgstr "" -#: ../../library/multiprocessing.rst:1630 +#: ../../library/multiprocessing.rst:1636 msgid "Synchronized objects support the :term:`context manager` protocol." msgstr "" -#: ../../library/multiprocessing.rst:1634 +#: ../../library/multiprocessing.rst:1640 msgid "" "The table below compares the syntax for creating shared ctypes objects from " "shared memory with the normal ctypes syntax. (In the table ``MyStruct`` is " "some subclass of :class:`ctypes.Structure`.)" msgstr "" -#: ../../library/multiprocessing.rst:1639 +#: ../../library/multiprocessing.rst:1645 msgid "ctypes" msgstr "ctypes" -#: ../../library/multiprocessing.rst:1639 +#: ../../library/multiprocessing.rst:1645 msgid "sharedctypes using type" msgstr "" -#: ../../library/multiprocessing.rst:1639 +#: ../../library/multiprocessing.rst:1645 msgid "sharedctypes using typecode" msgstr "" -#: ../../library/multiprocessing.rst:1641 +#: ../../library/multiprocessing.rst:1647 msgid "c_double(2.4)" msgstr "c_double(2.4)" -#: ../../library/multiprocessing.rst:1641 +#: ../../library/multiprocessing.rst:1647 msgid "RawValue(c_double, 2.4)" msgstr "RawValue(c_double, 2.4)" -#: ../../library/multiprocessing.rst:1641 +#: ../../library/multiprocessing.rst:1647 msgid "RawValue('d', 2.4)" msgstr "RawValue('d', 2.4)" -#: ../../library/multiprocessing.rst:1642 +#: ../../library/multiprocessing.rst:1648 msgid "MyStruct(4, 6)" msgstr "MyStruct(4, 6)" -#: ../../library/multiprocessing.rst:1642 +#: ../../library/multiprocessing.rst:1648 msgid "RawValue(MyStruct, 4, 6)" msgstr "RawValue(MyStruct, 4, 6)" -#: ../../library/multiprocessing.rst:1643 +#: ../../library/multiprocessing.rst:1649 msgid "(c_short * 7)()" msgstr "(c_short * 7)()" -#: ../../library/multiprocessing.rst:1643 +#: ../../library/multiprocessing.rst:1649 msgid "RawArray(c_short, 7)" msgstr "RawArray(c_short, 7)" -#: ../../library/multiprocessing.rst:1643 +#: ../../library/multiprocessing.rst:1649 msgid "RawArray('h', 7)" msgstr "RawArray('h', 7)" -#: ../../library/multiprocessing.rst:1644 +#: ../../library/multiprocessing.rst:1650 msgid "(c_int * 3)(9, 2, 8)" msgstr "(c_int * 3)(9, 2, 8)" -#: ../../library/multiprocessing.rst:1644 +#: ../../library/multiprocessing.rst:1650 msgid "RawArray(c_int, (9, 2, 8))" msgstr "RawArray(c_int, (9, 2, 8))" -#: ../../library/multiprocessing.rst:1644 +#: ../../library/multiprocessing.rst:1650 msgid "RawArray('i', (9, 2, 8))" msgstr "RawArray('i', (9, 2, 8))" -#: ../../library/multiprocessing.rst:1648 +#: ../../library/multiprocessing.rst:1654 msgid "" "Below is an example where a number of ctypes objects are modified by a child " "process::" msgstr "" -#: ../../library/multiprocessing.rst:1686 +#: ../../library/multiprocessing.rst:1692 msgid "The results printed are ::" msgstr "" -#: ../../library/multiprocessing.rst:1699 +#: ../../library/multiprocessing.rst:1705 msgid "Managers" msgstr "" -#: ../../library/multiprocessing.rst:1701 +#: ../../library/multiprocessing.rst:1707 msgid "" "Managers provide a way to create data which can be shared between different " "processes, including sharing over a network between processes running on " @@ -1922,7 +1930,7 @@ msgid "" "proxies." msgstr "" -#: ../../library/multiprocessing.rst:1710 +#: ../../library/multiprocessing.rst:1716 msgid "" "Returns a started :class:`~multiprocessing.managers.SyncManager` object " "which can be used for sharing objects between processes. The returned " @@ -1930,31 +1938,31 @@ msgid "" "will create shared objects and return corresponding proxies." msgstr "" -#: ../../library/multiprocessing.rst:1718 +#: ../../library/multiprocessing.rst:1724 msgid "" "Manager processes will be shutdown as soon as they are garbage collected or " "their parent process exits. The manager classes are defined in the :mod:" "`multiprocessing.managers` module:" msgstr "" -#: ../../library/multiprocessing.rst:1724 +#: ../../library/multiprocessing.rst:1730 msgid "Create a BaseManager object." msgstr "" -#: ../../library/multiprocessing.rst:1726 +#: ../../library/multiprocessing.rst:1732 msgid "" "Once created one should call :meth:`start` or ``get_server()." "serve_forever()`` to ensure that the manager object refers to a started " "manager process." msgstr "" -#: ../../library/multiprocessing.rst:1729 +#: ../../library/multiprocessing.rst:1735 msgid "" "*address* is the address on which the manager process listens for new " "connections. If *address* is ``None`` then an arbitrary one is chosen." msgstr "" -#: ../../library/multiprocessing.rst:1732 +#: ../../library/multiprocessing.rst:1738 msgid "" "*authkey* is the authentication key which will be used to check the validity " "of incoming connections to the server process. If *authkey* is ``None`` " @@ -1962,19 +1970,19 @@ msgid "" "it must be a byte string." msgstr "" -#: ../../library/multiprocessing.rst:1737 +#: ../../library/multiprocessing.rst:1743 msgid "" "*serializer* must be ``'pickle'`` (use :mod:`pickle` serialization) or " "``'xmlrpclib'`` (use :mod:`xmlrpc.client` serialization)." msgstr "" -#: ../../library/multiprocessing.rst:1740 +#: ../../library/multiprocessing.rst:1746 msgid "" "*ctx* is a context object, or ``None`` (use the current context). See the :" "func:`get_context` function." msgstr "" -#: ../../library/multiprocessing.rst:1743 +#: ../../library/multiprocessing.rst:1749 msgid "" "*shutdown_timeout* is a timeout in seconds used to wait until the process " "used by the manager completes in the :meth:`shutdown` method. If the " @@ -1982,54 +1990,54 @@ msgid "" "also times out, the process is killed." msgstr "" -#: ../../library/multiprocessing.rst:1748 +#: ../../library/multiprocessing.rst:1754 msgid "Added the *shutdown_timeout* parameter." msgstr "新增 *shutdown_timeout* 參數。" -#: ../../library/multiprocessing.rst:1753 +#: ../../library/multiprocessing.rst:1759 msgid "" "Start a subprocess to start the manager. If *initializer* is not ``None`` " "then the subprocess will call ``initializer(*initargs)`` when it starts." msgstr "" -#: ../../library/multiprocessing.rst:1758 +#: ../../library/multiprocessing.rst:1764 msgid "" "Returns a :class:`Server` object which represents the actual server under " "the control of the Manager. The :class:`Server` object supports the :meth:" "`serve_forever` method::" msgstr "" -#: ../../library/multiprocessing.rst:1767 +#: ../../library/multiprocessing.rst:1773 msgid ":class:`Server` additionally has an :attr:`address` attribute." msgstr "" -#: ../../library/multiprocessing.rst:1771 +#: ../../library/multiprocessing.rst:1777 msgid "Connect a local manager object to a remote manager process::" msgstr "" -#: ../../library/multiprocessing.rst:1779 +#: ../../library/multiprocessing.rst:1785 msgid "" "Stop the process used by the manager. This is only available if :meth:" "`start` has been used to start the server process." msgstr "" -#: ../../library/multiprocessing.rst:1782 +#: ../../library/multiprocessing.rst:1788 msgid "This can be called multiple times." msgstr "" -#: ../../library/multiprocessing.rst:1786 +#: ../../library/multiprocessing.rst:1792 msgid "" "A classmethod which can be used for registering a type or callable with the " "manager class." msgstr "" -#: ../../library/multiprocessing.rst:1789 +#: ../../library/multiprocessing.rst:1795 msgid "" "*typeid* is a \"type identifier\" which is used to identify a particular " "type of shared object. This must be a string." msgstr "" -#: ../../library/multiprocessing.rst:1792 +#: ../../library/multiprocessing.rst:1798 msgid "" "*callable* is a callable used for creating objects for this type " "identifier. If a manager instance will be connected to the server using " @@ -2037,14 +2045,14 @@ msgid "" "then this can be left as ``None``." msgstr "" -#: ../../library/multiprocessing.rst:1798 +#: ../../library/multiprocessing.rst:1804 msgid "" "*proxytype* is a subclass of :class:`BaseProxy` which is used to create " "proxies for shared objects with this *typeid*. If ``None`` then a proxy " "class is created automatically." msgstr "" -#: ../../library/multiprocessing.rst:1802 +#: ../../library/multiprocessing.rst:1808 msgid "" "*exposed* is used to specify a sequence of method names which proxies for " "this typeid should be allowed to access using :meth:`BaseProxy." @@ -2055,7 +2063,7 @@ msgid "" "method and whose name does not begin with ``'_'``.)" msgstr "" -#: ../../library/multiprocessing.rst:1811 +#: ../../library/multiprocessing.rst:1817 msgid "" "*method_to_typeid* is a mapping used to specify the return type of those " "exposed methods which should return a proxy. It maps method names to typeid " @@ -2065,22 +2073,22 @@ msgid "" "returned by the method will be copied by value." msgstr "" -#: ../../library/multiprocessing.rst:1818 +#: ../../library/multiprocessing.rst:1824 msgid "" "*create_method* determines whether a method should be created with name " "*typeid* which can be used to tell the server process to create a new shared " "object and return a proxy for it. By default it is ``True``." msgstr "" -#: ../../library/multiprocessing.rst:1822 +#: ../../library/multiprocessing.rst:1828 msgid ":class:`BaseManager` instances also have one read-only property:" msgstr "" -#: ../../library/multiprocessing.rst:1826 +#: ../../library/multiprocessing.rst:1832 msgid "The address used by the manager." msgstr "" -#: ../../library/multiprocessing.rst:1828 +#: ../../library/multiprocessing.rst:1834 msgid "" "Manager objects support the context management protocol -- see :ref:" "`typecontextmanager`. :meth:`~contextmanager.__enter__` starts the server " @@ -2088,173 +2096,173 @@ msgid "" "object. :meth:`~contextmanager.__exit__` calls :meth:`shutdown`." msgstr "" -#: ../../library/multiprocessing.rst:1834 +#: ../../library/multiprocessing.rst:1840 msgid "" "In previous versions :meth:`~contextmanager.__enter__` did not start the " "manager's server process if it was not already started." msgstr "" -#: ../../library/multiprocessing.rst:1839 +#: ../../library/multiprocessing.rst:1845 msgid "" "A subclass of :class:`BaseManager` which can be used for the synchronization " "of processes. Objects of this type are returned by :func:`multiprocessing." "Manager`." msgstr "" -#: ../../library/multiprocessing.rst:1843 +#: ../../library/multiprocessing.rst:1849 msgid "" "Its methods create and return :ref:`multiprocessing-proxy_objects` for a " "number of commonly used data types to be synchronized across processes. This " "notably includes shared lists and dictionaries." msgstr "" -#: ../../library/multiprocessing.rst:1849 +#: ../../library/multiprocessing.rst:1855 msgid "" "Create a shared :class:`threading.Barrier` object and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:1856 +#: ../../library/multiprocessing.rst:1862 msgid "" "Create a shared :class:`threading.BoundedSemaphore` object and return a " "proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:1861 +#: ../../library/multiprocessing.rst:1867 msgid "" "Create a shared :class:`threading.Condition` object and return a proxy for " "it." msgstr "" -#: ../../library/multiprocessing.rst:1864 +#: ../../library/multiprocessing.rst:1870 msgid "" "If *lock* is supplied then it should be a proxy for a :class:`threading." "Lock` or :class:`threading.RLock` object." msgstr "" -#: ../../library/multiprocessing.rst:1872 +#: ../../library/multiprocessing.rst:1878 msgid "" "Create a shared :class:`threading.Event` object and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:1876 +#: ../../library/multiprocessing.rst:1882 msgid "" "Create a shared :class:`threading.Lock` object and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:1880 +#: ../../library/multiprocessing.rst:1886 msgid "Create a shared :class:`Namespace` object and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:1884 +#: ../../library/multiprocessing.rst:1890 msgid "Create a shared :class:`queue.Queue` object and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:1888 +#: ../../library/multiprocessing.rst:1894 msgid "" "Create a shared :class:`threading.RLock` object and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:1892 +#: ../../library/multiprocessing.rst:1898 msgid "" "Create a shared :class:`threading.Semaphore` object and return a proxy for " "it." msgstr "" -#: ../../library/multiprocessing.rst:1897 +#: ../../library/multiprocessing.rst:1903 msgid "Create an array and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:1901 +#: ../../library/multiprocessing.rst:1907 msgid "" "Create an object with a writable ``value`` attribute and return a proxy for " "it." msgstr "" -#: ../../library/multiprocessing.rst:1908 +#: ../../library/multiprocessing.rst:1914 msgid "Create a shared :class:`dict` object and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:1913 +#: ../../library/multiprocessing.rst:1919 msgid "Create a shared :class:`list` object and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:1915 +#: ../../library/multiprocessing.rst:1921 msgid "" "Shared objects are capable of being nested. For example, a shared container " "object such as a shared list can contain other shared objects which will all " "be managed and synchronized by the :class:`SyncManager`." msgstr "" -#: ../../library/multiprocessing.rst:1922 +#: ../../library/multiprocessing.rst:1928 msgid "A type that can register with :class:`SyncManager`." msgstr "" -#: ../../library/multiprocessing.rst:1924 +#: ../../library/multiprocessing.rst:1930 msgid "" "A namespace object has no public methods, but does have writable attributes. " "Its representation shows the values of its attributes." msgstr "" -#: ../../library/multiprocessing.rst:1927 +#: ../../library/multiprocessing.rst:1933 msgid "" "However, when using a proxy for a namespace object, an attribute beginning " "with ``'_'`` will be an attribute of the proxy and not an attribute of the " "referent:" msgstr "" -#: ../../library/multiprocessing.rst:1944 +#: ../../library/multiprocessing.rst:1950 msgid "Customized managers" msgstr "" -#: ../../library/multiprocessing.rst:1946 +#: ../../library/multiprocessing.rst:1952 msgid "" "To create one's own manager, one creates a subclass of :class:`BaseManager` " "and uses the :meth:`~BaseManager.register` classmethod to register new types " "or callables with the manager class. For example::" msgstr "" -#: ../../library/multiprocessing.rst:1971 +#: ../../library/multiprocessing.rst:1977 msgid "Using a remote manager" msgstr "" -#: ../../library/multiprocessing.rst:1973 +#: ../../library/multiprocessing.rst:1979 msgid "" "It is possible to run a manager server on one machine and have clients use " "it from other machines (assuming that the firewalls involved allow it)." msgstr "" -#: ../../library/multiprocessing.rst:1976 +#: ../../library/multiprocessing.rst:1982 msgid "" "Running the following commands creates a server for a single shared queue " "which remote clients can access::" msgstr "" -#: ../../library/multiprocessing.rst:1988 +#: ../../library/multiprocessing.rst:1994 msgid "One client can access the server as follows::" msgstr "" -#: ../../library/multiprocessing.rst:1998 +#: ../../library/multiprocessing.rst:2004 msgid "Another client can also use it::" msgstr "" -#: ../../library/multiprocessing.rst:2009 +#: ../../library/multiprocessing.rst:2015 msgid "" "Local processes can also access that queue, using the code from above on the " "client to access it remotely::" msgstr "" -#: ../../library/multiprocessing.rst:2034 +#: ../../library/multiprocessing.rst:2040 msgid "Proxy Objects" msgstr "" -#: ../../library/multiprocessing.rst:2036 +#: ../../library/multiprocessing.rst:2042 msgid "" "A proxy is an object which *refers* to a shared object which lives " "(presumably) in a different process. The shared object is said to be the " "*referent* of the proxy. Multiple proxy objects may have the same referent." msgstr "" -#: ../../library/multiprocessing.rst:2040 +#: ../../library/multiprocessing.rst:2046 msgid "" "A proxy object has methods which invoke corresponding methods of its " "referent (although not every method of the referent will necessarily be " @@ -2262,14 +2270,14 @@ msgid "" "its referent can:" msgstr "" -#: ../../library/multiprocessing.rst:2058 +#: ../../library/multiprocessing.rst:2064 msgid "" "Notice that applying :func:`str` to a proxy will return the representation " "of the referent, whereas applying :func:`repr` will return the " "representation of the proxy." msgstr "" -#: ../../library/multiprocessing.rst:2062 +#: ../../library/multiprocessing.rst:2068 msgid "" "An important feature of proxy objects is that they are picklable so they can " "be passed between processes. As such, a referent can contain :ref:" @@ -2277,11 +2285,11 @@ msgid "" "lists, dicts, and other :ref:`multiprocessing-proxy_objects`:" msgstr "" -#: ../../library/multiprocessing.rst:2078 +#: ../../library/multiprocessing.rst:2084 msgid "Similarly, dict and list proxies may be nested inside one another::" msgstr "" -#: ../../library/multiprocessing.rst:2091 +#: ../../library/multiprocessing.rst:2097 msgid "" "If standard (non-proxy) :class:`list` or :class:`dict` objects are contained " "in a referent, modifications to those mutable values will not be propagated " @@ -2292,53 +2300,53 @@ msgid "" "assign the modified value to the container proxy::" msgstr "" -#: ../../library/multiprocessing.rst:2110 +#: ../../library/multiprocessing.rst:2116 msgid "" "This approach is perhaps less convenient than employing nested :ref:" "`multiprocessing-proxy_objects` for most use cases but also demonstrates a " "level of control over the synchronization." msgstr "" -#: ../../library/multiprocessing.rst:2116 +#: ../../library/multiprocessing.rst:2122 msgid "" "The proxy types in :mod:`multiprocessing` do nothing to support comparisons " "by value. So, for instance, we have:" msgstr "" -#: ../../library/multiprocessing.rst:2124 +#: ../../library/multiprocessing.rst:2130 msgid "" "One should just use a copy of the referent instead when making comparisons." msgstr "" -#: ../../library/multiprocessing.rst:2128 +#: ../../library/multiprocessing.rst:2134 msgid "Proxy objects are instances of subclasses of :class:`BaseProxy`." msgstr "" -#: ../../library/multiprocessing.rst:2132 +#: ../../library/multiprocessing.rst:2138 msgid "Call and return the result of a method of the proxy's referent." msgstr "" -#: ../../library/multiprocessing.rst:2134 +#: ../../library/multiprocessing.rst:2140 msgid "" "If ``proxy`` is a proxy whose referent is ``obj`` then the expression ::" msgstr "" -#: ../../library/multiprocessing.rst:2138 +#: ../../library/multiprocessing.rst:2144 msgid "will evaluate the expression ::" msgstr "" -#: ../../library/multiprocessing.rst:2142 +#: ../../library/multiprocessing.rst:2148 msgid "in the manager's process." msgstr "" -#: ../../library/multiprocessing.rst:2144 +#: ../../library/multiprocessing.rst:2150 msgid "" "The returned value will be a copy of the result of the call or a proxy to a " "new shared object -- see documentation for the *method_to_typeid* argument " "of :meth:`BaseManager.register`." msgstr "" -#: ../../library/multiprocessing.rst:2148 +#: ../../library/multiprocessing.rst:2154 msgid "" "If an exception is raised by the call, then is re-raised by :meth:" "`_callmethod`. If some other exception is raised in the manager's process " @@ -2346,79 +2354,79 @@ msgid "" "meth:`_callmethod`." msgstr "" -#: ../../library/multiprocessing.rst:2153 +#: ../../library/multiprocessing.rst:2159 msgid "" "Note in particular that an exception will be raised if *methodname* has not " "been *exposed*." msgstr "" -#: ../../library/multiprocessing.rst:2156 +#: ../../library/multiprocessing.rst:2162 msgid "An example of the usage of :meth:`_callmethod`:" msgstr "" -#: ../../library/multiprocessing.rst:2172 +#: ../../library/multiprocessing.rst:2178 msgid "Return a copy of the referent." msgstr "" -#: ../../library/multiprocessing.rst:2174 +#: ../../library/multiprocessing.rst:2180 msgid "If the referent is unpicklable then this will raise an exception." msgstr "" -#: ../../library/multiprocessing.rst:2178 +#: ../../library/multiprocessing.rst:2184 msgid "Return a representation of the proxy object." msgstr "" -#: ../../library/multiprocessing.rst:2182 +#: ../../library/multiprocessing.rst:2188 msgid "Return the representation of the referent." msgstr "" -#: ../../library/multiprocessing.rst:2186 +#: ../../library/multiprocessing.rst:2192 msgid "Cleanup" msgstr "" -#: ../../library/multiprocessing.rst:2188 +#: ../../library/multiprocessing.rst:2194 msgid "" "A proxy object uses a weakref callback so that when it gets garbage " "collected it deregisters itself from the manager which owns its referent." msgstr "" -#: ../../library/multiprocessing.rst:2191 +#: ../../library/multiprocessing.rst:2197 msgid "" "A shared object gets deleted from the manager process when there are no " "longer any proxies referring to it." msgstr "" -#: ../../library/multiprocessing.rst:2196 +#: ../../library/multiprocessing.rst:2202 msgid "Process Pools" msgstr "" -#: ../../library/multiprocessing.rst:2201 +#: ../../library/multiprocessing.rst:2207 msgid "" "One can create a pool of processes which will carry out tasks submitted to " "it with the :class:`Pool` class." msgstr "" -#: ../../library/multiprocessing.rst:2206 +#: ../../library/multiprocessing.rst:2212 msgid "" "A process pool object which controls a pool of worker processes to which " "jobs can be submitted. It supports asynchronous results with timeouts and " "callbacks and has a parallel map implementation." msgstr "" -#: ../../library/multiprocessing.rst:2210 +#: ../../library/multiprocessing.rst:2216 msgid "" "*processes* is the number of worker processes to use. If *processes* is " "``None`` then the number returned by :func:`os.cpu_count` is used." msgstr "" -#: ../../library/multiprocessing.rst:2213 -#: ../../library/multiprocessing.rst:2774 +#: ../../library/multiprocessing.rst:2219 +#: ../../library/multiprocessing.rst:2780 msgid "" "If *initializer* is not ``None`` then each worker process will call " "``initializer(*initargs)`` when it starts." msgstr "" -#: ../../library/multiprocessing.rst:2216 +#: ../../library/multiprocessing.rst:2222 msgid "" "*maxtasksperchild* is the number of tasks a worker process can complete " "before it will exit and be replaced with a fresh worker process, to enable " @@ -2426,7 +2434,7 @@ msgid "" "which means worker processes will live as long as the pool." msgstr "" -#: ../../library/multiprocessing.rst:2221 +#: ../../library/multiprocessing.rst:2227 msgid "" "*context* can be used to specify the context used for starting the worker " "processes. Usually a pool is created using the function :func:" @@ -2434,13 +2442,13 @@ msgid "" "both cases *context* is set appropriately." msgstr "" -#: ../../library/multiprocessing.rst:2227 +#: ../../library/multiprocessing.rst:2233 msgid "" "Note that the methods of the pool object should only be called by the " "process which created the pool." msgstr "" -#: ../../library/multiprocessing.rst:2231 +#: ../../library/multiprocessing.rst:2237 msgid "" ":class:`multiprocessing.pool` objects have internal resources that need to " "be properly managed (like any other resource) by using the pool as a context " @@ -2448,22 +2456,22 @@ msgid "" "to do this can lead to the process hanging on finalization." msgstr "" -#: ../../library/multiprocessing.rst:2236 +#: ../../library/multiprocessing.rst:2242 msgid "" "Note that it is **not correct** to rely on the garbage collector to destroy " "the pool as CPython does not assure that the finalizer of the pool will be " "called (see :meth:`object.__del__` for more information)." msgstr "" -#: ../../library/multiprocessing.rst:2240 +#: ../../library/multiprocessing.rst:2246 msgid "*maxtasksperchild*" msgstr "" -#: ../../library/multiprocessing.rst:2243 +#: ../../library/multiprocessing.rst:2249 msgid "*context*" msgstr "" -#: ../../library/multiprocessing.rst:2248 +#: ../../library/multiprocessing.rst:2254 msgid "" "Worker processes within a :class:`Pool` typically live for the complete " "duration of the Pool's work queue. A frequent pattern found in other systems " @@ -2474,7 +2482,7 @@ msgid "" "ability to the end user." msgstr "" -#: ../../library/multiprocessing.rst:2258 +#: ../../library/multiprocessing.rst:2264 msgid "" "Call *func* with arguments *args* and keyword arguments *kwds*. It blocks " "until the result is ready. Given this blocks, :meth:`apply_async` is better " @@ -2482,14 +2490,14 @@ msgid "" "executed in one of the workers of the pool." msgstr "" -#: ../../library/multiprocessing.rst:2265 +#: ../../library/multiprocessing.rst:2271 msgid "" "A variant of the :meth:`apply` method which returns a :class:" "`~multiprocessing.pool.AsyncResult` object." msgstr "" -#: ../../library/multiprocessing.rst:2268 -#: ../../library/multiprocessing.rst:2299 +#: ../../library/multiprocessing.rst:2274 +#: ../../library/multiprocessing.rst:2305 msgid "" "If *callback* is specified then it should be a callable which accepts a " "single argument. When the result becomes ready *callback* is applied to it, " @@ -2497,60 +2505,60 @@ msgid "" "applied instead." msgstr "" -#: ../../library/multiprocessing.rst:2273 -#: ../../library/multiprocessing.rst:2304 +#: ../../library/multiprocessing.rst:2279 +#: ../../library/multiprocessing.rst:2310 msgid "" "If *error_callback* is specified then it should be a callable which accepts " "a single argument. If the target function fails, then the *error_callback* " "is called with the exception instance." msgstr "" -#: ../../library/multiprocessing.rst:2277 -#: ../../library/multiprocessing.rst:2308 +#: ../../library/multiprocessing.rst:2283 +#: ../../library/multiprocessing.rst:2314 msgid "" "Callbacks should complete immediately since otherwise the thread which " "handles the results will get blocked." msgstr "" -#: ../../library/multiprocessing.rst:2282 +#: ../../library/multiprocessing.rst:2288 msgid "" "A parallel equivalent of the :func:`map` built-in function (it supports only " "one *iterable* argument though, for multiple iterables see :meth:`starmap`). " "It blocks until the result is ready." msgstr "" -#: ../../library/multiprocessing.rst:2286 +#: ../../library/multiprocessing.rst:2292 msgid "" "This method chops the iterable into a number of chunks which it submits to " "the process pool as separate tasks. The (approximate) size of these chunks " "can be specified by setting *chunksize* to a positive integer." msgstr "" -#: ../../library/multiprocessing.rst:2290 +#: ../../library/multiprocessing.rst:2296 msgid "" "Note that it may cause high memory usage for very long iterables. Consider " "using :meth:`imap` or :meth:`imap_unordered` with explicit *chunksize* " "option for better efficiency." msgstr "" -#: ../../library/multiprocessing.rst:2296 +#: ../../library/multiprocessing.rst:2302 msgid "" "A variant of the :meth:`.map` method which returns a :class:" "`~multiprocessing.pool.AsyncResult` object." msgstr "" -#: ../../library/multiprocessing.rst:2313 +#: ../../library/multiprocessing.rst:2319 msgid "A lazier version of :meth:`.map`." msgstr "" -#: ../../library/multiprocessing.rst:2315 +#: ../../library/multiprocessing.rst:2321 msgid "" "The *chunksize* argument is the same as the one used by the :meth:`.map` " "method. For very long iterables using a large value for *chunksize* can " "make the job complete **much** faster than using the default value of ``1``." msgstr "" -#: ../../library/multiprocessing.rst:2320 +#: ../../library/multiprocessing.rst:2326 msgid "" "Also if *chunksize* is ``1`` then the :meth:`!next` method of the iterator " "returned by the :meth:`imap` method has an optional *timeout* parameter: " @@ -2558,65 +2566,65 @@ msgid "" "result cannot be returned within *timeout* seconds." msgstr "" -#: ../../library/multiprocessing.rst:2327 +#: ../../library/multiprocessing.rst:2333 msgid "" "The same as :meth:`imap` except that the ordering of the results from the " "returned iterator should be considered arbitrary. (Only when there is only " "one worker process is the order guaranteed to be \"correct\".)" msgstr "" -#: ../../library/multiprocessing.rst:2333 +#: ../../library/multiprocessing.rst:2339 msgid "" "Like :meth:`~multiprocessing.pool.Pool.map` except that the elements of the " "*iterable* are expected to be iterables that are unpacked as arguments." msgstr "" -#: ../../library/multiprocessing.rst:2337 +#: ../../library/multiprocessing.rst:2343 msgid "" "Hence an *iterable* of ``[(1,2), (3, 4)]`` results in ``[func(1,2), " "func(3,4)]``." msgstr "" -#: ../../library/multiprocessing.rst:2344 +#: ../../library/multiprocessing.rst:2350 msgid "" "A combination of :meth:`starmap` and :meth:`map_async` that iterates over " "*iterable* of iterables and calls *func* with the iterables unpacked. " "Returns a result object." msgstr "" -#: ../../library/multiprocessing.rst:2352 +#: ../../library/multiprocessing.rst:2358 msgid "" "Prevents any more tasks from being submitted to the pool. Once all the " "tasks have been completed the worker processes will exit." msgstr "" -#: ../../library/multiprocessing.rst:2357 +#: ../../library/multiprocessing.rst:2363 msgid "" "Stops the worker processes immediately without completing outstanding work. " "When the pool object is garbage collected :meth:`terminate` will be called " "immediately." msgstr "" -#: ../../library/multiprocessing.rst:2363 +#: ../../library/multiprocessing.rst:2369 msgid "" "Wait for the worker processes to exit. One must call :meth:`close` or :meth:" "`terminate` before using :meth:`join`." msgstr "" -#: ../../library/multiprocessing.rst:2366 +#: ../../library/multiprocessing.rst:2372 msgid "" "Pool objects now support the context management protocol -- see :ref:" "`typecontextmanager`. :meth:`~contextmanager.__enter__` returns the pool " "object, and :meth:`~contextmanager.__exit__` calls :meth:`terminate`." msgstr "" -#: ../../library/multiprocessing.rst:2374 +#: ../../library/multiprocessing.rst:2380 msgid "" "The class of the result returned by :meth:`Pool.apply_async` and :meth:`Pool." "map_async`." msgstr "" -#: ../../library/multiprocessing.rst:2379 +#: ../../library/multiprocessing.rst:2385 msgid "" "Return the result when it arrives. If *timeout* is not ``None`` and the " "result does not arrive within *timeout* seconds then :exc:`multiprocessing." @@ -2624,41 +2632,41 @@ msgid "" "exception will be reraised by :meth:`get`." msgstr "" -#: ../../library/multiprocessing.rst:2386 +#: ../../library/multiprocessing.rst:2392 msgid "Wait until the result is available or until *timeout* seconds pass." msgstr "" -#: ../../library/multiprocessing.rst:2390 +#: ../../library/multiprocessing.rst:2396 msgid "Return whether the call has completed." msgstr "" -#: ../../library/multiprocessing.rst:2394 +#: ../../library/multiprocessing.rst:2400 msgid "" "Return whether the call completed without raising an exception. Will raise :" "exc:`ValueError` if the result is not ready." msgstr "" -#: ../../library/multiprocessing.rst:2397 +#: ../../library/multiprocessing.rst:2403 msgid "" "If the result is not ready, :exc:`ValueError` is raised instead of :exc:" "`AssertionError`." msgstr "" -#: ../../library/multiprocessing.rst:2401 +#: ../../library/multiprocessing.rst:2407 msgid "The following example demonstrates the use of a pool::" msgstr "" -#: ../../library/multiprocessing.rst:2428 +#: ../../library/multiprocessing.rst:2434 msgid "Listeners and Clients" msgstr "" -#: ../../library/multiprocessing.rst:2433 +#: ../../library/multiprocessing.rst:2439 msgid "" "Usually message passing between processes is done using queues or by using :" "class:`~Connection` objects returned by :func:`~multiprocessing.Pipe`." msgstr "" -#: ../../library/multiprocessing.rst:2437 +#: ../../library/multiprocessing.rst:2443 msgid "" "However, the :mod:`multiprocessing.connection` module allows some extra " "flexibility. It basically gives a high level message oriented API for " @@ -2667,46 +2675,46 @@ msgid "" "multiple connections at the same time." msgstr "" -#: ../../library/multiprocessing.rst:2446 +#: ../../library/multiprocessing.rst:2452 msgid "" "Send a randomly generated message to the other end of the connection and " "wait for a reply." msgstr "" -#: ../../library/multiprocessing.rst:2449 +#: ../../library/multiprocessing.rst:2455 msgid "" "If the reply matches the digest of the message using *authkey* as the key " "then a welcome message is sent to the other end of the connection. " "Otherwise :exc:`~multiprocessing.AuthenticationError` is raised." msgstr "" -#: ../../library/multiprocessing.rst:2455 +#: ../../library/multiprocessing.rst:2461 msgid "" "Receive a message, calculate the digest of the message using *authkey* as " "the key, and then send the digest back." msgstr "" -#: ../../library/multiprocessing.rst:2458 +#: ../../library/multiprocessing.rst:2464 msgid "" "If a welcome message is not received, then :exc:`~multiprocessing." "AuthenticationError` is raised." msgstr "" -#: ../../library/multiprocessing.rst:2463 +#: ../../library/multiprocessing.rst:2469 msgid "" "Attempt to set up a connection to the listener which is using address " "*address*, returning a :class:`~Connection`." msgstr "" -#: ../../library/multiprocessing.rst:2466 +#: ../../library/multiprocessing.rst:2472 msgid "" "The type of the connection is determined by *family* argument, but this can " "generally be omitted since it can usually be inferred from the format of " "*address*. (See :ref:`multiprocessing-address-formats`)" msgstr "" -#: ../../library/multiprocessing.rst:2470 -#: ../../library/multiprocessing.rst:2505 +#: ../../library/multiprocessing.rst:2476 +#: ../../library/multiprocessing.rst:2511 msgid "" "If *authkey* is given and not None, it should be a byte string and will be " "used as the secret key for an HMAC-based authentication challenge. No " @@ -2715,26 +2723,26 @@ msgid "" "`multiprocessing-auth-keys`." msgstr "" -#: ../../library/multiprocessing.rst:2478 +#: ../../library/multiprocessing.rst:2484 msgid "" "A wrapper for a bound socket or Windows named pipe which is 'listening' for " "connections." msgstr "" -#: ../../library/multiprocessing.rst:2481 +#: ../../library/multiprocessing.rst:2487 msgid "" "*address* is the address to be used by the bound socket or named pipe of the " "listener object." msgstr "" -#: ../../library/multiprocessing.rst:2486 +#: ../../library/multiprocessing.rst:2492 msgid "" "If an address of '0.0.0.0' is used, the address will not be a connectable " "end point on Windows. If you require a connectable end-point, you should use " "'127.0.0.1'." msgstr "" -#: ../../library/multiprocessing.rst:2490 +#: ../../library/multiprocessing.rst:2496 msgid "" "*family* is the type of socket (or named pipe) to use. This can be one of " "the strings ``'AF_INET'`` (for a TCP socket), ``'AF_UNIX'`` (for a Unix " @@ -2748,49 +2756,49 @@ msgid "" "using :func:`tempfile.mkstemp`." msgstr "" -#: ../../library/multiprocessing.rst:2501 +#: ../../library/multiprocessing.rst:2507 msgid "" "If the listener object uses a socket then *backlog* (1 by default) is passed " "to the :meth:`~socket.socket.listen` method of the socket once it has been " "bound." msgstr "" -#: ../../library/multiprocessing.rst:2513 +#: ../../library/multiprocessing.rst:2519 msgid "" "Accept a connection on the bound socket or named pipe of the listener object " "and return a :class:`~Connection` object. If authentication is attempted and " "fails, then :exc:`~multiprocessing.AuthenticationError` is raised." msgstr "" -#: ../../library/multiprocessing.rst:2520 +#: ../../library/multiprocessing.rst:2526 msgid "" "Close the bound socket or named pipe of the listener object. This is called " "automatically when the listener is garbage collected. However it is " "advisable to call it explicitly." msgstr "" -#: ../../library/multiprocessing.rst:2524 +#: ../../library/multiprocessing.rst:2530 msgid "Listener objects have the following read-only properties:" msgstr "" -#: ../../library/multiprocessing.rst:2528 +#: ../../library/multiprocessing.rst:2534 msgid "The address which is being used by the Listener object." msgstr "" -#: ../../library/multiprocessing.rst:2532 +#: ../../library/multiprocessing.rst:2538 msgid "" "The address from which the last accepted connection came. If this is " "unavailable then it is ``None``." msgstr "" -#: ../../library/multiprocessing.rst:2535 +#: ../../library/multiprocessing.rst:2541 msgid "" "Listener objects now support the context management protocol -- see :ref:" "`typecontextmanager`. :meth:`~contextmanager.__enter__` returns the " "listener object, and :meth:`~contextmanager.__exit__` calls :meth:`close`." msgstr "" -#: ../../library/multiprocessing.rst:2542 +#: ../../library/multiprocessing.rst:2548 msgid "" "Wait till an object in *object_list* is ready. Returns the list of those " "objects in *object_list* which are ready. If *timeout* is a float then the " @@ -2799,32 +2807,32 @@ msgid "" "zero timeout." msgstr "" -#: ../../library/multiprocessing.rst:2548 +#: ../../library/multiprocessing.rst:2554 msgid "" "For both POSIX and Windows, an object can appear in *object_list* if it is" msgstr "" -#: ../../library/multiprocessing.rst:2551 +#: ../../library/multiprocessing.rst:2557 msgid "a readable :class:`~multiprocessing.connection.Connection` object;" msgstr "" -#: ../../library/multiprocessing.rst:2552 +#: ../../library/multiprocessing.rst:2558 msgid "a connected and readable :class:`socket.socket` object; or" msgstr "" -#: ../../library/multiprocessing.rst:2553 +#: ../../library/multiprocessing.rst:2559 msgid "" "the :attr:`~multiprocessing.Process.sentinel` attribute of a :class:" "`~multiprocessing.Process` object." msgstr "" -#: ../../library/multiprocessing.rst:2556 +#: ../../library/multiprocessing.rst:2562 msgid "" "A connection or socket object is ready when there is data available to be " "read from it, or the other end has been closed." msgstr "" -#: ../../library/multiprocessing.rst:2559 +#: ../../library/multiprocessing.rst:2565 msgid "" "**POSIX**: ``wait(object_list, timeout)`` almost equivalent ``select." "select(object_list, [], [], timeout)``. The difference is that, if :func:" @@ -2832,7 +2840,7 @@ msgid "" "an error number of ``EINTR``, whereas :func:`wait` will not." msgstr "" -#: ../../library/multiprocessing.rst:2565 +#: ../../library/multiprocessing.rst:2571 msgid "" "**Windows**: An item in *object_list* must either be an integer handle which " "is waitable (according to the definition used by the documentation of the " @@ -2841,46 +2849,46 @@ msgid "" "that pipe handles and socket handles are **not** waitable handles.)" msgstr "" -#: ../../library/multiprocessing.rst:2575 +#: ../../library/multiprocessing.rst:2581 msgid "**Examples**" msgstr "" -#: ../../library/multiprocessing.rst:2577 +#: ../../library/multiprocessing.rst:2583 msgid "" "The following server code creates a listener which uses ``'secret " "password'`` as an authentication key. It then waits for a connection and " "sends some data to the client::" msgstr "" -#: ../../library/multiprocessing.rst:2596 +#: ../../library/multiprocessing.rst:2602 msgid "" "The following code connects to the server and receives some data from the " "server::" msgstr "" -#: ../../library/multiprocessing.rst:2613 +#: ../../library/multiprocessing.rst:2619 msgid "" "The following code uses :func:`~multiprocessing.connection.wait` to wait for " "messages from multiple processes at once::" msgstr "" -#: ../../library/multiprocessing.rst:2652 +#: ../../library/multiprocessing.rst:2658 msgid "Address Formats" msgstr "" -#: ../../library/multiprocessing.rst:2654 +#: ../../library/multiprocessing.rst:2660 msgid "" "An ``'AF_INET'`` address is a tuple of the form ``(hostname, port)`` where " "*hostname* is a string and *port* is an integer." msgstr "" -#: ../../library/multiprocessing.rst:2657 +#: ../../library/multiprocessing.rst:2663 msgid "" "An ``'AF_UNIX'`` address is a string representing a filename on the " "filesystem." msgstr "" -#: ../../library/multiprocessing.rst:2660 +#: ../../library/multiprocessing.rst:2666 msgid "" "An ``'AF_PIPE'`` address is a string of the form :samp:`r'\\\\\\\\\\\\.\\" "\\pipe\\\\\\\\{PipeName}'`. To use :func:`Client` to connect to a named " @@ -2889,17 +2897,17 @@ msgid "" "instead." msgstr "" -#: ../../library/multiprocessing.rst:2665 +#: ../../library/multiprocessing.rst:2671 msgid "" "Note that any string beginning with two backslashes is assumed by default to " "be an ``'AF_PIPE'`` address rather than an ``'AF_UNIX'`` address." msgstr "" -#: ../../library/multiprocessing.rst:2672 +#: ../../library/multiprocessing.rst:2678 msgid "Authentication keys" msgstr "" -#: ../../library/multiprocessing.rst:2674 +#: ../../library/multiprocessing.rst:2680 msgid "" "When one uses :meth:`Connection.recv `, the data received " "is automatically unpickled. Unfortunately unpickling data from an untrusted " @@ -2907,7 +2915,7 @@ msgid "" "use the :mod:`hmac` module to provide digest authentication." msgstr "" -#: ../../library/multiprocessing.rst:2680 +#: ../../library/multiprocessing.rst:2686 msgid "" "An authentication key is a byte string which can be thought of as a " "password: once a connection is established both ends will demand proof that " @@ -2915,7 +2923,7 @@ msgid "" "using the same key does **not** involve sending the key over the connection.)" msgstr "" -#: ../../library/multiprocessing.rst:2686 +#: ../../library/multiprocessing.rst:2692 msgid "" "If authentication is requested but no authentication key is specified then " "the return value of ``current_process().authkey`` is used (see :class:" @@ -2926,17 +2934,17 @@ msgid "" "setting up connections between themselves." msgstr "" -#: ../../library/multiprocessing.rst:2694 +#: ../../library/multiprocessing.rst:2700 msgid "" "Suitable authentication keys can also be generated by using :func:`os." "urandom`." msgstr "" -#: ../../library/multiprocessing.rst:2698 +#: ../../library/multiprocessing.rst:2704 msgid "Logging" msgstr "" -#: ../../library/multiprocessing.rst:2700 +#: ../../library/multiprocessing.rst:2706 msgid "" "Some support for logging is available. Note, however, that the :mod:" "`logging` package does not use process shared locks so it is possible " @@ -2944,27 +2952,27 @@ msgid "" "mixed up." msgstr "" -#: ../../library/multiprocessing.rst:2707 +#: ../../library/multiprocessing.rst:2713 msgid "" "Returns the logger used by :mod:`multiprocessing`. If necessary, a new one " "will be created." msgstr "" -#: ../../library/multiprocessing.rst:2710 +#: ../../library/multiprocessing.rst:2716 msgid "" "When first created the logger has level :const:`logging.NOTSET` and no " "default handler. Messages sent to this logger will not by default propagate " "to the root logger." msgstr "" -#: ../../library/multiprocessing.rst:2714 +#: ../../library/multiprocessing.rst:2720 msgid "" "Note that on Windows child processes will only inherit the level of the " "parent process's logger -- any other customization of the logger will not be " "inherited." msgstr "" -#: ../../library/multiprocessing.rst:2721 +#: ../../library/multiprocessing.rst:2727 msgid "" "This function performs a call to :func:`get_logger` but in addition to " "returning the logger created by get_logger, it adds a handler which sends " @@ -2973,25 +2981,25 @@ msgid "" "``level`` argument." msgstr "" -#: ../../library/multiprocessing.rst:2727 +#: ../../library/multiprocessing.rst:2733 msgid "Below is an example session with logging turned on::" msgstr "" -#: ../../library/multiprocessing.rst:2742 +#: ../../library/multiprocessing.rst:2748 msgid "For a full table of logging levels, see the :mod:`logging` module." msgstr "" -#: ../../library/multiprocessing.rst:2746 +#: ../../library/multiprocessing.rst:2752 msgid "The :mod:`multiprocessing.dummy` module" msgstr "" -#: ../../library/multiprocessing.rst:2751 +#: ../../library/multiprocessing.rst:2757 msgid "" ":mod:`multiprocessing.dummy` replicates the API of :mod:`multiprocessing` " "but is no more than a wrapper around the :mod:`threading` module." msgstr "" -#: ../../library/multiprocessing.rst:2756 +#: ../../library/multiprocessing.rst:2762 msgid "" "In particular, the ``Pool`` function provided by :mod:`multiprocessing." "dummy` returns an instance of :class:`ThreadPool`, which is a subclass of :" @@ -2999,7 +3007,7 @@ msgid "" "worker threads rather than worker processes." msgstr "" -#: ../../library/multiprocessing.rst:2764 +#: ../../library/multiprocessing.rst:2770 msgid "" "A thread pool object which controls a pool of worker threads to which jobs " "can be submitted. :class:`ThreadPool` instances are fully interface " @@ -3009,18 +3017,18 @@ msgid "" "pool.Pool.terminate` manually." msgstr "" -#: ../../library/multiprocessing.rst:2771 +#: ../../library/multiprocessing.rst:2777 msgid "" "*processes* is the number of worker threads to use. If *processes* is " "``None`` then the number returned by :func:`os.cpu_count` is used." msgstr "" -#: ../../library/multiprocessing.rst:2777 +#: ../../library/multiprocessing.rst:2783 msgid "" "Unlike :class:`Pool`, *maxtasksperchild* and *context* cannot be provided." msgstr "" -#: ../../library/multiprocessing.rst:2781 +#: ../../library/multiprocessing.rst:2787 msgid "" "A :class:`ThreadPool` shares the same interface as :class:`Pool`, which is " "designed around a pool of processes and predates the introduction of the :" @@ -3030,7 +3038,7 @@ msgid "" "is not understood by any other libraries." msgstr "" -#: ../../library/multiprocessing.rst:2788 +#: ../../library/multiprocessing.rst:2794 msgid "" "Users should generally prefer to use :class:`concurrent.futures." "ThreadPoolExecutor`, which has a simpler interface that was designed around " @@ -3039,69 +3047,69 @@ msgid "" "`asyncio`." msgstr "" -#: ../../library/multiprocessing.rst:2798 +#: ../../library/multiprocessing.rst:2804 msgid "Programming guidelines" msgstr "" -#: ../../library/multiprocessing.rst:2800 +#: ../../library/multiprocessing.rst:2806 msgid "" "There are certain guidelines and idioms which should be adhered to when " "using :mod:`multiprocessing`." msgstr "" -#: ../../library/multiprocessing.rst:2805 +#: ../../library/multiprocessing.rst:2811 msgid "All start methods" msgstr "" -#: ../../library/multiprocessing.rst:2807 +#: ../../library/multiprocessing.rst:2813 msgid "The following applies to all start methods." msgstr "" -#: ../../library/multiprocessing.rst:2809 +#: ../../library/multiprocessing.rst:2815 msgid "Avoid shared state" msgstr "" -#: ../../library/multiprocessing.rst:2811 +#: ../../library/multiprocessing.rst:2817 msgid "" "As far as possible one should try to avoid shifting large amounts of data " "between processes." msgstr "" -#: ../../library/multiprocessing.rst:2814 +#: ../../library/multiprocessing.rst:2820 msgid "" "It is probably best to stick to using queues or pipes for communication " "between processes rather than using the lower level synchronization " "primitives." msgstr "" -#: ../../library/multiprocessing.rst:2818 +#: ../../library/multiprocessing.rst:2824 msgid "Picklability" msgstr "" -#: ../../library/multiprocessing.rst:2820 +#: ../../library/multiprocessing.rst:2826 msgid "Ensure that the arguments to the methods of proxies are picklable." msgstr "" -#: ../../library/multiprocessing.rst:2822 +#: ../../library/multiprocessing.rst:2828 msgid "Thread safety of proxies" msgstr "" -#: ../../library/multiprocessing.rst:2824 +#: ../../library/multiprocessing.rst:2830 msgid "" "Do not use a proxy object from more than one thread unless you protect it " "with a lock." msgstr "" -#: ../../library/multiprocessing.rst:2827 +#: ../../library/multiprocessing.rst:2833 msgid "" "(There is never a problem with different processes using the *same* proxy.)" msgstr "" -#: ../../library/multiprocessing.rst:2829 +#: ../../library/multiprocessing.rst:2835 msgid "Joining zombie processes" msgstr "" -#: ../../library/multiprocessing.rst:2831 +#: ../../library/multiprocessing.rst:2837 msgid "" "On POSIX when a process finishes but has not been joined it becomes a " "zombie. There should never be very many because each time a new process " @@ -3112,11 +3120,11 @@ msgid "" "explicitly join all the processes that you start." msgstr "" -#: ../../library/multiprocessing.rst:2839 +#: ../../library/multiprocessing.rst:2845 msgid "Better to inherit than pickle/unpickle" msgstr "" -#: ../../library/multiprocessing.rst:2841 +#: ../../library/multiprocessing.rst:2847 msgid "" "When using the *spawn* or *forkserver* start methods many types from :mod:" "`multiprocessing` need to be picklable so that child processes can use " @@ -3126,11 +3134,11 @@ msgid "" "inherit it from an ancestor process." msgstr "" -#: ../../library/multiprocessing.rst:2849 +#: ../../library/multiprocessing.rst:2855 msgid "Avoid terminating processes" msgstr "" -#: ../../library/multiprocessing.rst:2851 +#: ../../library/multiprocessing.rst:2857 msgid "" "Using the :meth:`Process.terminate ` " "method to stop a process is liable to cause any shared resources (such as " @@ -3138,18 +3146,18 @@ msgid "" "become broken or unavailable to other processes." msgstr "" -#: ../../library/multiprocessing.rst:2857 +#: ../../library/multiprocessing.rst:2863 msgid "" "Therefore it is probably best to only consider using :meth:`Process." "terminate ` on processes which never use " "any shared resources." msgstr "" -#: ../../library/multiprocessing.rst:2861 +#: ../../library/multiprocessing.rst:2867 msgid "Joining processes that use queues" msgstr "" -#: ../../library/multiprocessing.rst:2863 +#: ../../library/multiprocessing.rst:2869 msgid "" "Bear in mind that a process that has put items in a queue will wait before " "terminating until all the buffered items are fed by the \"feeder\" thread to " @@ -3158,7 +3166,7 @@ msgid "" "queue to avoid this behaviour.)" msgstr "" -#: ../../library/multiprocessing.rst:2869 +#: ../../library/multiprocessing.rst:2875 msgid "" "This means that whenever you use a queue you need to make sure that all " "items which have been put on the queue will eventually be removed before the " @@ -3167,21 +3175,21 @@ msgid "" "processes will be joined automatically." msgstr "" -#: ../../library/multiprocessing.rst:2875 +#: ../../library/multiprocessing.rst:2881 msgid "An example which will deadlock is the following::" msgstr "" -#: ../../library/multiprocessing.rst:2889 +#: ../../library/multiprocessing.rst:2895 msgid "" "A fix here would be to swap the last two lines (or simply remove the ``p." "join()`` line)." msgstr "" -#: ../../library/multiprocessing.rst:2892 +#: ../../library/multiprocessing.rst:2898 msgid "Explicitly pass resources to child processes" msgstr "" -#: ../../library/multiprocessing.rst:2894 +#: ../../library/multiprocessing.rst:2900 msgid "" "On POSIX using the *fork* start method, a child process can make use of a " "shared resource created in a parent process using a global resource. " @@ -3189,7 +3197,7 @@ msgid "" "for the child process." msgstr "" -#: ../../library/multiprocessing.rst:2899 +#: ../../library/multiprocessing.rst:2905 msgid "" "Apart from making the code (potentially) compatible with Windows and the " "other start methods this also ensures that as long as the child process is " @@ -3198,29 +3206,29 @@ msgid "" "collected in the parent process." msgstr "" -#: ../../library/multiprocessing.rst:2906 +#: ../../library/multiprocessing.rst:2912 msgid "So for instance ::" msgstr "" -#: ../../library/multiprocessing.rst:2918 +#: ../../library/multiprocessing.rst:2924 msgid "should be rewritten as ::" msgstr "" -#: ../../library/multiprocessing.rst:2930 +#: ../../library/multiprocessing.rst:2936 msgid "Beware of replacing :data:`sys.stdin` with a \"file like object\"" msgstr "" -#: ../../library/multiprocessing.rst:2932 +#: ../../library/multiprocessing.rst:2938 msgid ":mod:`multiprocessing` originally unconditionally called::" msgstr "" -#: ../../library/multiprocessing.rst:2936 +#: ../../library/multiprocessing.rst:2942 msgid "" "in the :meth:`multiprocessing.Process._bootstrap` method --- this resulted " "in issues with processes-in-processes. This has been changed to::" msgstr "" -#: ../../library/multiprocessing.rst:2942 +#: ../../library/multiprocessing.rst:2948 msgid "" "Which solves the fundamental issue of processes colliding with each other " "resulting in a bad file descriptor error, but introduces a potential danger " @@ -3230,33 +3238,33 @@ msgid "" "data being flushed to the object multiple times, resulting in corruption." msgstr "" -#: ../../library/multiprocessing.rst:2949 +#: ../../library/multiprocessing.rst:2955 msgid "" "If you write a file-like object and implement your own caching, you can make " "it fork-safe by storing the pid whenever you append to the cache, and " "discarding the cache when the pid changes. For example::" msgstr "" -#: ../../library/multiprocessing.rst:2961 +#: ../../library/multiprocessing.rst:2967 msgid "" "For more information, see :issue:`5155`, :issue:`5313` and :issue:`5331`" msgstr "" -#: ../../library/multiprocessing.rst:2964 +#: ../../library/multiprocessing.rst:2970 msgid "The *spawn* and *forkserver* start methods" msgstr "" -#: ../../library/multiprocessing.rst:2966 +#: ../../library/multiprocessing.rst:2972 msgid "" "There are a few extra restriction which don't apply to the *fork* start " "method." msgstr "" -#: ../../library/multiprocessing.rst:2969 +#: ../../library/multiprocessing.rst:2975 msgid "More picklability" msgstr "" -#: ../../library/multiprocessing.rst:2971 +#: ../../library/multiprocessing.rst:2977 msgid "" "Ensure that all arguments to :meth:`Process.__init__` are picklable. Also, " "if you subclass :class:`~multiprocessing.Process` then make sure that " @@ -3264,11 +3272,11 @@ msgid "" "Process.start>` method is called." msgstr "" -#: ../../library/multiprocessing.rst:2976 +#: ../../library/multiprocessing.rst:2982 msgid "Global variables" msgstr "" -#: ../../library/multiprocessing.rst:2978 +#: ../../library/multiprocessing.rst:2984 msgid "" "Bear in mind that if code run in a child process tries to access a global " "variable, then the value it sees (if any) may not be the same as the value " @@ -3276,66 +3284,66 @@ msgid "" "Process.start>` was called." msgstr "" -#: ../../library/multiprocessing.rst:2983 +#: ../../library/multiprocessing.rst:2989 msgid "" "However, global variables which are just module level constants cause no " "problems." msgstr "" -#: ../../library/multiprocessing.rst:2988 +#: ../../library/multiprocessing.rst:2994 msgid "Safe importing of main module" msgstr "" -#: ../../library/multiprocessing.rst:2990 +#: ../../library/multiprocessing.rst:2996 msgid "" "Make sure that the main module can be safely imported by a new Python " "interpreter without causing unintended side effects (such as starting a new " "process)." msgstr "" -#: ../../library/multiprocessing.rst:2994 +#: ../../library/multiprocessing.rst:3000 msgid "" "For example, using the *spawn* or *forkserver* start method running the " "following module would fail with a :exc:`RuntimeError`::" msgstr "" -#: ../../library/multiprocessing.rst:3006 +#: ../../library/multiprocessing.rst:3012 msgid "" "Instead one should protect the \"entry point\" of the program by using ``if " "__name__ == '__main__':`` as follows::" msgstr "" -#: ../../library/multiprocessing.rst:3020 +#: ../../library/multiprocessing.rst:3026 msgid "" "(The ``freeze_support()`` line can be omitted if the program will be run " "normally instead of frozen.)" msgstr "" -#: ../../library/multiprocessing.rst:3023 +#: ../../library/multiprocessing.rst:3029 msgid "" "This allows the newly spawned Python interpreter to safely import the module " "and then run the module's ``foo()`` function." msgstr "" -#: ../../library/multiprocessing.rst:3026 +#: ../../library/multiprocessing.rst:3032 msgid "" "Similar restrictions apply if a pool or manager is created in the main " "module." msgstr "" -#: ../../library/multiprocessing.rst:3033 +#: ../../library/multiprocessing.rst:3039 msgid "Examples" msgstr "範例" -#: ../../library/multiprocessing.rst:3035 +#: ../../library/multiprocessing.rst:3041 msgid "Demonstration of how to create and use customized managers and proxies:" msgstr "" -#: ../../library/multiprocessing.rst:3041 +#: ../../library/multiprocessing.rst:3047 msgid "Using :class:`~multiprocessing.pool.Pool`:" msgstr "" -#: ../../library/multiprocessing.rst:3047 +#: ../../library/multiprocessing.rst:3053 msgid "" "An example showing how to use queues to feed tasks to a collection of worker " "processes and collect the results:" diff --git a/library/os.po b/library/os.po index e7c91a433e..2d9cdc7d82 100644 --- a/library/os.po +++ b/library/os.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-29 00:03+0000\n" +"POT-Creation-Date: 2023-10-11 17:13+0000\n" "PO-Revision-Date: 2023-08-30 23:53+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -142,8 +142,8 @@ msgid "" "On some systems, conversion using the file system encoding may fail. In this " "case, Python uses the :ref:`surrogateescape encoding error handler " "`, which means that undecodable bytes are replaced by a " -"Unicode character U+DCxx on decoding, and these are again translated to the " -"original byte on encoding." +"Unicode character U+DC\\ *xx* on decoding, and these are again translated to " +"the original byte on encoding." msgstr "" #: ../../library/os.rst:95 @@ -314,20 +314,19 @@ msgstr "" #: ../../library/os.rst:4108 ../../library/os.rst:4117 #: ../../library/os.rst:4125 ../../library/os.rst:4133 #: ../../library/os.rst:4140 ../../library/os.rst:4147 -#: ../../library/os.rst:4168 ../../library/os.rst:4185 -#: ../../library/os.rst:4225 ../../library/os.rst:4232 -#: ../../library/os.rst:4262 ../../library/os.rst:4389 -#: ../../library/os.rst:4438 ../../library/os.rst:4675 -#: ../../library/os.rst:4709 ../../library/os.rst:4767 -#: ../../library/os.rst:4781 ../../library/os.rst:4798 -#: ../../library/os.rst:4813 ../../library/os.rst:4824 -#: ../../library/os.rst:4836 ../../library/os.rst:4849 -#: ../../library/os.rst:4858 ../../library/os.rst:4868 -#: ../../library/os.rst:4881 ../../library/os.rst:4932 -#: ../../library/os.rst:4943 ../../library/os.rst:4955 -#: ../../library/os.rst:4962 ../../library/os.rst:4971 -#: ../../library/os.rst:4980 ../../library/os.rst:4989 -#: ../../library/os.rst:4998 +#: ../../library/os.rst:4213 ../../library/os.rst:4253 +#: ../../library/os.rst:4260 ../../library/os.rst:4290 +#: ../../library/os.rst:4417 ../../library/os.rst:4466 +#: ../../library/os.rst:4703 ../../library/os.rst:4737 +#: ../../library/os.rst:4795 ../../library/os.rst:4809 +#: ../../library/os.rst:4826 ../../library/os.rst:4841 +#: ../../library/os.rst:4852 ../../library/os.rst:4864 +#: ../../library/os.rst:4877 ../../library/os.rst:4886 +#: ../../library/os.rst:4896 ../../library/os.rst:4909 +#: ../../library/os.rst:4960 ../../library/os.rst:4971 +#: ../../library/os.rst:4983 ../../library/os.rst:4990 +#: ../../library/os.rst:4999 ../../library/os.rst:5008 +#: ../../library/os.rst:5017 ../../library/os.rst:5026 msgid ":ref:`Availability `: Unix, not Emscripten, not WASI." msgstr ":ref:`適用 `:Unix、非 Emscripten、非 WASI。" @@ -487,8 +486,8 @@ msgstr "" #: ../../library/os.rst:1649 ../../library/os.rst:1797 #: ../../library/os.rst:2530 ../../library/os.rst:3375 #: ../../library/os.rst:3412 ../../library/os.rst:4028 -#: ../../library/os.rst:4526 ../../library/os.rst:4537 -#: ../../library/os.rst:4654 +#: ../../library/os.rst:4554 ../../library/os.rst:4565 +#: ../../library/os.rst:4682 msgid ":ref:`Availability `: Unix, Windows." msgstr ":ref:`適用 `:Unix、Windows。" @@ -519,9 +518,9 @@ msgstr "" #: ../../library/os.rst:2165 ../../library/os.rst:2178 #: ../../library/os.rst:2496 ../../library/os.rst:2508 #: ../../library/os.rst:3241 ../../library/os.rst:3398 -#: ../../library/os.rst:3631 ../../library/os.rst:5144 -#: ../../library/os.rst:5153 ../../library/os.rst:5174 -#: ../../library/os.rst:5184 ../../library/os.rst:5193 +#: ../../library/os.rst:3631 ../../library/os.rst:5174 +#: ../../library/os.rst:5183 ../../library/os.rst:5204 +#: ../../library/os.rst:5214 ../../library/os.rst:5223 msgid ":ref:`Availability `: Unix." msgstr ":ref:`適用 `:Unix。" @@ -594,9 +593,9 @@ msgid "" msgstr "" #: ../../library/os.rst:426 ../../library/os.rst:462 ../../library/os.rst:3993 -#: ../../library/os.rst:4209 ../../library/os.rst:4507 -#: ../../library/os.rst:4631 ../../library/os.rst:4747 -#: ../../library/os.rst:4916 +#: ../../library/os.rst:4237 ../../library/os.rst:4535 +#: ../../library/os.rst:4659 ../../library/os.rst:4775 +#: ../../library/os.rst:4944 msgid "" ":ref:`Availability `: Unix, Windows, not Emscripten, not WASI." msgstr ":ref:`適用 `:Unix、Windows、非 Emscripten、非 WASI。" @@ -894,7 +893,7 @@ msgid "" "or even ``socket.gethostbyaddr(socket.gethostname())``." msgstr "" -#: ../../library/os.rst:789 ../../library/os.rst:4656 +#: ../../library/os.rst:789 ../../library/os.rst:4684 msgid "" "Return type changed from a tuple to a tuple-like object with named " "attributes." @@ -1444,7 +1443,7 @@ msgid "The *dir_fd* argument." msgstr "*dir_fd* 引數。" #: ../../library/os.rst:1257 ../../library/os.rst:1576 -#: ../../library/os.rst:1752 ../../library/os.rst:4749 +#: ../../library/os.rst:1752 ../../library/os.rst:4777 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 :" @@ -1465,7 +1464,7 @@ msgstr "" #: ../../library/os.rst:3435 ../../library/os.rst:3475 #: ../../library/os.rst:3574 ../../library/os.rst:3635 #: ../../library/os.rst:3819 ../../library/os.rst:3999 -#: ../../library/os.rst:4514 +#: ../../library/os.rst:4542 msgid "Accepts a :term:`path-like object`." msgstr "" @@ -2008,8 +2007,8 @@ msgid "Get the \"inheritable\" flag of the specified handle (a boolean)." msgstr "" #: ../../library/os.rst:1849 ../../library/os.rst:1855 -#: ../../library/os.rst:3924 ../../library/os.rst:4549 -#: ../../library/os.rst:4594 +#: ../../library/os.rst:3924 ../../library/os.rst:4577 +#: ../../library/os.rst:4622 msgid ":ref:`Availability `: Windows." msgstr ":ref:`適用 `:Windows。" @@ -4542,18 +4541,55 @@ msgid "" "Raises an :ref:`auditing event ` ``os.fork`` with no arguments." msgstr "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``os.fork``。" -#: ../../library/os.rst:4160 +#: ../../library/os.rst:4162 +msgid "" +"If you use TLS sockets in an application calling ``fork()``, see the warning " +"in the :mod:`ssl` documentation." +msgstr "" + +#: ../../library/os.rst:4165 msgid "" "Calling ``fork()`` in a subinterpreter is no longer supported (:exc:" "`RuntimeError` is raised)." msgstr "" -#: ../../library/os.rst:4166 -msgid "See :mod:`ssl` for applications that use the SSL module with fork()." +#: ../../library/os.rst:4169 +msgid "" +"If Python is able to detect that your process has multiple threads, :func:" +"`os.fork` now raises a :exc:`DeprecationWarning`." msgstr "" #: ../../library/os.rst:4173 msgid "" +"We chose to surface this as a warning, when detectable, to better inform " +"developers of a design problem that the POSIX platform specifically notes as " +"not supported. Even in code that *appears* to work, it has never been safe " +"to mix threading with :func:`os.fork` on POSIX platforms. The CPython " +"runtime itself has always made API calls that are not safe for use in the " +"child process when threads existed in the parent (such as ``malloc`` and " +"``free``)." +msgstr "" + +#: ../../library/os.rst:4182 +msgid "" +"Users of macOS or users of libc or malloc implementations other than those " +"typically found in glibc to date are among those already more likely to " +"experience deadlocks running such code." +msgstr "" + +#: ../../library/os.rst:4186 +msgid "" +"See `this discussion on fork being incompatible with threads `_ for technical details of why we're surfacing " +"this longstanding platform compatibility problem to developers." +msgstr "" + +#: ../../library/os.rst:4191 ../../library/os.rst:4433 +msgid ":ref:`Availability `: POSIX, not Emscripten, not WASI." +msgstr ":ref:`適用 `:POSIX、非 Emscripten、非 WASI。" + +#: ../../library/os.rst:4196 +msgid "" "Fork a child process, using a new pseudo-terminal as the child's controlling " "terminal. Return a pair of ``(pid, fd)``, where *pid* is ``0`` in the child, " "the new child's process id in the parent, and *fd* is the file descriptor of " @@ -4561,24 +4597,31 @@ msgid "" "the :mod:`pty` module. If an error occurs :exc:`OSError` is raised." msgstr "" -#: ../../library/os.rst:4179 +#: ../../library/os.rst:4202 msgid "" "Raises an :ref:`auditing event ` ``os.forkpty`` with no arguments." msgstr "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``os.forkpty``。" -#: ../../library/os.rst:4181 +#: ../../library/os.rst:4204 +msgid "" +"If Python is able to detect that your process has multiple threads, this now " +"raises a :exc:`DeprecationWarning`. See the longer explanation on :func:`os." +"fork`." +msgstr "" + +#: ../../library/os.rst:4209 msgid "" "Calling ``forkpty()`` in a subinterpreter is no longer supported (:exc:" "`RuntimeError` is raised)." msgstr "" -#: ../../library/os.rst:4194 +#: ../../library/os.rst:4222 msgid "" "Send signal *sig* to the process *pid*. Constants for the specific signals " "available on the host platform are defined in the :mod:`signal` module." msgstr "" -#: ../../library/os.rst:4197 +#: ../../library/os.rst:4225 msgid "" "Windows: The :const:`signal.CTRL_C_EVENT` and :const:`signal." "CTRL_BREAK_EVENT` signals are special signals which can only be sent to " @@ -4589,11 +4632,11 @@ msgid "" "process handles to be killed." msgstr "" -#: ../../library/os.rst:4205 +#: ../../library/os.rst:4233 msgid "See also :func:`signal.pthread_kill`." msgstr "另請參閱 :func:`signal.pthread_kill`\\ 。" -#: ../../library/os.rst:4207 +#: ../../library/os.rst:4235 msgid "" "Raises an :ref:`auditing event ` ``os.kill`` with arguments " "``pid``, ``sig``." @@ -4601,15 +4644,15 @@ msgstr "" "引發一個附帶引數 ``pid``、``sig`` 的\\ :ref:`稽核事件 ` ``os." "kill``。" -#: ../../library/os.rst:4211 +#: ../../library/os.rst:4239 msgid "Windows support." msgstr "" -#: ../../library/os.rst:4221 +#: ../../library/os.rst:4249 msgid "Send the signal *sig* to the process group *pgid*." msgstr "" -#: ../../library/os.rst:4223 +#: ../../library/os.rst:4251 msgid "" "Raises an :ref:`auditing event ` ``os.killpg`` with arguments " "``pgid``, ``sig``." @@ -4617,27 +4660,27 @@ msgstr "" "引發一個附帶引數 ``pgid``、``sig`` 的\\ :ref:`稽核事件 ` ``os." "killpg``。" -#: ../../library/os.rst:4230 +#: ../../library/os.rst:4258 msgid "" "Add *increment* to the process's \"niceness\". Return the new niceness." msgstr "" -#: ../../library/os.rst:4237 +#: ../../library/os.rst:4265 msgid "" "Return a file descriptor referring to the process *pid* with *flags* set. " "This descriptor can be used to perform process management without races and " "signals." msgstr "" -#: ../../library/os.rst:4241 +#: ../../library/os.rst:4269 msgid "See the :manpage:`pidfd_open(2)` man page for more details." msgstr "更多細節請見 :manpage:`pidfd_open(2)` 手冊頁。" -#: ../../library/os.rst:4243 +#: ../../library/os.rst:4271 msgid ":ref:`Availability `: Linux >= 5.3" msgstr ":ref:`適用 `:Linux 5.3 以上" -#: ../../library/os.rst:4248 +#: ../../library/os.rst:4276 msgid "" "This flag indicates that the file descriptor will be non-blocking. If the " "process referred to by the file descriptor has not yet terminated, then an " @@ -4645,17 +4688,17 @@ msgid "" "immediately return the error :const:`~errno.EAGAIN` rather than blocking." msgstr "" -#: ../../library/os.rst:4253 +#: ../../library/os.rst:4281 msgid ":ref:`Availability `: Linux >= 5.10" msgstr ":ref:`適用 `:Linux 5.10 以上" -#: ../../library/os.rst:4259 +#: ../../library/os.rst:4287 msgid "" "Lock program segments into memory. The value of *op* (defined in ````) determines which segments are locked." msgstr "" -#: ../../library/os.rst:4267 +#: ../../library/os.rst:4295 msgid "" "Open a pipe to or from command *cmd*. The return value is an open file " "object connected to the pipe, which can be read or written depending on " @@ -4665,7 +4708,7 @@ msgid "" "rather than bytes." msgstr "" -#: ../../library/os.rst:4275 +#: ../../library/os.rst:4303 msgid "" "The ``close`` method returns :const:`None` if the subprocess exited " "successfully, or the subprocess's return code if there was an error. On " @@ -4677,60 +4720,60 @@ msgid "" "contains the signed integer return code from the child process." msgstr "" -#: ../../library/os.rst:4285 +#: ../../library/os.rst:4313 msgid "" "On Unix, :func:`waitstatus_to_exitcode` can be used to convert the ``close`` " "method result (exit status) into an exit code if it is not ``None``. On " "Windows, the ``close`` method result is directly the exit code (or ``None``)." msgstr "" -#: ../../library/os.rst:4290 +#: ../../library/os.rst:4318 msgid "" "This is implemented using :class:`subprocess.Popen`; see that class's " "documentation for more powerful ways to manage and communicate with " "subprocesses." msgstr "" -#: ../../library/os.rst:4294 +#: ../../library/os.rst:4322 msgid ":ref:`Availability `: not Emscripten, not WASI." msgstr ":ref:`適用 `:非 Emscripten、非 WASI。" -#: ../../library/os.rst:4297 +#: ../../library/os.rst:4325 msgid "" "The :ref:`Python UTF-8 Mode ` affects encodings used for *cmd* " "and pipe contents." msgstr "" -#: ../../library/os.rst:4300 +#: ../../library/os.rst:4328 msgid "" ":func:`popen` is a simple wrapper around :class:`subprocess.Popen`. Use :" "class:`subprocess.Popen` or :func:`subprocess.run` to control options like " "encodings." msgstr "" -#: ../../library/os.rst:4309 +#: ../../library/os.rst:4337 msgid "Wraps the :c:func:`!posix_spawn` C library API for use from Python." msgstr "" -#: ../../library/os.rst:4311 +#: ../../library/os.rst:4339 msgid "" "Most users should use :func:`subprocess.run` instead of :func:`posix_spawn`." msgstr "" -#: ../../library/os.rst:4313 +#: ../../library/os.rst:4341 msgid "" "The positional-only arguments *path*, *args*, and *env* are similar to :func:" "`execve`." msgstr "" -#: ../../library/os.rst:4316 +#: ../../library/os.rst:4344 msgid "" "The *path* parameter is the path to the executable file. The *path* should " "contain a directory. Use :func:`posix_spawnp` to pass an executable file " "without directory." msgstr "" -#: ../../library/os.rst:4320 +#: ../../library/os.rst:4348 msgid "" "The *file_actions* argument may be a sequence of tuples describing actions " "to take on specific file descriptors in the child process between the C " @@ -4739,31 +4782,31 @@ msgid "" "describing the remaining tuple elements:" msgstr "" -#: ../../library/os.rst:4328 +#: ../../library/os.rst:4356 msgid "(``os.POSIX_SPAWN_OPEN``, *fd*, *path*, *flags*, *mode*)" msgstr "(``os.POSIX_SPAWN_OPEN``, *fd*, *path*, *flags*, *mode*)" -#: ../../library/os.rst:4330 +#: ../../library/os.rst:4358 msgid "Performs ``os.dup2(os.open(path, flags, mode), fd)``." msgstr "" -#: ../../library/os.rst:4334 +#: ../../library/os.rst:4362 msgid "(``os.POSIX_SPAWN_CLOSE``, *fd*)" msgstr "(``os.POSIX_SPAWN_CLOSE``, *fd*)" -#: ../../library/os.rst:4336 +#: ../../library/os.rst:4364 msgid "Performs ``os.close(fd)``." msgstr "" -#: ../../library/os.rst:4340 +#: ../../library/os.rst:4368 msgid "(``os.POSIX_SPAWN_DUP2``, *fd*, *new_fd*)" msgstr "(``os.POSIX_SPAWN_DUP2``, *fd*, *new_fd*)" -#: ../../library/os.rst:4342 +#: ../../library/os.rst:4370 msgid "Performs ``os.dup2(fd, new_fd)``." msgstr "" -#: ../../library/os.rst:4344 +#: ../../library/os.rst:4372 msgid "" "These tuples correspond to the C library :c:func:`!" "posix_spawn_file_actions_addopen`, :c:func:`!" @@ -4772,7 +4815,7 @@ msgid "" "`!posix_spawn` call itself." msgstr "" -#: ../../library/os.rst:4350 +#: ../../library/os.rst:4378 msgid "" "The *setpgroup* argument will set the process group of the child to the " "value specified. If the value specified is 0, the child's process group ID " @@ -4781,7 +4824,7 @@ msgid "" "corresponds to the C library :c:macro:`!POSIX_SPAWN_SETPGROUP` flag." msgstr "" -#: ../../library/os.rst:4356 +#: ../../library/os.rst:4384 msgid "" "If the *resetids* argument is ``True`` it will reset the effective UID and " "GID of the child to the real UID and GID of the parent process. If the " @@ -4792,7 +4835,7 @@ msgid "" "library :c:macro:`!POSIX_SPAWN_RESETIDS` flag." msgstr "" -#: ../../library/os.rst:4364 +#: ../../library/os.rst:4392 msgid "" "If the *setsid* argument is ``True``, it will create a new session ID for " "``posix_spawn``. *setsid* requires :c:macro:`!POSIX_SPAWN_SETSID` or :c:" @@ -4800,7 +4843,7 @@ msgid "" "is raised." msgstr "" -#: ../../library/os.rst:4369 +#: ../../library/os.rst:4397 msgid "" "The *setsigmask* argument will set the signal mask to the signal set " "specified. If the parameter is not used, then the child inherits the " @@ -4808,14 +4851,14 @@ msgid "" "POSIX_SPAWN_SETSIGMASK` flag." msgstr "" -#: ../../library/os.rst:4374 +#: ../../library/os.rst:4402 msgid "" "The *sigdef* argument will reset the disposition of all signals in the set " "specified. This argument corresponds to the C library :c:macro:`!" "POSIX_SPAWN_SETSIGDEF` flag." msgstr "" -#: ../../library/os.rst:4378 +#: ../../library/os.rst:4406 msgid "" "The *scheduler* argument must be a tuple containing the (optional) scheduler " "policy and an instance of :class:`sched_param` with the scheduler " @@ -4825,7 +4868,7 @@ msgid "" "POSIX_SPAWN_SETSCHEDULER` flags." msgstr "" -#: ../../library/os.rst:4385 ../../library/os.rst:4401 +#: ../../library/os.rst:4413 ../../library/os.rst:4429 msgid "" "Raises an :ref:`auditing event ` ``os.posix_spawn`` with arguments " "``path``, ``argv``, ``env``." @@ -4833,76 +4876,72 @@ msgstr "" "引發一個附帶引數 ``path``、``argv``、``env`` 的\\ :ref:`稽核事件 ` " "``os.posix_spawn``。" -#: ../../library/os.rst:4395 +#: ../../library/os.rst:4423 msgid "Wraps the :c:func:`!posix_spawnp` C library API for use from Python." msgstr "" -#: ../../library/os.rst:4397 +#: ../../library/os.rst:4425 msgid "" "Similar to :func:`posix_spawn` except that the system searches for the " "*executable* file in the list of directories specified by the :envvar:`PATH` " "environment variable (in the same way as for ``execvp(3)``)." msgstr "" -#: ../../library/os.rst:4405 -msgid ":ref:`Availability `: POSIX, not Emscripten, not WASI." -msgstr ":ref:`適用 `:POSIX、非 Emscripten、非 WASI。" - -#: ../../library/os.rst:4407 +#: ../../library/os.rst:4435 msgid "See :func:`posix_spawn` documentation." msgstr "" -#: ../../library/os.rst:4413 +#: ../../library/os.rst:4441 msgid "" "Register callables to be executed when a new child process is forked using :" "func:`os.fork` or similar process cloning APIs. The parameters are optional " "and keyword-only. Each specifies a different call point." msgstr "" -#: ../../library/os.rst:4418 +#: ../../library/os.rst:4446 msgid "*before* is a function called before forking a child process." msgstr "" -#: ../../library/os.rst:4419 +#: ../../library/os.rst:4447 msgid "" "*after_in_parent* is a function called from the parent process after forking " "a child process." msgstr "" -#: ../../library/os.rst:4421 +#: ../../library/os.rst:4449 msgid "*after_in_child* is a function called from the child process." msgstr "" -#: ../../library/os.rst:4423 +#: ../../library/os.rst:4451 msgid "" "These calls are only made if control is expected to return to the Python " "interpreter. A typical :mod:`subprocess` launch will not trigger them as " "the child is not going to re-enter the interpreter." msgstr "" -#: ../../library/os.rst:4427 +#: ../../library/os.rst:4455 msgid "" "Functions registered for execution before forking are called in reverse " "registration order. Functions registered for execution after forking " "(either in the parent or in the child) are called in registration order." msgstr "" -#: ../../library/os.rst:4432 +#: ../../library/os.rst:4460 msgid "" "Note that :c:func:`fork` calls made by third-party C code may not call those " "functions, unless it explicitly calls :c:func:`PyOS_BeforeFork`, :c:func:" "`PyOS_AfterFork_Parent` and :c:func:`PyOS_AfterFork_Child`." msgstr "" -#: ../../library/os.rst:4436 +#: ../../library/os.rst:4464 msgid "There is no way to unregister a function." msgstr "" -#: ../../library/os.rst:4452 +#: ../../library/os.rst:4480 msgid "Execute the program *path* in a new process." msgstr "" -#: ../../library/os.rst:4454 +#: ../../library/os.rst:4482 msgid "" "(Note that the :mod:`subprocess` module provides more powerful facilities " "for spawning new processes and retrieving their results; using that module " @@ -4910,7 +4949,7 @@ msgid "" "`subprocess-replacements` section.)" msgstr "" -#: ../../library/os.rst:4459 +#: ../../library/os.rst:4487 msgid "" "If *mode* is :const:`P_NOWAIT`, this function returns the process id of the " "new process; if *mode* is :const:`P_WAIT`, returns the process's exit code " @@ -4919,13 +4958,13 @@ msgid "" "handle, so can be used with the :func:`waitpid` function." msgstr "" -#: ../../library/os.rst:4465 +#: ../../library/os.rst:4493 msgid "" "Note on VxWorks, this function doesn't return ``-signal`` when the new " "process is killed. Instead it raises OSError exception." msgstr "" -#: ../../library/os.rst:4468 +#: ../../library/os.rst:4496 msgid "" "The \"l\" and \"v\" variants of the :func:`spawn\\* ` functions " "differ in how command-line arguments are passed. The \"l\" variants are " @@ -4937,7 +4976,7 @@ msgid "" "to the child process must start with the name of the command being run." msgstr "" -#: ../../library/os.rst:4477 +#: ../../library/os.rst:4505 msgid "" "The variants which include a second \"p\" near the end (:func:`spawnlp`, :" "func:`spawnlpe`, :func:`spawnvp`, and :func:`spawnvpe`) will use the :envvar:" @@ -4950,7 +4989,7 @@ msgid "" "appropriate absolute or relative path." msgstr "" -#: ../../library/os.rst:4487 +#: ../../library/os.rst:4515 msgid "" "For :func:`spawnle`, :func:`spawnlpe`, :func:`spawnve`, and :func:`spawnvpe` " "(note that these all end in \"e\"), the *env* parameter must be a mapping " @@ -4962,13 +5001,13 @@ msgid "" "values will cause the function to fail, with a return value of ``127``." msgstr "" -#: ../../library/os.rst:4496 +#: ../../library/os.rst:4524 msgid "" "As an example, the following calls to :func:`spawnlp` and :func:`spawnvpe` " "are equivalent::" msgstr "" -#: ../../library/os.rst:4505 +#: ../../library/os.rst:4533 msgid "" "Raises an :ref:`auditing event ` ``os.spawn`` with arguments " "``mode``, ``path``, ``args``, ``env``." @@ -4976,7 +5015,7 @@ msgstr "" "引發一個附帶引數 ``mode``、``path``、``args``、``env`` 的\\ :ref:`稽核事件 " "` ``os.spawn``。" -#: ../../library/os.rst:4509 +#: ../../library/os.rst:4537 msgid "" ":func:`spawnlp`, :func:`spawnlpe`, :func:`spawnvp` and :func:`spawnvpe` are " "not available on Windows. :func:`spawnle` and :func:`spawnve` are not " @@ -4984,7 +5023,7 @@ msgid "" "instead." msgstr "" -#: ../../library/os.rst:4521 +#: ../../library/os.rst:4549 msgid "" "Possible values for the *mode* parameter to the :func:`spawn\\* ` " "family of functions. If either of these values is given, the :func:" @@ -4992,7 +5031,7 @@ msgid "" "created, with the process id as the return value." msgstr "" -#: ../../library/os.rst:4531 +#: ../../library/os.rst:4559 msgid "" "Possible value for the *mode* parameter to the :func:`spawn\\* ` " "family of functions. If this is given as *mode*, the :func:`spawn\\*` " @@ -5001,7 +5040,7 @@ msgid "" "signal`` if a signal kills the process." msgstr "" -#: ../../library/os.rst:4543 +#: ../../library/os.rst:4571 msgid "" "Possible values for the *mode* parameter to the :func:`spawn\\* ` " "family of functions. These are less portable than those listed above. :" @@ -5011,11 +5050,11 @@ msgid "" "function will not return." msgstr "" -#: ../../library/os.rst:4554 +#: ../../library/os.rst:4582 msgid "Start a file with its associated application." msgstr "" -#: ../../library/os.rst:4556 +#: ../../library/os.rst:4584 msgid "" "When *operation* is not specified, this acts like double-clicking the file " "in Windows Explorer, or giving the file name as an argument to the :program:" @@ -5023,7 +5062,7 @@ msgid "" "whatever application (if any) its extension is associated." msgstr "" -#: ../../library/os.rst:4561 +#: ../../library/os.rst:4589 msgid "" "When another *operation* is given, it must be a \"command verb\" that " "specifies what should be done with the file. Common verbs documented by " @@ -5031,28 +5070,28 @@ msgid "" "as well as ``'explore'`` and ``'find'`` (to be used on directories)." msgstr "" -#: ../../library/os.rst:4566 +#: ../../library/os.rst:4594 msgid "" "When launching an application, specify *arguments* to be passed as a single " "string. This argument may have no effect when using this function to launch " "a document." msgstr "" -#: ../../library/os.rst:4570 +#: ../../library/os.rst:4598 msgid "" "The default working directory is inherited, but may be overridden by the " "*cwd* argument. This should be an absolute path. A relative *path* will be " "resolved against this argument." msgstr "" -#: ../../library/os.rst:4574 +#: ../../library/os.rst:4602 msgid "" "Use *show_cmd* to override the default window style. Whether this has any " "effect will depend on the application being launched. Values are integers as " "supported by the Win32 :c:func:`!ShellExecute` function." msgstr "" -#: ../../library/os.rst:4578 +#: ../../library/os.rst:4606 msgid "" ":func:`startfile` returns as soon as the associated application is launched. " "There is no option to wait for the application to close, and no way to " @@ -5063,14 +5102,14 @@ msgid "" "encoded for Win32." msgstr "" -#: ../../library/os.rst:4586 +#: ../../library/os.rst:4614 msgid "" "To reduce interpreter startup overhead, the Win32 :c:func:`!ShellExecute` " "function is not resolved until this function is first called. If the " "function cannot be resolved, :exc:`NotImplementedError` will be raised." msgstr "" -#: ../../library/os.rst:4590 +#: ../../library/os.rst:4618 msgid "" "Raises an :ref:`auditing event ` ``os.startfile`` with arguments " "``path``, ``operation``." @@ -5078,7 +5117,7 @@ msgstr "" "引發一個附帶引數 ``path``、``operation`` 的\\ :ref:`稽核事件 ` " "``os.startfile``。" -#: ../../library/os.rst:4592 +#: ../../library/os.rst:4620 msgid "" "Raises an :ref:`auditing event ` ``os.startfile/2`` with arguments " "``path``, ``operation``, ``arguments``, ``cwd``, ``show_cmd``." @@ -5086,13 +5125,13 @@ msgstr "" "引發一個附帶引數 ``path``、``operation``、``arguments``、``cwd``、" "``show_cmd`` 的\\ :ref:`稽核事件 ` ``os.startfile/2``。" -#: ../../library/os.rst:4596 +#: ../../library/os.rst:4624 msgid "" "Added the *arguments*, *cwd* and *show_cmd* arguments, and the ``os." "startfile/2`` audit event." msgstr "" -#: ../../library/os.rst:4603 +#: ../../library/os.rst:4631 msgid "" "Execute the command (a string) in a subshell. This is implemented by " "calling the Standard C function :c:func:`system`, and has the same " @@ -5103,13 +5142,13 @@ msgid "" "value of the Python function is system-dependent." msgstr "" -#: ../../library/os.rst:4611 +#: ../../library/os.rst:4639 msgid "" "On Unix, the return value is the exit status of the process encoded in the " "format specified for :func:`wait`." msgstr "" -#: ../../library/os.rst:4614 +#: ../../library/os.rst:4642 msgid "" "On Windows, the return value is that returned by the system shell after " "running *command*. The shell is given by the Windows environment variable :" @@ -5118,7 +5157,7 @@ msgid "" "shell documentation." msgstr "" -#: ../../library/os.rst:4620 +#: ../../library/os.rst:4648 msgid "" "The :mod:`subprocess` module provides more powerful facilities for spawning " "new processes and retrieving their results; using that module is preferable " @@ -5126,54 +5165,54 @@ msgid "" "the :mod:`subprocess` documentation for some helpful recipes." msgstr "" -#: ../../library/os.rst:4625 +#: ../../library/os.rst:4653 msgid "" "On Unix, :func:`waitstatus_to_exitcode` can be used to convert the result " "(exit status) into an exit code. On Windows, the result is directly the exit " "code." msgstr "" -#: ../../library/os.rst:4629 +#: ../../library/os.rst:4657 msgid "" "Raises an :ref:`auditing event ` ``os.system`` with argument " "``command``." msgstr "" "引發一個附帶引數 ``command`` 的\\ :ref:`稽核事件 ` ``os.system``。" -#: ../../library/os.rst:4636 +#: ../../library/os.rst:4664 msgid "" "Returns the current global process times. The return value is an object with " "five attributes:" msgstr "" -#: ../../library/os.rst:4639 +#: ../../library/os.rst:4667 msgid ":attr:`!user` - user time" msgstr "" -#: ../../library/os.rst:4640 +#: ../../library/os.rst:4668 msgid ":attr:`!system` - system time" msgstr ":attr:`!system` - 系統時間" -#: ../../library/os.rst:4641 +#: ../../library/os.rst:4669 msgid ":attr:`!children_user` - user time of all child processes" msgstr "" -#: ../../library/os.rst:4642 +#: ../../library/os.rst:4670 msgid ":attr:`!children_system` - system time of all child processes" msgstr "" -#: ../../library/os.rst:4643 +#: ../../library/os.rst:4671 msgid ":attr:`!elapsed` - elapsed real time since a fixed point in the past" msgstr "" -#: ../../library/os.rst:4645 +#: ../../library/os.rst:4673 msgid "" "For backwards compatibility, this object also behaves like a five-tuple " "containing :attr:`!user`, :attr:`!system`, :attr:`!children_user`, :attr:`!" "children_system`, and :attr:`!elapsed` in that order." msgstr "" -#: ../../library/os.rst:4649 +#: ../../library/os.rst:4677 msgid "" "See the Unix manual page :manpage:`times(2)` and `times(3) `_ manual page on Unix or `the " @@ -5183,7 +5222,7 @@ msgid "" "attributes are zero." msgstr "" -#: ../../library/os.rst:4663 +#: ../../library/os.rst:4691 msgid "" "Wait for completion of a child process, and return a tuple containing its " "pid and exit status indication: a 16-bit number, whose low byte is the " @@ -5192,83 +5231,83 @@ msgid "" "if a core file was produced." msgstr "" -#: ../../library/os.rst:4669 +#: ../../library/os.rst:4697 msgid "" "If there are no children that could be waited for, :exc:`ChildProcessError` " "is raised." msgstr "" -#: ../../library/os.rst:4672 ../../library/os.rst:4744 +#: ../../library/os.rst:4700 ../../library/os.rst:4772 msgid "" ":func:`waitstatus_to_exitcode` can be used to convert the exit status into " "an exit code." msgstr "" -#: ../../library/os.rst:4679 +#: ../../library/os.rst:4707 msgid "" "The other :func:`!wait*` functions documented below can be used to wait for " "the completion of a specific child process and have more options. :func:" "`waitpid` is the only one also available on Windows." msgstr "" -#: ../../library/os.rst:4686 +#: ../../library/os.rst:4714 msgid "Wait for the completion of a child process." msgstr "" -#: ../../library/os.rst:4688 +#: ../../library/os.rst:4716 msgid "" "*idtype* can be :data:`P_PID`, :data:`P_PGID`, :data:`P_ALL`, or (on Linux) :" "data:`P_PIDFD`. The interpretation of *id* depends on it; see their " "individual descriptions." msgstr "" -#: ../../library/os.rst:4691 +#: ../../library/os.rst:4719 msgid "" "*options* is an OR combination of flags. At least one of :data:`WEXITED`, :" "data:`WSTOPPED` or :data:`WCONTINUED` is required; :data:`WNOHANG` and :data:" "`WNOWAIT` are additional optional flags." msgstr "" -#: ../../library/os.rst:4695 +#: ../../library/os.rst:4723 msgid "" "The return value is an object representing the data contained in the :c:type:" "`siginfo_t` structure with the following attributes:" msgstr "" -#: ../../library/os.rst:4698 +#: ../../library/os.rst:4726 msgid ":attr:`!si_pid` (process ID)" msgstr "" -#: ../../library/os.rst:4699 +#: ../../library/os.rst:4727 msgid ":attr:`!si_uid` (real user ID of the child)" msgstr "" -#: ../../library/os.rst:4700 +#: ../../library/os.rst:4728 msgid ":attr:`!si_signo` (always :const:`~signal.SIGCHLD`)" msgstr "" -#: ../../library/os.rst:4701 +#: ../../library/os.rst:4729 msgid "" ":attr:`!si_status` (the exit status or signal number, depending on :attr:`!" "si_code`)" msgstr "" -#: ../../library/os.rst:4702 +#: ../../library/os.rst:4730 msgid ":attr:`!si_code` (see :data:`CLD_EXITED` for possible values)" msgstr "" -#: ../../library/os.rst:4704 +#: ../../library/os.rst:4732 msgid "" "If :data:`WNOHANG` is specified and there are no matching children in the " "requested state, ``None`` is returned. Otherwise, if there are no matching " "children that could be waited for, :exc:`ChildProcessError` is raised." msgstr "" -#: ../../library/os.rst:4716 +#: ../../library/os.rst:4744 msgid "The details of this function differ on Unix and Windows." msgstr "" -#: ../../library/os.rst:4718 +#: ../../library/os.rst:4746 msgid "" "On Unix: Wait for completion of a child process given by process id *pid*, " "and return a tuple containing its process id and exit status indication " @@ -5277,7 +5316,7 @@ msgid "" "operation." msgstr "" -#: ../../library/os.rst:4723 +#: ../../library/os.rst:4751 msgid "" "If *pid* is greater than ``0``, :func:`waitpid` requests status information " "for that specific process. If *pid* is ``0``, the request is for the status " @@ -5287,7 +5326,7 @@ msgid "" "group ``-pid`` (the absolute value of *pid*)." msgstr "" -#: ../../library/os.rst:4730 +#: ../../library/os.rst:4758 msgid "" "*options* is an OR combination of flags. If it contains :data:`WNOHANG` and " "there are no matching children in the requested state, ``(0, 0)`` is " @@ -5296,7 +5335,7 @@ msgid "" "are :data:`WUNTRACED` and :data:`WCONTINUED`." msgstr "" -#: ../../library/os.rst:4736 +#: ../../library/os.rst:4764 msgid "" "On Windows: Wait for completion of a process given by process handle *pid*, " "and return a tuple containing *pid*, and its exit status shifted left by 8 " @@ -5308,7 +5347,7 @@ msgid "" "process handles." msgstr "" -#: ../../library/os.rst:4757 +#: ../../library/os.rst:4785 msgid "" "Similar to :func:`waitpid`, except no process id argument is given and a 3-" "element tuple containing the child's process id, exit status indication, and " @@ -5317,13 +5356,13 @@ msgid "" "same as that provided to :func:`waitpid` and :func:`wait4`." msgstr "" -#: ../../library/os.rst:4764 ../../library/os.rst:4778 +#: ../../library/os.rst:4792 ../../library/os.rst:4806 msgid "" ":func:`waitstatus_to_exitcode` can be used to convert the exit status into " "an exitcode." msgstr "" -#: ../../library/os.rst:4772 +#: ../../library/os.rst:4800 msgid "" "Similar to :func:`waitpid`, except a 3-element tuple, containing the child's " "process id, exit status indication, and resource usage information is " @@ -5332,118 +5371,118 @@ msgid "" "to :func:`waitpid`." msgstr "" -#: ../../library/os.rst:4789 +#: ../../library/os.rst:4817 msgid "" "These are the possible values for *idtype* in :func:`waitid`. They affect " "how *id* is interpreted:" msgstr "" -#: ../../library/os.rst:4792 +#: ../../library/os.rst:4820 msgid ":data:`!P_PID` - wait for the child whose PID is *id*." msgstr "" -#: ../../library/os.rst:4793 +#: ../../library/os.rst:4821 msgid ":data:`!P_PGID` - wait for any child whose progress group ID is *id*." msgstr "" -#: ../../library/os.rst:4794 +#: ../../library/os.rst:4822 msgid ":data:`!P_ALL` - wait for any child; *id* is ignored." msgstr "" -#: ../../library/os.rst:4795 +#: ../../library/os.rst:4823 msgid "" ":data:`!P_PIDFD` - wait for the child identified by the file descriptor *id* " "(a process file descriptor created with :func:`pidfd_open`)." msgstr "" -#: ../../library/os.rst:4800 +#: ../../library/os.rst:4828 msgid ":data:`!P_PIDFD` is only available on Linux >= 5.4." msgstr "" -#: ../../library/os.rst:4803 +#: ../../library/os.rst:4831 msgid "The :data:`!P_PIDFD` constant." msgstr "" -#: ../../library/os.rst:4809 +#: ../../library/os.rst:4837 msgid "" "This *options* flag for :func:`waitpid`, :func:`wait3`, :func:`wait4`, and :" "func:`waitid` causes child processes to be reported if they have been " "continued from a job control stop since they were last reported." msgstr "" -#: ../../library/os.rst:4818 +#: ../../library/os.rst:4846 msgid "" "This *options* flag for :func:`waitid` causes child processes that have " "terminated to be reported." msgstr "" -#: ../../library/os.rst:4821 +#: ../../library/os.rst:4849 msgid "" "The other ``wait*`` functions always report children that have terminated, " "so this option is not available for them." msgstr "" -#: ../../library/os.rst:4831 +#: ../../library/os.rst:4859 msgid "" "This *options* flag for :func:`waitid` causes child processes that have been " "stopped by the delivery of a signal to be reported." msgstr "" -#: ../../library/os.rst:4834 ../../library/os.rst:4866 +#: ../../library/os.rst:4862 ../../library/os.rst:4894 msgid "This option is not available for the other ``wait*`` functions." msgstr "" -#: ../../library/os.rst:4843 +#: ../../library/os.rst:4871 msgid "" "This *options* flag for :func:`waitpid`, :func:`wait3`, and :func:`wait4` " "causes child processes to also be reported if they have been stopped but " "their current state has not been reported since they were stopped." msgstr "" -#: ../../library/os.rst:4847 +#: ../../library/os.rst:4875 msgid "This option is not available for :func:`waitid`." msgstr "" -#: ../../library/os.rst:4854 +#: ../../library/os.rst:4882 msgid "" "This *options* flag causes :func:`waitpid`, :func:`wait3`, :func:`wait4`, " "and :func:`waitid` to return right away if no child process status is " "available immediately." msgstr "" -#: ../../library/os.rst:4863 +#: ../../library/os.rst:4891 msgid "" "This *options* flag causes :func:`waitid` to leave the child in a waitable " "state, so that a later :func:`!wait*` call can be used to retrieve the child " "status information again." msgstr "" -#: ../../library/os.rst:4878 +#: ../../library/os.rst:4906 msgid "" "These are the possible values for :attr:`!si_code` in the result returned " "by :func:`waitid`." msgstr "" -#: ../../library/os.rst:4885 +#: ../../library/os.rst:4913 msgid "Added :data:`CLD_KILLED` and :data:`CLD_STOPPED` values." msgstr "" -#: ../../library/os.rst:4891 +#: ../../library/os.rst:4919 msgid "Convert a wait status to an exit code." msgstr "" -#: ../../library/os.rst:4893 +#: ../../library/os.rst:4921 msgid "On Unix:" msgstr "" -#: ../../library/os.rst:4895 +#: ../../library/os.rst:4923 msgid "" "If the process exited normally (if ``WIFEXITED(status)`` is true), return " "the process exit status (return ``WEXITSTATUS(status)``): result greater " "than or equal to 0." msgstr "" -#: ../../library/os.rst:4898 +#: ../../library/os.rst:4926 msgid "" "If the process was terminated by a signal (if ``WIFSIGNALED(status)`` is " "true), return ``-signum`` where *signum* is the number of the signal that " @@ -5451,15 +5490,15 @@ msgid "" "than 0." msgstr "" -#: ../../library/os.rst:4902 +#: ../../library/os.rst:4930 msgid "Otherwise, raise a :exc:`ValueError`." msgstr "" -#: ../../library/os.rst:4904 +#: ../../library/os.rst:4932 msgid "On Windows, return *status* shifted right by 8 bits." msgstr "" -#: ../../library/os.rst:4906 +#: ../../library/os.rst:4934 msgid "" "On Unix, if the process is being traced or if :func:`waitpid` was called " "with :data:`WUNTRACED` option, the caller must first check if " @@ -5467,217 +5506,221 @@ msgid "" "``WIFSTOPPED(status)`` is true." msgstr "" -#: ../../library/os.rst:4913 +#: ../../library/os.rst:4941 msgid "" ":func:`WIFEXITED`, :func:`WEXITSTATUS`, :func:`WIFSIGNALED`, :func:" "`WTERMSIG`, :func:`WIFSTOPPED`, :func:`WSTOPSIG` functions." msgstr "" -#: ../../library/os.rst:4921 +#: ../../library/os.rst:4949 msgid "" "The following functions take a process status code as returned by :func:" "`system`, :func:`wait`, or :func:`waitpid` as a parameter. They may be used " "to determine the disposition of a process." msgstr "" -#: ../../library/os.rst:4927 +#: ../../library/os.rst:4955 msgid "" "Return ``True`` if a core dump was generated for the process, otherwise " "return ``False``." msgstr "" -#: ../../library/os.rst:4930 ../../library/os.rst:4996 +#: ../../library/os.rst:4958 ../../library/os.rst:5024 msgid "This function should be employed only if :func:`WIFSIGNALED` is true." msgstr "" -#: ../../library/os.rst:4937 +#: ../../library/os.rst:4965 msgid "" "Return ``True`` if a stopped child has been resumed by delivery of :const:" "`~signal.SIGCONT` (if the process has been continued from a job control " "stop), otherwise return ``False``." msgstr "" -#: ../../library/os.rst:4941 +#: ../../library/os.rst:4969 msgid "See :data:`WCONTINUED` option." msgstr "參閱 :data:`WCONTINUED` 選項。" -#: ../../library/os.rst:4948 +#: ../../library/os.rst:4976 msgid "" "Return ``True`` if the process was stopped by delivery of a signal, " "otherwise return ``False``." msgstr "" -#: ../../library/os.rst:4951 +#: ../../library/os.rst:4979 msgid "" ":func:`WIFSTOPPED` only returns ``True`` if the :func:`waitpid` call was " "done using :data:`WUNTRACED` option or when the process is being traced " "(see :manpage:`ptrace(2)`)." msgstr "" -#: ../../library/os.rst:4959 +#: ../../library/os.rst:4987 msgid "" "Return ``True`` if the process was terminated by a signal, otherwise return " "``False``." msgstr "" -#: ../../library/os.rst:4967 +#: ../../library/os.rst:4995 msgid "" "Return ``True`` if the process exited terminated normally, that is, by " "calling ``exit()`` or ``_exit()``, or by returning from ``main()``; " "otherwise return ``False``." msgstr "" -#: ../../library/os.rst:4976 +#: ../../library/os.rst:5004 msgid "Return the process exit status." msgstr "" -#: ../../library/os.rst:4978 +#: ../../library/os.rst:5006 msgid "This function should be employed only if :func:`WIFEXITED` is true." msgstr "" -#: ../../library/os.rst:4985 +#: ../../library/os.rst:5013 msgid "Return the signal which caused the process to stop." msgstr "" -#: ../../library/os.rst:4987 +#: ../../library/os.rst:5015 msgid "This function should be employed only if :func:`WIFSTOPPED` is true." msgstr "" -#: ../../library/os.rst:4994 +#: ../../library/os.rst:5022 msgid "Return the number of the signal that caused the process to terminate." msgstr "" -#: ../../library/os.rst:5002 +#: ../../library/os.rst:5030 msgid "Interface to the scheduler" msgstr "" -#: ../../library/os.rst:5004 +#: ../../library/os.rst:5032 msgid "" "These functions control how a process is allocated CPU time by the operating " "system. They are only available on some Unix platforms. For more detailed " "information, consult your Unix manpages." msgstr "" -#: ../../library/os.rst:5010 +#: ../../library/os.rst:5038 msgid "" "The following scheduling policies are exposed if they are supported by the " "operating system." msgstr "" -#: ../../library/os.rst:5015 +#: ../../library/os.rst:5043 msgid "The default scheduling policy." msgstr "" -#: ../../library/os.rst:5019 +#: ../../library/os.rst:5047 msgid "" "Scheduling policy for CPU-intensive processes that tries to preserve " "interactivity on the rest of the computer." msgstr "" -#: ../../library/os.rst:5024 +#: ../../library/os.rst:5052 msgid "Scheduling policy for extremely low priority background tasks." msgstr "" -#: ../../library/os.rst:5028 +#: ../../library/os.rst:5056 msgid "Scheduling policy for sporadic server programs." msgstr "" -#: ../../library/os.rst:5032 +#: ../../library/os.rst:5060 msgid "A First In First Out scheduling policy." msgstr "" -#: ../../library/os.rst:5036 +#: ../../library/os.rst:5064 msgid "A round-robin scheduling policy." msgstr "" -#: ../../library/os.rst:5040 +#: ../../library/os.rst:5068 msgid "" "This flag can be OR'ed with any other scheduling policy. When a process with " "this flag set forks, its child's scheduling policy and priority are reset to " "the default." msgstr "" -#: ../../library/os.rst:5047 +#: ../../library/os.rst:5075 msgid "" "This class represents tunable scheduling parameters used in :func:" "`sched_setparam`, :func:`sched_setscheduler`, and :func:`sched_getparam`. It " "is immutable." msgstr "" -#: ../../library/os.rst:5051 +#: ../../library/os.rst:5079 msgid "At the moment, there is only one possible parameter:" msgstr "" -#: ../../library/os.rst:5055 +#: ../../library/os.rst:5083 msgid "The scheduling priority for a scheduling policy." msgstr "" -#: ../../library/os.rst:5060 +#: ../../library/os.rst:5088 msgid "" "Get the minimum priority value for *policy*. *policy* is one of the " "scheduling policy constants above." msgstr "" -#: ../../library/os.rst:5066 +#: ../../library/os.rst:5094 msgid "" "Get the maximum priority value for *policy*. *policy* is one of the " "scheduling policy constants above." msgstr "" -#: ../../library/os.rst:5072 +#: ../../library/os.rst:5100 msgid "" "Set the scheduling policy for the process with PID *pid*. A *pid* of 0 means " "the calling process. *policy* is one of the scheduling policy constants " "above. *param* is a :class:`sched_param` instance." msgstr "" -#: ../../library/os.rst:5079 +#: ../../library/os.rst:5107 msgid "" "Return the scheduling policy for the process with PID *pid*. A *pid* of 0 " "means the calling process. The result is one of the scheduling policy " "constants above." msgstr "" -#: ../../library/os.rst:5086 +#: ../../library/os.rst:5114 msgid "" "Set the scheduling parameters for the process with PID *pid*. A *pid* of 0 " "means the calling process. *param* is a :class:`sched_param` instance." msgstr "" -#: ../../library/os.rst:5092 +#: ../../library/os.rst:5120 msgid "" "Return the scheduling parameters as a :class:`sched_param` instance for the " "process with PID *pid*. A *pid* of 0 means the calling process." msgstr "" -#: ../../library/os.rst:5098 +#: ../../library/os.rst:5126 msgid "" "Return the round-robin quantum in seconds for the process with PID *pid*. A " "*pid* of 0 means the calling process." msgstr "" -#: ../../library/os.rst:5104 +#: ../../library/os.rst:5132 msgid "Voluntarily relinquish the CPU." msgstr "" -#: ../../library/os.rst:5109 +#: ../../library/os.rst:5137 msgid "" "Restrict the process with PID *pid* (or the current process if zero) to a " "set of CPUs. *mask* is an iterable of integers representing the set of CPUs " "to which the process should be restricted." msgstr "" -#: ../../library/os.rst:5116 +#: ../../library/os.rst:5144 +msgid "Return the set of CPUs the process with PID *pid* is restricted to." +msgstr "" + +#: ../../library/os.rst:5146 msgid "" -"Return the set of CPUs the process with PID *pid* (or the current process if " -"zero) is restricted to." +"If *pid* is zero, return the set of CPUs the calling thread of the current " +"process is restricted to." msgstr "" -#: ../../library/os.rst:5123 +#: ../../library/os.rst:5153 msgid "Miscellaneous System Information" msgstr "" -#: ../../library/os.rst:5128 +#: ../../library/os.rst:5158 msgid "" "Return string-valued system configuration values. *name* specifies the " "configuration value to retrieve; it may be a string which is the name of a " @@ -5688,13 +5731,13 @@ msgid "" "included in that mapping, passing an integer for *name* is also accepted." msgstr "" -#: ../../library/os.rst:5136 +#: ../../library/os.rst:5166 msgid "" "If the configuration value specified by *name* isn't defined, ``None`` is " "returned." msgstr "" -#: ../../library/os.rst:5139 +#: ../../library/os.rst:5169 msgid "" "If *name* is a string and is not known, :exc:`ValueError` is raised. If a " "specific value for *name* is not supported by the host system, even if it is " @@ -5702,33 +5745,34 @@ msgid "" "`errno.EINVAL` for the error number." msgstr "" -#: ../../library/os.rst:5149 +#: ../../library/os.rst:5179 msgid "" "Dictionary mapping names accepted by :func:`confstr` to the integer values " "defined for those names by the host operating system. This can be used to " "determine the set of names known to the system." msgstr "" -#: ../../library/os.rst:5158 +#: ../../library/os.rst:5188 msgid "" -"Return the number of CPUs in the system. Returns ``None`` if undetermined." +"Return the number of logical CPUs in the system. Returns ``None`` if " +"undetermined." msgstr "" -#: ../../library/os.rst:5160 +#: ../../library/os.rst:5191 msgid "" -"This number is not equivalent to the number of CPUs the current process can " -"use. The number of usable CPUs can be obtained with ``len(os." -"sched_getaffinity(0))``" +"This number is not equivalent to the number of logical CPUs the current " +"process can use. ``len(os.sched_getaffinity(0))`` gets the number of logical " +"CPUs the calling thread of the current process is restricted to" msgstr "" -#: ../../library/os.rst:5170 +#: ../../library/os.rst:5200 msgid "" "Return the number of processes in the system run queue averaged over the " "last 1, 5, and 15 minutes or raises :exc:`OSError` if the load average was " "unobtainable." msgstr "" -#: ../../library/os.rst:5179 +#: ../../library/os.rst:5209 msgid "" "Return integer-valued system configuration values. If the configuration " "value specified by *name* isn't defined, ``-1`` is returned. The comments " @@ -5737,44 +5781,44 @@ msgid "" "``sysconf_names``." msgstr "" -#: ../../library/os.rst:5189 +#: ../../library/os.rst:5219 msgid "" "Dictionary mapping names accepted by :func:`sysconf` to the integer values " "defined for those names by the host operating system. This can be used to " "determine the set of names known to the system." msgstr "" -#: ../../library/os.rst:5195 +#: ../../library/os.rst:5225 msgid "Add ``'SC_MINSIGSTKSZ'`` name." msgstr "" -#: ../../library/os.rst:5198 +#: ../../library/os.rst:5228 msgid "" "The following data values are used to support path manipulation operations. " "These are defined for all platforms." msgstr "" -#: ../../library/os.rst:5201 +#: ../../library/os.rst:5231 msgid "" "Higher-level operations on pathnames are defined in the :mod:`os.path` " "module." msgstr "" -#: ../../library/os.rst:5207 +#: ../../library/os.rst:5237 msgid "" "The constant string used by the operating system to refer to the current " "directory. This is ``'.'`` for Windows and POSIX. Also available via :mod:" "`os.path`." msgstr "" -#: ../../library/os.rst:5215 +#: ../../library/os.rst:5245 msgid "" "The constant string used by the operating system to refer to the parent " "directory. This is ``'..'`` for Windows and POSIX. Also available via :mod:" "`os.path`." msgstr "" -#: ../../library/os.rst:5224 +#: ../../library/os.rst:5254 msgid "" "The character used by the operating system to separate pathname components. " "This is ``'/'`` for POSIX and ``'\\\\'`` for Windows. Note that knowing " @@ -5783,7 +5827,7 @@ msgid "" "useful. Also available via :mod:`os.path`." msgstr "" -#: ../../library/os.rst:5234 +#: ../../library/os.rst:5264 msgid "" "An alternative character used by the operating system to separate pathname " "components, or ``None`` if only one separator character exists. This is set " @@ -5791,27 +5835,27 @@ msgid "" "via :mod:`os.path`." msgstr "" -#: ../../library/os.rst:5243 +#: ../../library/os.rst:5273 msgid "" "The character which separates the base filename from the extension; for " "example, the ``'.'`` in :file:`os.py`. Also available via :mod:`os.path`." msgstr "" -#: ../../library/os.rst:5251 +#: ../../library/os.rst:5281 msgid "" "The character conventionally used by the operating system to separate search " "path components (as in :envvar:`PATH`), such as ``':'`` for POSIX or ``';'`` " "for Windows. Also available via :mod:`os.path`." msgstr "" -#: ../../library/os.rst:5258 +#: ../../library/os.rst:5288 msgid "" "The default search path used by :func:`exec\\*p\\* ` and :func:" "`spawn\\*p\\* ` if the environment doesn't have a ``'PATH'`` key. " "Also available via :mod:`os.path`." msgstr "" -#: ../../library/os.rst:5265 +#: ../../library/os.rst:5295 msgid "" "The string used to separate (or, rather, terminate) lines on the current " "platform. This may be a single character, such as ``'\\n'`` for POSIX, or " @@ -5820,36 +5864,36 @@ msgid "" "default); use a single ``'\\n'`` instead, on all platforms." msgstr "" -#: ../../library/os.rst:5274 +#: ../../library/os.rst:5304 msgid "" "The file path of the null device. For example: ``'/dev/null'`` for POSIX, " "``'nul'`` for Windows. Also available via :mod:`os.path`." msgstr "" -#: ../../library/os.rst:5285 +#: ../../library/os.rst:5315 msgid "" "Flags for use with the :func:`~sys.setdlopenflags` and :func:`~sys." "getdlopenflags` functions. See the Unix manual page :manpage:`dlopen(3)` " "for what the different flags mean." msgstr "" -#: ../../library/os.rst:5293 +#: ../../library/os.rst:5323 msgid "Random numbers" msgstr "" -#: ../../library/os.rst:5298 +#: ../../library/os.rst:5328 msgid "" "Get up to *size* random bytes. The function can return less bytes than " "requested." msgstr "" -#: ../../library/os.rst:5301 +#: ../../library/os.rst:5331 msgid "" "These bytes can be used to seed user-space random number generators or for " "cryptographic purposes." msgstr "" -#: ../../library/os.rst:5304 +#: ../../library/os.rst:5334 msgid "" "``getrandom()`` relies on entropy gathered from device drivers and other " "sources of environmental noise. Unnecessarily reading large quantities of " @@ -5857,36 +5901,36 @@ msgid "" "``/dev/urandom`` devices." msgstr "" -#: ../../library/os.rst:5309 +#: ../../library/os.rst:5339 msgid "" "The flags argument is a bit mask that can contain zero or more of the " "following values ORed together: :py:const:`os.GRND_RANDOM` and :py:data:" "`GRND_NONBLOCK`." msgstr "" -#: ../../library/os.rst:5313 +#: ../../library/os.rst:5343 msgid "" "See also the `Linux getrandom() manual page `_." msgstr "" -#: ../../library/os.rst:5316 +#: ../../library/os.rst:5346 msgid ":ref:`Availability `: Linux >= 3.17." msgstr ":ref:`適用 `:Linux 3.17 以上。" -#: ../../library/os.rst:5322 +#: ../../library/os.rst:5352 msgid "" "Return a bytestring of *size* random bytes suitable for cryptographic use." msgstr "" -#: ../../library/os.rst:5324 +#: ../../library/os.rst:5354 msgid "" "This function returns random bytes from an OS-specific randomness source. " "The returned data should be unpredictable enough for cryptographic " "applications, though its exact quality depends on the OS implementation." msgstr "" -#: ../../library/os.rst:5328 +#: ../../library/os.rst:5358 msgid "" "On Linux, if the ``getrandom()`` syscall is available, it is used in " "blocking mode: block until the system urandom entropy pool is initialized " @@ -5896,63 +5940,63 @@ msgid "" "to poll until the system urandom entropy pool is initialized." msgstr "" -#: ../../library/os.rst:5335 +#: ../../library/os.rst:5365 msgid "" "On a Unix-like system, random bytes are read from the ``/dev/urandom`` " "device. If the ``/dev/urandom`` device is not available or not readable, " "the :exc:`NotImplementedError` exception is raised." msgstr "" -#: ../../library/os.rst:5339 +#: ../../library/os.rst:5369 msgid "On Windows, it will use ``BCryptGenRandom()``." msgstr "" -#: ../../library/os.rst:5342 +#: ../../library/os.rst:5372 msgid "" "The :mod:`secrets` module provides higher level functions. For an easy-to-" "use interface to the random number generator provided by your platform, " "please see :class:`random.SystemRandom`." msgstr "" -#: ../../library/os.rst:5346 +#: ../../library/os.rst:5376 msgid "" "On Linux, ``getrandom()`` is now used in blocking mode to increase the " "security." msgstr "" -#: ../../library/os.rst:5350 +#: ../../library/os.rst:5380 msgid "" "On Linux, if the ``getrandom()`` syscall blocks (the urandom entropy pool is " "not initialized yet), fall back on reading ``/dev/urandom``." msgstr "" -#: ../../library/os.rst:5354 +#: ../../library/os.rst:5384 msgid "" "On Linux 3.17 and newer, the ``getrandom()`` syscall is now used when " "available. On OpenBSD 5.6 and newer, the C ``getentropy()`` function is now " "used. These functions avoid the usage of an internal file descriptor." msgstr "" -#: ../../library/os.rst:5360 +#: ../../library/os.rst:5390 msgid "" "On Windows, ``BCryptGenRandom()`` is used instead of ``CryptGenRandom()`` " "which is deprecated." msgstr "" -#: ../../library/os.rst:5366 +#: ../../library/os.rst:5396 msgid "" "By default, when reading from ``/dev/random``, :func:`getrandom` blocks if " "no random bytes are available, and when reading from ``/dev/urandom``, it " "blocks if the entropy pool has not yet been initialized." msgstr "" -#: ../../library/os.rst:5370 +#: ../../library/os.rst:5400 msgid "" "If the :py:data:`GRND_NONBLOCK` flag is set, then :func:`getrandom` does not " "block in these cases, but instead immediately raises :exc:`BlockingIOError`." msgstr "" -#: ../../library/os.rst:5377 +#: ../../library/os.rst:5407 msgid "" "If this bit is set, then random bytes are drawn from the ``/dev/" "random`` pool instead of the ``/dev/urandom`` pool." @@ -5968,7 +6012,7 @@ msgstr "" #: ../../library/os.rst:372 ../../library/os.rst:438 ../../library/os.rst:447 #: ../../library/os.rst:456 ../../library/os.rst:470 ../../library/os.rst:666 -#: ../../library/os.rst:4190 ../../library/os.rst:4217 +#: ../../library/os.rst:4218 ../../library/os.rst:4245 msgid "process" msgstr "process" @@ -6054,48 +6098,48 @@ msgstr "" msgid "traversal" msgstr "traversal(遍歷)" -#: ../../library/os.rst:4190 ../../library/os.rst:4217 +#: ../../library/os.rst:4218 ../../library/os.rst:4245 msgid "killing" msgstr "" -#: ../../library/os.rst:4190 ../../library/os.rst:4217 +#: ../../library/os.rst:4218 ../../library/os.rst:4245 msgid "signalling" msgstr "signalling(信號)" -#: ../../library/os.rst:5204 ../../library/os.rst:5240 +#: ../../library/os.rst:5234 ../../library/os.rst:5270 msgid ". (dot)" msgstr ". (點)" -#: ../../library/os.rst:5204 ../../library/os.rst:5212 -#: ../../library/os.rst:5220 ../../library/os.rst:5231 -#: ../../library/os.rst:5240 +#: ../../library/os.rst:5234 ../../library/os.rst:5242 +#: ../../library/os.rst:5250 ../../library/os.rst:5261 +#: ../../library/os.rst:5270 msgid "in pathnames" msgstr "於 pathnames(路徑名稱)中" -#: ../../library/os.rst:5212 +#: ../../library/os.rst:5242 msgid ".." msgstr ".." -#: ../../library/os.rst:5220 ../../library/os.rst:5231 +#: ../../library/os.rst:5250 ../../library/os.rst:5261 msgid "/ (slash)" msgstr "/ (斜線)" -#: ../../library/os.rst:5221 +#: ../../library/os.rst:5251 msgid "\\ (backslash)" msgstr "\\ (反斜線)" -#: ../../library/os.rst:5221 +#: ../../library/os.rst:5251 msgid "in pathnames (Windows)" msgstr "in pathnames (Windows)(在路徑名稱中 (Windows))" -#: ../../library/os.rst:5247 +#: ../../library/os.rst:5277 msgid ": (colon)" msgstr ": (冒號)" -#: ../../library/os.rst:5247 +#: ../../library/os.rst:5277 msgid "path separator (POSIX)" msgstr "path separator (POSIX)(路徑分隔器 (POSIX))" -#: ../../library/os.rst:5247 +#: ../../library/os.rst:5277 msgid "; (semicolon)" msgstr "; (分號)" diff --git a/library/pickletools.po b/library/pickletools.po index a767c0487e..8281a8533b 100644 --- a/library/pickletools.po +++ b/library/pickletools.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-06-26 18:54+0800\n" +"POT-Creation-Date: 2023-10-12 00:03+0000\n" "PO-Revision-Date: 2018-05-23 16:07+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -36,11 +36,11 @@ msgid "" "the :mod:`pickletools` module relevant." msgstr "" -#: ../../library/pickletools.rst:21 +#: ../../library/pickletools.rst:23 msgid "Command line usage" -msgstr "" +msgstr "命令列用法" -#: ../../library/pickletools.rst:25 +#: ../../library/pickletools.rst:27 msgid "" "When invoked from the command line, ``python -m pickletools`` will " "disassemble the contents of one or more pickle files. Note that if you want " @@ -50,42 +50,42 @@ msgid "" "pickletools`` is a safer option because it does not execute pickle bytecode." msgstr "" -#: ../../library/pickletools.rst:33 +#: ../../library/pickletools.rst:35 msgid "For example, with a tuple ``(1, 2)`` pickled in file ``x.pickle``:" msgstr "" -#: ../../library/pickletools.rst:50 +#: ../../library/pickletools.rst:52 msgid "Command line options" -msgstr "" +msgstr "命令列選項" -#: ../../library/pickletools.rst:56 +#: ../../library/pickletools.rst:58 msgid "Annotate each line with a short opcode description." msgstr "" -#: ../../library/pickletools.rst:60 +#: ../../library/pickletools.rst:62 msgid "Name of a file where the output should be written." msgstr "" -#: ../../library/pickletools.rst:64 +#: ../../library/pickletools.rst:66 msgid "The number of blanks by which to indent a new MARK level." msgstr "" -#: ../../library/pickletools.rst:68 +#: ../../library/pickletools.rst:70 msgid "" "When multiple objects are disassembled, preserve memo between disassemblies." msgstr "" -#: ../../library/pickletools.rst:73 +#: ../../library/pickletools.rst:75 msgid "" "When more than one pickle file are specified, print given preamble before " "each disassembly." msgstr "" -#: ../../library/pickletools.rst:79 +#: ../../library/pickletools.rst:81 msgid "Programmatic Interface" msgstr "" -#: ../../library/pickletools.rst:84 +#: ../../library/pickletools.rst:86 msgid "" "Outputs a symbolic disassembly of the pickle to the file-like object *out*, " "defaulting to ``sys.stdout``. *pickle* can be a string or a file-like " @@ -98,11 +98,11 @@ msgid "" "where annotation should start." msgstr "" -#: ../../library/pickletools.rst:95 +#: ../../library/pickletools.rst:97 msgid "The *annotate* argument." msgstr "*annotate* 引數。" -#: ../../library/pickletools.rst:100 +#: ../../library/pickletools.rst:102 msgid "" "Provides an :term:`iterator` over all of the opcodes in a pickle, returning " "a sequence of ``(opcode, arg, pos)`` triples. *opcode* is an instance of " @@ -111,7 +111,7 @@ msgid "" "is located. *pickle* can be a string or a file-like object." msgstr "" -#: ../../library/pickletools.rst:108 +#: ../../library/pickletools.rst:110 msgid "" "Returns a new equivalent pickle string after eliminating unused ``PUT`` " "opcodes. The optimized pickle is shorter, takes less transmission time, " diff --git a/library/profile.po b/library/profile.po index 220591bbab..16a0def997 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-05-09 00:15+0000\n" +"POT-Creation-Date: 2023-10-12 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-" @@ -175,42 +175,42 @@ msgid "" "formats them in various ways." msgstr "" -#: ../../library/profile.rst:124 +#: ../../library/profile.rst:126 msgid "" "The files :mod:`cProfile` and :mod:`profile` can also be invoked as a script " "to profile another script. For example::" msgstr "" -#: ../../library/profile.rst:129 +#: ../../library/profile.rst:131 msgid "``-o`` writes the profile results to a file instead of to stdout" msgstr "" -#: ../../library/profile.rst:131 +#: ../../library/profile.rst:133 msgid "" "``-s`` specifies one of the :func:`~pstats.Stats.sort_stats` sort values to " "sort the output by. This only applies when ``-o`` is not supplied." msgstr "" -#: ../../library/profile.rst:134 +#: ../../library/profile.rst:136 msgid "``-m`` specifies that a module is being profiled instead of a script." msgstr "" -#: ../../library/profile.rst:136 +#: ../../library/profile.rst:138 msgid "Added the ``-m`` option to :mod:`cProfile`." msgstr "新增 ``-m`` 選項到 :mod:`cProfile`。" -#: ../../library/profile.rst:139 +#: ../../library/profile.rst:141 msgid "Added the ``-m`` option to :mod:`profile`." msgstr "新增 ``-m`` 選項到 :mod:`profile`。" -#: ../../library/profile.rst:142 +#: ../../library/profile.rst:144 msgid "" "The :mod:`pstats` module's :class:`~pstats.Stats` class has a variety of " "methods for manipulating and printing the data saved into a profile results " "file::" msgstr "" -#: ../../library/profile.rst:150 +#: ../../library/profile.rst:152 msgid "" "The :meth:`~pstats.Stats.strip_dirs` method removed the extraneous path from " "all the module names. The :meth:`~pstats.Stats.sort_stats` method sorted all " @@ -219,44 +219,44 @@ msgid "" "statistics. You might try the following sort calls::" msgstr "" -#: ../../library/profile.rst:159 +#: ../../library/profile.rst:161 msgid "" "The first call will actually sort the list by function name, and the second " "call will print out the statistics. The following are some interesting " "calls to experiment with::" msgstr "" -#: ../../library/profile.rst:165 +#: ../../library/profile.rst:167 msgid "" "This sorts the profile by cumulative time in a function, and then only " "prints the ten most significant lines. If you want to understand what " "algorithms are taking time, the above line is what you would use." msgstr "" -#: ../../library/profile.rst:169 +#: ../../library/profile.rst:171 msgid "" "If you were looking to see what functions were looping a lot, and taking a " "lot of time, you would do::" msgstr "" -#: ../../library/profile.rst:174 +#: ../../library/profile.rst:176 msgid "" "to sort according to time spent within each function, and then print the " "statistics for the top ten functions." msgstr "" -#: ../../library/profile.rst:177 +#: ../../library/profile.rst:179 msgid "You might also try::" msgstr "" -#: ../../library/profile.rst:181 +#: ../../library/profile.rst:183 msgid "" "This will sort all the statistics by file name, and then print out " "statistics for only the class init methods (since they are spelled with " "``__init__`` in them). As one final example, you could try::" msgstr "" -#: ../../library/profile.rst:187 +#: ../../library/profile.rst:189 msgid "" "This line sorts statistics with a primary key of time, and a secondary key " "of cumulative time, and then prints out some of the statistics. To be " @@ -265,46 +265,46 @@ msgid "" "list is printed." msgstr "" -#: ../../library/profile.rst:192 +#: ../../library/profile.rst:194 msgid "" "If you wondered what functions called the above functions, you could now " "(``p`` is still sorted according to the last criteria) do::" msgstr "" -#: ../../library/profile.rst:197 +#: ../../library/profile.rst:199 msgid "and you would get a list of callers for each of the listed functions." msgstr "" -#: ../../library/profile.rst:199 +#: ../../library/profile.rst:201 msgid "" "If you want more functionality, you're going to have to read the manual, or " "guess what the following functions do::" msgstr "" -#: ../../library/profile.rst:205 +#: ../../library/profile.rst:207 msgid "" "Invoked as a script, the :mod:`pstats` module is a statistics browser for " "reading and examining profile dumps. It has a simple line-oriented " "interface (implemented using :mod:`cmd`) and interactive help." msgstr "" -#: ../../library/profile.rst:210 +#: ../../library/profile.rst:212 msgid ":mod:`profile` and :mod:`cProfile` Module Reference" msgstr "" -#: ../../library/profile.rst:216 +#: ../../library/profile.rst:218 msgid "" "Both the :mod:`profile` and :mod:`cProfile` modules provide the following " "functions:" msgstr "" -#: ../../library/profile.rst:221 +#: ../../library/profile.rst:223 msgid "" "This function takes a single argument that can be passed to the :func:`exec` " "function, and an optional file name. In all cases this routine executes::" msgstr "" -#: ../../library/profile.rst:226 +#: ../../library/profile.rst:228 msgid "" "and gathers profiling statistics from the execution. If no file name is " "present, then this function automatically creates a :class:`~pstats.Stats` " @@ -313,24 +313,24 @@ msgid "" "how the results are sorted." msgstr "" -#: ../../library/profile.rst:234 +#: ../../library/profile.rst:236 msgid "" "This function is similar to :func:`run`, with added arguments to supply the " "globals and locals dictionaries for the *command* string. This routine " "executes::" msgstr "" -#: ../../library/profile.rst:240 +#: ../../library/profile.rst:242 msgid "and gathers profiling statistics as in the :func:`run` function above." msgstr "" -#: ../../library/profile.rst:244 +#: ../../library/profile.rst:246 msgid "" "This class is normally only used if more precise control over profiling is " "needed than what the :func:`cProfile.run` function provides." msgstr "" -#: ../../library/profile.rst:247 +#: ../../library/profile.rst:249 msgid "" "A custom timer can be supplied for measuring how long code takes to run via " "the *timer* argument. This must be a function that returns a single number " @@ -340,61 +340,61 @@ msgid "" "time unit would be ``.001``." msgstr "" -#: ../../library/profile.rst:254 +#: ../../library/profile.rst:256 msgid "" "Directly using the :class:`Profile` class allows formatting profile results " "without writing the profile data to a file::" msgstr "" -#: ../../library/profile.rst:269 +#: ../../library/profile.rst:271 msgid "" "The :class:`Profile` class can also be used as a context manager (supported " "only in :mod:`cProfile` module. see :ref:`typecontextmanager`)::" msgstr "" -#: ../../library/profile.rst:279 +#: ../../library/profile.rst:281 msgid "Added context manager support." msgstr "新增情境管理器的支援。" -#: ../../library/profile.rst:284 +#: ../../library/profile.rst:286 msgid "Start collecting profiling data. Only in :mod:`cProfile`." msgstr "" -#: ../../library/profile.rst:288 +#: ../../library/profile.rst:290 msgid "Stop collecting profiling data. Only in :mod:`cProfile`." msgstr "" -#: ../../library/profile.rst:292 +#: ../../library/profile.rst:294 msgid "" "Stop collecting profiling data and record the results internally as the " "current profile." msgstr "" -#: ../../library/profile.rst:297 +#: ../../library/profile.rst:299 msgid "" "Create a :class:`~pstats.Stats` object based on the current profile and " "print the results to stdout." msgstr "" -#: ../../library/profile.rst:302 +#: ../../library/profile.rst:304 msgid "Write the results of the current profile to *filename*." msgstr "" -#: ../../library/profile.rst:306 +#: ../../library/profile.rst:308 msgid "Profile the cmd via :func:`exec`." msgstr "" -#: ../../library/profile.rst:310 +#: ../../library/profile.rst:312 msgid "" "Profile the cmd via :func:`exec` with the specified global and local " "environment." msgstr "" -#: ../../library/profile.rst:315 +#: ../../library/profile.rst:317 msgid "Profile ``func(*args, **kwargs)``" msgstr "" -#: ../../library/profile.rst:317 +#: ../../library/profile.rst:319 msgid "" "Note that profiling will only work if the called command/function actually " "returns. If the interpreter is terminated (e.g. via a :func:`sys.exit` call " @@ -402,23 +402,23 @@ msgid "" "printed." msgstr "" -#: ../../library/profile.rst:325 +#: ../../library/profile.rst:327 msgid "The :class:`Stats` Class" msgstr "" -#: ../../library/profile.rst:327 +#: ../../library/profile.rst:329 msgid "" "Analysis of the profiler data is done using the :class:`~pstats.Stats` class." msgstr "" -#: ../../library/profile.rst:334 +#: ../../library/profile.rst:336 msgid "" "This class constructor creates an instance of a \"statistics object\" from a " "*filename* (or list of filenames) or from a :class:`Profile` instance. " "Output will be printed to the stream specified by *stream*." msgstr "" -#: ../../library/profile.rst:338 +#: ../../library/profile.rst:340 msgid "" "The file selected by the above constructor must have been created by the " "corresponding version of :mod:`profile` or :mod:`cProfile`. To be specific, " @@ -432,17 +432,17 @@ msgid "" "can be used." msgstr "" -#: ../../library/profile.rst:349 +#: ../../library/profile.rst:351 msgid "" "Instead of reading the profile data from a file, a :class:`cProfile.Profile` " "or :class:`profile.Profile` object can be used as the profile data source." msgstr "" -#: ../../library/profile.rst:352 +#: ../../library/profile.rst:354 msgid ":class:`Stats` objects have the following methods:" msgstr "" -#: ../../library/profile.rst:356 +#: ../../library/profile.rst:358 msgid "" "This method for the :class:`Stats` class removes all leading path " "information from file names. It is very useful in reducing the size of the " @@ -456,7 +456,7 @@ msgid "" "single entry." msgstr "" -#: ../../library/profile.rst:370 +#: ../../library/profile.rst:372 msgid "" "This method of the :class:`Stats` class accumulates additional profiling " "information into the current profiling object. Its arguments should refer " @@ -465,7 +465,7 @@ msgid "" "functions are automatically accumulated into single function statistics." msgstr "" -#: ../../library/profile.rst:380 +#: ../../library/profile.rst:382 msgid "" "Save the data loaded into the :class:`Stats` object to a file named " "*filename*. The file is created if it does not exist, and is overwritten if " @@ -473,7 +473,7 @@ msgid "" "the :class:`profile.Profile` and :class:`cProfile.Profile` classes." msgstr "" -#: ../../library/profile.rst:388 +#: ../../library/profile.rst:390 msgid "" "This method modifies the :class:`Stats` object by sorting it according to " "the supplied criteria. The argument can be either a string or a SortKey " @@ -483,7 +483,7 @@ msgid "" "prone." msgstr "" -#: ../../library/profile.rst:395 +#: ../../library/profile.rst:397 msgid "" "When more than one key is provided, then additional keys are used as " "secondary criteria when there is equality in all keys selected before them. " @@ -492,164 +492,164 @@ msgid "" "function names) by sorting by file name." msgstr "" -#: ../../library/profile.rst:401 +#: ../../library/profile.rst:403 msgid "" "For the string argument, abbreviations can be used for any key names, as " "long as the abbreviation is unambiguous." msgstr "" -#: ../../library/profile.rst:404 +#: ../../library/profile.rst:406 msgid "The following are the valid string and SortKey:" msgstr "" -#: ../../library/profile.rst:407 +#: ../../library/profile.rst:409 msgid "Valid String Arg" msgstr "" -#: ../../library/profile.rst:407 +#: ../../library/profile.rst:409 msgid "Valid enum Arg" msgstr "" -#: ../../library/profile.rst:407 +#: ../../library/profile.rst:409 msgid "Meaning" msgstr "" -#: ../../library/profile.rst:409 +#: ../../library/profile.rst:411 msgid "``'calls'``" msgstr "``'calls'``" -#: ../../library/profile.rst:409 +#: ../../library/profile.rst:411 msgid "SortKey.CALLS" msgstr "SortKey.CALLS" -#: ../../library/profile.rst:409 ../../library/profile.rst:421 +#: ../../library/profile.rst:411 ../../library/profile.rst:423 msgid "call count" msgstr "" -#: ../../library/profile.rst:411 +#: ../../library/profile.rst:413 msgid "``'cumulative'``" msgstr "``'cumulative'``" -#: ../../library/profile.rst:411 +#: ../../library/profile.rst:413 msgid "SortKey.CUMULATIVE" msgstr "SortKey.CUMULATIVE" -#: ../../library/profile.rst:411 ../../library/profile.rst:413 +#: ../../library/profile.rst:413 ../../library/profile.rst:415 msgid "cumulative time" msgstr "" -#: ../../library/profile.rst:413 +#: ../../library/profile.rst:415 msgid "``'cumtime'``" msgstr "``'cumtime'``" -#: ../../library/profile.rst:413 ../../library/profile.rst:415 -#: ../../library/profile.rst:419 ../../library/profile.rst:421 -#: ../../library/profile.rst:435 +#: ../../library/profile.rst:415 ../../library/profile.rst:417 +#: ../../library/profile.rst:421 ../../library/profile.rst:423 +#: ../../library/profile.rst:437 msgid "N/A" msgstr "N/A" -#: ../../library/profile.rst:415 +#: ../../library/profile.rst:417 msgid "``'file'``" msgstr "``'file'``" -#: ../../library/profile.rst:415 ../../library/profile.rst:417 -#: ../../library/profile.rst:419 +#: ../../library/profile.rst:417 ../../library/profile.rst:419 +#: ../../library/profile.rst:421 msgid "file name" msgstr "file name(檔案名稱)" -#: ../../library/profile.rst:417 +#: ../../library/profile.rst:419 msgid "``'filename'``" msgstr "``'filename'``" -#: ../../library/profile.rst:417 +#: ../../library/profile.rst:419 msgid "SortKey.FILENAME" msgstr "SortKey.FILENAME" -#: ../../library/profile.rst:419 +#: ../../library/profile.rst:421 msgid "``'module'``" msgstr "``'module'``" -#: ../../library/profile.rst:421 +#: ../../library/profile.rst:423 msgid "``'ncalls'``" msgstr "``'ncalls'``" -#: ../../library/profile.rst:423 +#: ../../library/profile.rst:425 msgid "``'pcalls'``" msgstr "``'pcalls'``" -#: ../../library/profile.rst:423 +#: ../../library/profile.rst:425 msgid "SortKey.PCALLS" msgstr "SortKey.PCALLS" -#: ../../library/profile.rst:423 +#: ../../library/profile.rst:425 msgid "primitive call count" msgstr "" -#: ../../library/profile.rst:425 +#: ../../library/profile.rst:427 msgid "``'line'``" msgstr "``'line'``" -#: ../../library/profile.rst:425 +#: ../../library/profile.rst:427 msgid "SortKey.LINE" msgstr "SortKey.LINE" -#: ../../library/profile.rst:425 +#: ../../library/profile.rst:427 msgid "line number" msgstr "" -#: ../../library/profile.rst:427 +#: ../../library/profile.rst:429 msgid "``'name'``" msgstr "``'name'``" -#: ../../library/profile.rst:427 +#: ../../library/profile.rst:429 msgid "SortKey.NAME" msgstr "SortKey.NAME" -#: ../../library/profile.rst:427 +#: ../../library/profile.rst:429 msgid "function name" msgstr "" -#: ../../library/profile.rst:429 +#: ../../library/profile.rst:431 msgid "``'nfl'``" msgstr "``'nfl'``" -#: ../../library/profile.rst:429 +#: ../../library/profile.rst:431 msgid "SortKey.NFL" msgstr "SortKey.NFL" -#: ../../library/profile.rst:429 +#: ../../library/profile.rst:431 msgid "name/file/line" msgstr "" -#: ../../library/profile.rst:431 +#: ../../library/profile.rst:433 msgid "``'stdname'``" msgstr "``'stdname'``" -#: ../../library/profile.rst:431 +#: ../../library/profile.rst:433 msgid "SortKey.STDNAME" msgstr "SortKey.STDNAME" -#: ../../library/profile.rst:431 +#: ../../library/profile.rst:433 msgid "standard name" msgstr "" -#: ../../library/profile.rst:433 +#: ../../library/profile.rst:435 msgid "``'time'``" msgstr "``'time'``" -#: ../../library/profile.rst:433 +#: ../../library/profile.rst:435 msgid "SortKey.TIME" msgstr "SortKey.TIME" -#: ../../library/profile.rst:433 ../../library/profile.rst:435 +#: ../../library/profile.rst:435 ../../library/profile.rst:437 msgid "internal time" msgstr "" -#: ../../library/profile.rst:435 +#: ../../library/profile.rst:437 msgid "``'tottime'``" msgstr "``'tottime'``" -#: ../../library/profile.rst:438 +#: ../../library/profile.rst:440 msgid "" "Note that all sorts on statistics are in descending order (placing most time " "consuming items first), where as name, file, and line number searches are in " @@ -663,7 +663,7 @@ msgid "" "SortKey.FILENAME, SortKey.LINE)``." msgstr "" -#: ../../library/profile.rst:449 +#: ../../library/profile.rst:451 msgid "" "For backward-compatibility reasons, the numeric arguments ``-1``, ``0``, " "``1``, and ``2`` are permitted. They are interpreted as ``'stdname'``, " @@ -672,31 +672,31 @@ msgid "" "used, and additional arguments will be silently ignored." msgstr "" -#: ../../library/profile.rst:457 +#: ../../library/profile.rst:459 msgid "Added the SortKey enum." msgstr "" -#: ../../library/profile.rst:462 +#: ../../library/profile.rst:464 msgid "" "This method for the :class:`Stats` class reverses the ordering of the basic " "list within the object. Note that by default ascending vs descending order " "is properly selected based on the sort key of choice." msgstr "" -#: ../../library/profile.rst:472 +#: ../../library/profile.rst:474 msgid "" "This method for the :class:`Stats` class prints out a report as described in " "the :func:`profile.run` definition." msgstr "" -#: ../../library/profile.rst:475 +#: ../../library/profile.rst:477 msgid "" "The order of the printing is based on the last :meth:`~pstats.Stats." "sort_stats` operation done on the object (subject to caveats in :meth:" "`~pstats.Stats.add` and :meth:`~pstats.Stats.strip_dirs`)." msgstr "" -#: ../../library/profile.rst:480 +#: ../../library/profile.rst:482 msgid "" "The arguments provided (if any) can be used to limit the list down to the " "significant entries. Initially, the list is taken to be the complete set of " @@ -708,20 +708,20 @@ msgid "" "example::" msgstr "" -#: ../../library/profile.rst:491 +#: ../../library/profile.rst:493 msgid "" "would first limit the printing to first 10% of list, and then only print " "functions that were part of filename :file:`.\\*foo:`. In contrast, the " "command::" msgstr "" -#: ../../library/profile.rst:497 +#: ../../library/profile.rst:499 msgid "" "would limit the list to all functions having file names :file:`.\\*foo:`, " "and then proceed to only print the first 10% of them." msgstr "" -#: ../../library/profile.rst:503 +#: ../../library/profile.rst:505 msgid "" "This method for the :class:`Stats` class prints a list of all functions that " "called each function in the profiled database. The ordering is identical to " @@ -731,7 +731,7 @@ msgid "" "produced the stats:" msgstr "" -#: ../../library/profile.rst:510 +#: ../../library/profile.rst:512 msgid "" "With :mod:`profile`, a number is shown in parentheses after each caller to " "show how many times this specific call was made. For convenience, a second " @@ -739,14 +739,14 @@ msgid "" "at the right." msgstr "" -#: ../../library/profile.rst:515 +#: ../../library/profile.rst:517 msgid "" "With :mod:`cProfile`, each caller is preceded by three numbers: the number " "of times this specific call was made, and the total and cumulative times " "spent in the current function while it was invoked by this specific caller." msgstr "" -#: ../../library/profile.rst:523 +#: ../../library/profile.rst:525 msgid "" "This method for the :class:`Stats` class prints a list of all function that " "were called by the indicated function. Aside from this reversal of " @@ -754,7 +754,7 @@ msgid "" "are identical to the :meth:`~pstats.Stats.print_callers` method." msgstr "" -#: ../../library/profile.rst:531 +#: ../../library/profile.rst:533 msgid "" "This method returns an instance of StatsProfile, which contains a mapping of " "function names to instances of FunctionProfile. Each FunctionProfile " @@ -762,17 +762,17 @@ msgid "" "long the function took to run, how many times it was called, etc..." msgstr "" -#: ../../library/profile.rst:536 +#: ../../library/profile.rst:538 msgid "" "Added the following dataclasses: StatsProfile, FunctionProfile. Added the " "following function: get_stats_profile." msgstr "" -#: ../../library/profile.rst:543 +#: ../../library/profile.rst:545 msgid "What Is Deterministic Profiling?" msgstr "" -#: ../../library/profile.rst:545 +#: ../../library/profile.rst:547 msgid "" ":dfn:`Deterministic profiling` is meant to reflect the fact that all " "*function call*, *function return*, and *exception* events are monitored, " @@ -785,7 +785,7 @@ msgid "" "being spent." msgstr "" -#: ../../library/profile.rst:554 +#: ../../library/profile.rst:556 msgid "" "In Python, since there is an interpreter active during execution, the " "presence of instrumented code is not required in order to do deterministic " @@ -797,7 +797,7 @@ msgid "" "time statistics about the execution of a Python program." msgstr "" -#: ../../library/profile.rst:563 +#: ../../library/profile.rst:565 msgid "" "Call count statistics can be used to identify bugs in code (surprising " "counts), and to identify possible inline-expansion points (high call " @@ -809,11 +809,11 @@ msgid "" "compared to iterative implementations." msgstr "" -#: ../../library/profile.rst:576 +#: ../../library/profile.rst:578 msgid "Limitations" msgstr "限制" -#: ../../library/profile.rst:578 +#: ../../library/profile.rst:580 msgid "" "One limitation has to do with accuracy of timing information. There is a " "fundamental problem with deterministic profilers involving accuracy. The " @@ -824,7 +824,7 @@ msgid "" "first error induces a second source of error." msgstr "" -#: ../../library/profile.rst:586 +#: ../../library/profile.rst:588 msgid "" "The second problem is that it \"takes a while\" from when an event is " "dispatched until the profiler's call to get the time actually *gets* the " @@ -837,7 +837,7 @@ msgid "" "clock tick), but it *can* accumulate and become very significant." msgstr "" -#: ../../library/profile.rst:596 +#: ../../library/profile.rst:598 msgid "" "The problem is more important with :mod:`profile` than with the lower-" "overhead :mod:`cProfile`. For this reason, :mod:`profile` provides a means " @@ -851,11 +851,11 @@ msgid "" "calibration." msgstr "" -#: ../../library/profile.rst:610 +#: ../../library/profile.rst:612 msgid "Calibration" msgstr "校正" -#: ../../library/profile.rst:612 +#: ../../library/profile.rst:614 msgid "" "The profiler of the :mod:`profile` module subtracts a constant from each " "event handling time to compensate for the overhead of calling the time " @@ -864,7 +864,7 @@ msgid "" "platform (see :ref:`profile-limitations`). ::" msgstr "" -#: ../../library/profile.rst:623 +#: ../../library/profile.rst:625 msgid "" "The method executes the number of Python calls given by the argument, " "directly and again under the profiler, measuring the time for both. It then " @@ -874,48 +874,48 @@ msgid "" "4.04e-6." msgstr "" -#: ../../library/profile.rst:629 +#: ../../library/profile.rst:631 msgid "" "The object of this exercise is to get a fairly consistent result. If your " "computer is *very* fast, or your timer function has poor resolution, you " "might have to pass 100000, or even 1000000, to get consistent results." msgstr "" -#: ../../library/profile.rst:633 +#: ../../library/profile.rst:635 msgid "" "When you have a consistent answer, there are three ways you can use it::" msgstr "" -#: ../../library/profile.rst:647 +#: ../../library/profile.rst:649 msgid "" "If you have a choice, you are better off choosing a smaller constant, and " "then your results will \"less often\" show up as negative in profile " "statistics." msgstr "" -#: ../../library/profile.rst:653 +#: ../../library/profile.rst:655 msgid "Using a custom timer" msgstr "" -#: ../../library/profile.rst:655 +#: ../../library/profile.rst:657 msgid "" "If you want to change how current time is determined (for example, to force " "use of wall-clock time or elapsed process time), pass the timing function " "you want to the :class:`Profile` class constructor::" msgstr "" -#: ../../library/profile.rst:661 +#: ../../library/profile.rst:663 msgid "" "The resulting profiler will then call ``your_time_func``. Depending on " "whether you are using :class:`profile.Profile` or :class:`cProfile.Profile`, " "``your_time_func``'s return value will be interpreted differently:" msgstr "" -#: ../../library/profile.rst:679 +#: ../../library/profile.rst:681 msgid ":class:`profile.Profile`" msgstr ":class:`profile.Profile`" -#: ../../library/profile.rst:666 +#: ../../library/profile.rst:668 msgid "" "``your_time_func`` should return a single number, or a list of numbers whose " "sum is the current time (like what :func:`os.times` returns). If the " @@ -924,7 +924,7 @@ msgid "" "routine." msgstr "" -#: ../../library/profile.rst:672 +#: ../../library/profile.rst:674 msgid "" "Be warned that you should calibrate the profiler class for the timer " "function that you choose (see :ref:`profile-calibration`). For most " @@ -936,11 +936,11 @@ msgid "" "along with the appropriate calibration constant." msgstr "" -#: ../../library/profile.rst:693 +#: ../../library/profile.rst:695 msgid ":class:`cProfile.Profile`" msgstr ":class:`cProfile.Profile`" -#: ../../library/profile.rst:682 +#: ../../library/profile.rst:684 msgid "" "``your_time_func`` should return a single number. If it returns integers, " "you can also invoke the class constructor with a second argument specifying " @@ -949,7 +949,7 @@ msgid "" "you would construct the :class:`Profile` instance as follows::" msgstr "" -#: ../../library/profile.rst:690 +#: ../../library/profile.rst:692 msgid "" "As the :class:`cProfile.Profile` class cannot be calibrated, custom timer " "functions should be used with care and should be as fast as possible. For " @@ -957,7 +957,7 @@ msgid "" "in the C source of the internal :mod:`_lsprof` module." msgstr "" -#: ../../library/profile.rst:695 +#: ../../library/profile.rst:697 msgid "" "Python 3.3 adds several new functions in :mod:`time` that can be used to " "make precise measurements of process or wall-clock time. For example, see :" diff --git a/library/py_compile.po b/library/py_compile.po index 9d9d843043..f13e31e720 100644 --- a/library/py_compile.po +++ b/library/py_compile.po @@ -1,5 +1,4 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2022, Python Software Foundation +# Copyright (C) 2001-2023, Python Software Foundation # This file is distributed under the same license as the Python package. # # Translators: @@ -7,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:15+0000\n" +"POT-Creation-Date: 2023-10-12 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-" @@ -20,7 +19,7 @@ msgstr "" #: ../../library/py_compile.rst:2 msgid ":mod:`py_compile` --- Compile Python source files" -msgstr "" +msgstr ":mod:`py_compile` — 編譯 Python 來源檔案" #: ../../library/py_compile.rst:10 msgid "**Source code:** :source:`Lib/py_compile.py`" @@ -168,11 +167,11 @@ msgid "" "external to Python like a build system." msgstr "" -#: ../../library/py_compile.rst:130 +#: ../../library/py_compile.rst:131 msgid "Command-Line Interface" msgstr "" -#: ../../library/py_compile.rst:132 +#: ../../library/py_compile.rst:133 msgid "" "This module can be invoked as a script to compile several source files. The " "files named in *filenames* are compiled and the resulting bytecode is cached " @@ -181,29 +180,29 @@ msgid "" "status is nonzero if one of the files could not be compiled." msgstr "" -#: ../../library/py_compile.rst:144 +#: ../../library/py_compile.rst:145 msgid "" "Positional arguments are files to compile. If ``-`` is the only parameter, " "the list of files is taken from standard input." msgstr "" -#: ../../library/py_compile.rst:149 +#: ../../library/py_compile.rst:150 msgid "Suppress errors output." msgstr "" -#: ../../library/py_compile.rst:151 +#: ../../library/py_compile.rst:152 msgid "Added support for ``-``." msgstr "新增對 ``-`` 的支援。" -#: ../../library/py_compile.rst:154 +#: ../../library/py_compile.rst:155 msgid "Added support for :option:`-q`." msgstr "新增對 :option:`-q` 的支援。" -#: ../../library/py_compile.rst:160 +#: ../../library/py_compile.rst:161 msgid "Module :mod:`compileall`" msgstr ":mod:`compileall` 模組" -#: ../../library/py_compile.rst:161 +#: ../../library/py_compile.rst:162 msgid "Utilities to compile all Python source files in a directory tree." msgstr "" diff --git a/library/re.po b/library/re.po index 9a3cea8d64..30f305d70d 100644 --- a/library/re.po +++ b/library/re.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-27 00:04+0000\n" +"POT-Creation-Date: 2023-10-11 17:13+0000\n" "PO-Revision-Date: 2023-09-16 14:49+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -935,8 +935,9 @@ msgstr "" #: ../../library/re.rst:662 msgid "" -"The ``'\\N{name}'`` escape sequence has been added. As in string literals, " -"it expands to the named Unicode character (e.g. ``'\\N{EM DASH}'``)." +"The :samp:`'\\\\N\\\\{{name}\\\\}'` escape sequence has been added. As in " +"string literals, it expands to the named Unicode character (e.g. ``'\\N{EM " +"DASH}'``)." msgstr "" #: ../../library/re.rst:670 diff --git a/library/shutil.po b/library/shutil.po index 9a21435530..252cdd980b 100644 --- a/library/shutil.po +++ b/library/shutil.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-29 10:36+0000\n" +"POT-Creation-Date: 2023-10-11 17:13+0000\n" "PO-Revision-Date: 2018-05-23 16:10+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -617,18 +617,25 @@ msgid "" "now be found." msgstr "" -#: ../../library/shutil.rst:481 +#: ../../library/shutil.rst:479 +msgid "" +"On Windows, if *mode* includes ``os.X_OK``, executables with an extension in " +"``PATHEXT`` will be preferred over executables without a matching extension. " +"This brings behavior closer to that of Python 3.11." +msgstr "" + +#: ../../library/shutil.rst:487 msgid "" "This exception collects exceptions that are raised during a multi-file " "operation. For :func:`copytree`, the exception argument is a list of 3-" "tuples (*srcname*, *dstname*, *exception*)." msgstr "" -#: ../../library/shutil.rst:488 +#: ../../library/shutil.rst:494 msgid "Platform-dependent efficient copy operations" msgstr "" -#: ../../library/shutil.rst:490 +#: ../../library/shutil.rst:496 msgid "" "Starting from Python 3.8, all functions involving a file copy (:func:" "`copyfile`, :func:`~shutil.copy`, :func:`copy2`, :func:`copytree`, and :func:" @@ -638,51 +645,51 @@ msgid "" "buffers in Python as in \"``outfd.write(infd.read())``\"." msgstr "" -#: ../../library/shutil.rst:498 +#: ../../library/shutil.rst:504 msgid "On macOS `fcopyfile`_ is used to copy the file content (not metadata)." msgstr "" -#: ../../library/shutil.rst:500 +#: ../../library/shutil.rst:506 msgid "On Linux :func:`os.sendfile` is used." msgstr "" -#: ../../library/shutil.rst:502 +#: ../../library/shutil.rst:508 msgid "" "On Windows :func:`shutil.copyfile` uses a bigger default buffer size (1 MiB " "instead of 64 KiB) and a :func:`memoryview`-based variant of :func:`shutil." "copyfileobj` is used." msgstr "" -#: ../../library/shutil.rst:506 +#: ../../library/shutil.rst:512 msgid "" "If the fast-copy operation fails and no data was written in the destination " "file then shutil will silently fallback on using less efficient :func:" "`copyfileobj` function internally." msgstr "" -#: ../../library/shutil.rst:515 +#: ../../library/shutil.rst:521 msgid "copytree example" msgstr "" -#: ../../library/shutil.rst:517 +#: ../../library/shutil.rst:523 msgid "An example that uses the :func:`ignore_patterns` helper::" msgstr "" -#: ../../library/shutil.rst:523 +#: ../../library/shutil.rst:529 msgid "" "This will copy everything except ``.pyc`` files and files or directories " "whose name starts with ``tmp``." msgstr "" -#: ../../library/shutil.rst:526 +#: ../../library/shutil.rst:532 msgid "Another example that uses the *ignore* argument to add a logging call::" msgstr "" -#: ../../library/shutil.rst:541 +#: ../../library/shutil.rst:547 msgid "rmtree example" msgstr "rmtree 範例" -#: ../../library/shutil.rst:543 +#: ../../library/shutil.rst:549 msgid "" "This example shows how to remove a directory tree on Windows where some of " "the files have their read-only bit set. It uses the onexc callback to clear " @@ -690,25 +697,25 @@ msgid "" "propagate. ::" msgstr "" -#: ../../library/shutil.rst:561 +#: ../../library/shutil.rst:567 msgid "Archiving operations" msgstr "" -#: ../../library/shutil.rst:565 +#: ../../library/shutil.rst:571 msgid "Added support for the *xztar* format." msgstr "新增 *xztar* 格式的支援。" -#: ../../library/shutil.rst:569 +#: ../../library/shutil.rst:575 msgid "" "High-level utilities to create and read compressed and archived files are " "also provided. They rely on the :mod:`zipfile` and :mod:`tarfile` modules." msgstr "" -#: ../../library/shutil.rst:574 +#: ../../library/shutil.rst:580 msgid "Create an archive file (such as zip or tar) and return its name." msgstr "" -#: ../../library/shutil.rst:576 +#: ../../library/shutil.rst:582 msgid "" "*base_name* is the name of the file to create, including the path, minus any " "format-specific extension. *format* is the archive format: one of " @@ -717,14 +724,14 @@ msgid "" "available), or \"xztar\" (if the :mod:`lzma` module is available)." msgstr "" -#: ../../library/shutil.rst:582 +#: ../../library/shutil.rst:588 msgid "" "*root_dir* is a directory that will be the root directory of the archive, " "all paths in the archive will be relative to it; for example, we typically " "chdir into *root_dir* before creating the archive." msgstr "" -#: ../../library/shutil.rst:586 +#: ../../library/shutil.rst:592 msgid "" "*base_dir* is the directory where we start archiving from; i.e. *base_dir* " "will be the common prefix of all files and directories in the archive. " @@ -732,33 +739,33 @@ msgid "" "example-with-basedir` for how to use *base_dir* and *root_dir* together." msgstr "" -#: ../../library/shutil.rst:592 +#: ../../library/shutil.rst:598 msgid "*root_dir* and *base_dir* both default to the current directory." msgstr "" -#: ../../library/shutil.rst:594 +#: ../../library/shutil.rst:600 msgid "" "If *dry_run* is true, no archive is created, but the operations that would " "be executed are logged to *logger*." msgstr "" -#: ../../library/shutil.rst:597 +#: ../../library/shutil.rst:603 msgid "" "*owner* and *group* are used when creating a tar archive. By default, uses " "the current owner and group." msgstr "" -#: ../../library/shutil.rst:600 +#: ../../library/shutil.rst:606 msgid "" "*logger* must be an object compatible with :pep:`282`, usually an instance " "of :class:`logging.Logger`." msgstr "" -#: ../../library/shutil.rst:603 +#: ../../library/shutil.rst:609 msgid "The *verbose* argument is unused and deprecated." msgstr "" -#: ../../library/shutil.rst:605 +#: ../../library/shutil.rst:611 msgid "" "Raises an :ref:`auditing event ` ``shutil.make_archive`` with " "arguments ``base_name``, ``format``, ``root_dir``, ``base_dir``." @@ -766,7 +773,7 @@ msgstr "" "引發一個附帶引數 ``base_name``、``format``、``root_dir``、``base_dir`` 的\\ :" "ref:`稽核事件 ` ``shutil.make_archive``。" -#: ../../library/shutil.rst:609 +#: ../../library/shutil.rst:615 msgid "" "This function is not thread-safe when custom archivers registered with :func:" "`register_archive_format` do not support the *root_dir* argument. In this " @@ -774,60 +781,60 @@ msgid "" "*root_dir* to perform archiving." msgstr "" -#: ../../library/shutil.rst:615 +#: ../../library/shutil.rst:621 msgid "" "The modern pax (POSIX.1-2001) format is now used instead of the legacy GNU " "format for archives created with ``format=\"tar\"``." msgstr "" -#: ../../library/shutil.rst:619 +#: ../../library/shutil.rst:625 msgid "" "This function is now made thread-safe during creation of standard ``.zip`` " "and tar archives." msgstr "" -#: ../../library/shutil.rst:625 +#: ../../library/shutil.rst:631 msgid "" "Return a list of supported formats for archiving. Each element of the " "returned sequence is a tuple ``(name, description)``." msgstr "" -#: ../../library/shutil.rst:628 ../../library/shutil.rst:739 +#: ../../library/shutil.rst:634 ../../library/shutil.rst:745 msgid "By default :mod:`shutil` provides these formats:" msgstr "" -#: ../../library/shutil.rst:630 +#: ../../library/shutil.rst:636 msgid "*zip*: ZIP file (if the :mod:`zlib` module is available)." msgstr "" -#: ../../library/shutil.rst:631 +#: ../../library/shutil.rst:637 msgid "" "*tar*: Uncompressed tar file. Uses POSIX.1-2001 pax format for new archives." msgstr "" -#: ../../library/shutil.rst:632 ../../library/shutil.rst:744 +#: ../../library/shutil.rst:638 ../../library/shutil.rst:750 msgid "*gztar*: gzip'ed tar-file (if the :mod:`zlib` module is available)." msgstr "" -#: ../../library/shutil.rst:633 ../../library/shutil.rst:745 +#: ../../library/shutil.rst:639 ../../library/shutil.rst:751 msgid "*bztar*: bzip2'ed tar-file (if the :mod:`bz2` module is available)." msgstr "" -#: ../../library/shutil.rst:634 ../../library/shutil.rst:746 +#: ../../library/shutil.rst:640 ../../library/shutil.rst:752 msgid "*xztar*: xz'ed tar-file (if the :mod:`lzma` module is available)." msgstr "" -#: ../../library/shutil.rst:636 +#: ../../library/shutil.rst:642 msgid "" "You can register new formats or provide your own archiver for any existing " "formats, by using :func:`register_archive_format`." msgstr "" -#: ../../library/shutil.rst:642 +#: ../../library/shutil.rst:648 msgid "Register an archiver for the format *name*." msgstr "" -#: ../../library/shutil.rst:644 +#: ../../library/shutil.rst:650 msgid "" "*function* is the callable that will be used to unpack archives. The " "callable will receive the *base_name* of the file to create, followed by the " @@ -836,7 +843,7 @@ msgid "" "*dry_run* and *logger* (as passed in :func:`make_archive`)." msgstr "" -#: ../../library/shutil.rst:650 +#: ../../library/shutil.rst:656 msgid "" "If *function* has the custom attribute ``function.supports_root_dir`` set to " "``True``, the *root_dir* argument is passed as a keyword argument. Otherwise " @@ -845,37 +852,37 @@ msgid "" "not thread-safe." msgstr "" -#: ../../library/shutil.rst:656 +#: ../../library/shutil.rst:662 msgid "" "If given, *extra_args* is a sequence of ``(name, value)`` pairs that will be " "used as extra keywords arguments when the archiver callable is used." msgstr "" -#: ../../library/shutil.rst:659 +#: ../../library/shutil.rst:665 msgid "" "*description* is used by :func:`get_archive_formats` which returns the list " "of archivers. Defaults to an empty string." msgstr "" -#: ../../library/shutil.rst:662 +#: ../../library/shutil.rst:668 msgid "Added support for functions supporting the *root_dir* argument." msgstr "" -#: ../../library/shutil.rst:668 +#: ../../library/shutil.rst:674 msgid "Remove the archive format *name* from the list of supported formats." msgstr "" -#: ../../library/shutil.rst:673 +#: ../../library/shutil.rst:679 msgid "Unpack an archive. *filename* is the full path of the archive." msgstr "" -#: ../../library/shutil.rst:675 +#: ../../library/shutil.rst:681 msgid "" "*extract_dir* is the name of the target directory where the archive is " "unpacked. If not provided, the current working directory is used." msgstr "" -#: ../../library/shutil.rst:678 +#: ../../library/shutil.rst:684 msgid "" "*format* is the archive format: one of \"zip\", \"tar\", \"gztar\", " "\"bztar\", or \"xztar\". Or any other format registered with :func:" @@ -884,7 +891,7 @@ msgid "" "that extension. In case none is found, a :exc:`ValueError` is raised." msgstr "" -#: ../../library/shutil.rst:685 +#: ../../library/shutil.rst:691 msgid "" "The keyword-only *filter* argument is passed to the underlying unpacking " "function. For zip files, *filter* is not accepted. For tar files, it is " @@ -894,7 +901,7 @@ msgid "" "Python 3.14." msgstr "" -#: ../../library/shutil.rst:693 +#: ../../library/shutil.rst:699 msgid "" "Raises an :ref:`auditing event ` ``shutil.unpack_archive`` with " "arguments ``filename``, ``extract_dir``, ``format``." @@ -902,7 +909,7 @@ msgstr "" "引發一個附帶引數 ``filename``、``extract_dir``、``format`` 的\\ :ref:`稽核事" "件 ` ``shutil.unpack_archive``。" -#: ../../library/shutil.rst:697 +#: ../../library/shutil.rst:703 msgid "" "Never extract archives from untrusted sources without prior inspection. It " "is possible that files are created outside of the path specified in the " @@ -910,138 +917,138 @@ msgid "" "with \"/\" or filenames with two dots \"..\"." msgstr "" -#: ../../library/shutil.rst:702 +#: ../../library/shutil.rst:708 msgid "Accepts a :term:`path-like object` for *filename* and *extract_dir*." msgstr "" -#: ../../library/shutil.rst:705 +#: ../../library/shutil.rst:711 msgid "Added the *filter* argument." msgstr "新增 *filter* 引數。" -#: ../../library/shutil.rst:710 +#: ../../library/shutil.rst:716 msgid "" "Registers an unpack format. *name* is the name of the format and " "*extensions* is a list of extensions corresponding to the format, like ``." "zip`` for Zip files." msgstr "" -#: ../../library/shutil.rst:714 +#: ../../library/shutil.rst:720 msgid "" "*function* is the callable that will be used to unpack archives. The " "callable will receive:" msgstr "" -#: ../../library/shutil.rst:717 +#: ../../library/shutil.rst:723 msgid "the path of the archive, as a positional argument;" msgstr "" -#: ../../library/shutil.rst:718 +#: ../../library/shutil.rst:724 msgid "" "the directory the archive must be extracted to, as a positional argument;" msgstr "" -#: ../../library/shutil.rst:719 +#: ../../library/shutil.rst:725 msgid "" "possibly a *filter* keyword argument, if it was given to :func:" "`unpack_archive`;" msgstr "" -#: ../../library/shutil.rst:721 +#: ../../library/shutil.rst:727 msgid "" "additional keyword arguments, specified by *extra_args* as a sequence of " "``(name, value)`` tuples." msgstr "" -#: ../../library/shutil.rst:724 +#: ../../library/shutil.rst:730 msgid "" "*description* can be provided to describe the format, and will be returned " "by the :func:`get_unpack_formats` function." msgstr "" -#: ../../library/shutil.rst:730 +#: ../../library/shutil.rst:736 msgid "Unregister an unpack format. *name* is the name of the format." msgstr "" -#: ../../library/shutil.rst:735 +#: ../../library/shutil.rst:741 msgid "" "Return a list of all registered formats for unpacking. Each element of the " "returned sequence is a tuple ``(name, extensions, description)``." msgstr "" -#: ../../library/shutil.rst:741 +#: ../../library/shutil.rst:747 msgid "" "*zip*: ZIP file (unpacking compressed files works only if the corresponding " "module is available)." msgstr "" -#: ../../library/shutil.rst:743 +#: ../../library/shutil.rst:749 msgid "*tar*: uncompressed tar file." msgstr "" -#: ../../library/shutil.rst:748 +#: ../../library/shutil.rst:754 msgid "" "You can register new formats or provide your own unpacker for any existing " "formats, by using :func:`register_unpack_format`." msgstr "" -#: ../../library/shutil.rst:755 +#: ../../library/shutil.rst:761 msgid "Archiving example" msgstr "" -#: ../../library/shutil.rst:757 +#: ../../library/shutil.rst:763 msgid "" "In this example, we create a gzip'ed tar-file archive containing all files " "found in the :file:`.ssh` directory of the user::" msgstr "" -#: ../../library/shutil.rst:767 +#: ../../library/shutil.rst:773 msgid "The resulting archive contains:" msgstr "" -#: ../../library/shutil.rst:785 +#: ../../library/shutil.rst:791 msgid "Archiving example with *base_dir*" msgstr "" -#: ../../library/shutil.rst:787 +#: ../../library/shutil.rst:793 msgid "" "In this example, similar to the `one above `_, we " "show how to use :func:`make_archive`, but this time with the usage of " "*base_dir*. We now have the following directory structure:" msgstr "" -#: ../../library/shutil.rst:801 +#: ../../library/shutil.rst:807 msgid "" "In the final archive, :file:`please_add.txt` should be included, but :file:" "`do_not_add.txt` should not. Therefore we use the following::" msgstr "" -#: ../../library/shutil.rst:815 +#: ../../library/shutil.rst:821 msgid "Listing the files in the resulting archive gives us:" msgstr "" -#: ../../library/shutil.rst:825 +#: ../../library/shutil.rst:831 msgid "Querying the size of the output terminal" msgstr "" -#: ../../library/shutil.rst:829 +#: ../../library/shutil.rst:835 msgid "Get the size of the terminal window." msgstr "" -#: ../../library/shutil.rst:831 +#: ../../library/shutil.rst:837 msgid "" "For each of the two dimensions, the environment variable, ``COLUMNS`` and " "``LINES`` respectively, is checked. If the variable is defined and the value " "is a positive integer, it is used." msgstr "" -#: ../../library/shutil.rst:835 +#: ../../library/shutil.rst:841 msgid "" "When ``COLUMNS`` or ``LINES`` is not defined, which is the common case, the " "terminal connected to :data:`sys.__stdout__` is queried by invoking :func:" "`os.get_terminal_size`." msgstr "" -#: ../../library/shutil.rst:839 +#: ../../library/shutil.rst:845 msgid "" "If the terminal size cannot be successfully queried, either because the " "system doesn't support querying, or because we are not connected to a " @@ -1050,17 +1057,17 @@ msgid "" "emulators." msgstr "" -#: ../../library/shutil.rst:845 +#: ../../library/shutil.rst:851 msgid "The value returned is a named tuple of type :class:`os.terminal_size`." msgstr "" -#: ../../library/shutil.rst:847 +#: ../../library/shutil.rst:853 msgid "" "See also: The Single UNIX Specification, Version 2, `Other Environment " "Variables`_." msgstr "" -#: ../../library/shutil.rst:852 +#: ../../library/shutil.rst:858 msgid "" "The ``fallback`` values are also used if :func:`os.get_terminal_size` " "returns zeroes." diff --git a/library/site.po b/library/site.po index 8e1b8bb8fc..df42298966 100644 --- a/library/site.po +++ b/library/site.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-18 00:03+0000\n" +"POT-Creation-Date: 2023-10-11 17:13+0000\n" "PO-Revision-Date: 2018-05-23 16:10+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -39,7 +39,7 @@ msgid "" "path and add a few builtins, unless :option:`-S` was used. In that case, " "this module can be safely imported with no automatic modifications to the " "module search path or additions to the builtins. To explicitly trigger the " -"usual site-specific additions, call the :func:`site.main` function." +"usual site-specific additions, call the :func:`main` function." msgstr "" #: ../../library/site.rst:24 @@ -128,43 +128,52 @@ msgid "" "because it is not mentioned in either path configuration file." msgstr "" -#: ../../library/site.rst:114 +#: ../../library/site.rst:113 +msgid ":mod:`sitecustomize`" +msgstr ":mod:`sitecustomize`" + +#: ../../library/site.rst:117 msgid "" "After these path manipulations, an attempt is made to import a module named :" "mod:`sitecustomize`, which can perform arbitrary site-specific " "customizations. It is typically created by a system administrator in the " "site-packages directory. If this import fails with an :exc:`ImportError` or " -"its subclass exception, and the exception's :attr:`name` attribute equals to " -"``'sitecustomize'``, it is silently ignored. If Python is started without " -"output streams available, as with :file:`pythonw.exe` on Windows (which is " -"used by default to start IDLE), attempted output from :mod:`sitecustomize` " -"is ignored. Any other exception causes a silent and perhaps mysterious " -"failure of the process." +"its subclass exception, and the exception's :attr:`~ImportError.name` " +"attribute equals to ``'sitecustomize'``, it is silently ignored. If Python " +"is started without output streams available, as with :file:`pythonw.exe` on " +"Windows (which is used by default to start IDLE), attempted output from :mod:" +"`sitecustomize` is ignored. Any other exception causes a silent and perhaps " +"mysterious failure of the process." msgstr "" -#: ../../library/site.rst:126 +#: ../../library/site.rst:129 +msgid ":mod:`usercustomize`" +msgstr ":mod:`usercustomize`" + +#: ../../library/site.rst:133 msgid "" "After this, an attempt is made to import a module named :mod:" "`usercustomize`, which can perform arbitrary user-specific customizations, " -"if :data:`ENABLE_USER_SITE` is true. This file is intended to be created in " -"the user site-packages directory (see below), which is part of ``sys.path`` " -"unless disabled by :option:`-s`. If this import fails with an :exc:" -"`ImportError` or its subclass exception, and the exception's :attr:`name` " -"attribute equals to ``'usercustomize'``, it is silently ignored." +"if :data:`~site.ENABLE_USER_SITE` is true. This file is intended to be " +"created in the user site-packages directory (see below), which is part of " +"``sys.path`` unless disabled by :option:`-s`. If this import fails with an :" +"exc:`ImportError` or its subclass exception, and the exception's :attr:" +"`~ImportError.name` attribute equals to ``'usercustomize'``, it is silently " +"ignored." msgstr "" -#: ../../library/site.rst:134 +#: ../../library/site.rst:141 msgid "" "Note that for some non-Unix systems, ``sys.prefix`` and ``sys.exec_prefix`` " "are empty, and the path manipulations are skipped; however the import of :" "mod:`sitecustomize` and :mod:`usercustomize` is still attempted." msgstr "" -#: ../../library/site.rst:142 +#: ../../library/site.rst:150 msgid "Readline configuration" msgstr "" -#: ../../library/site.rst:144 +#: ../../library/site.rst:152 msgid "" "On systems that support :mod:`readline`, this module will also import and " "configure the :mod:`rlcompleter` module, if Python is started in :ref:" @@ -176,19 +185,19 @@ msgid "" "`PYTHONSTARTUP` file." msgstr "" -#: ../../library/site.rst:153 +#: ../../library/site.rst:161 msgid "Activation of rlcompleter and history was made automatic." msgstr "" -#: ../../library/site.rst:158 +#: ../../library/site.rst:166 msgid "Module contents" msgstr "模組內容" -#: ../../library/site.rst:162 +#: ../../library/site.rst:170 msgid "A list of prefixes for site-packages directories." msgstr "" -#: ../../library/site.rst:167 +#: ../../library/site.rst:175 msgid "" "Flag showing the status of the user site-packages directory. ``True`` means " "that it is enabled and was added to ``sys.path``. ``False`` means that it " @@ -197,7 +206,7 @@ msgid "" "(mismatch between user or group id and effective id) or by an administrator." msgstr "" -#: ../../library/site.rst:177 +#: ../../library/site.rst:185 msgid "" "Path to the user site-packages for the running Python. Can be ``None`` if :" "func:`getusersitepackages` hasn't been called yet. Default value is :file:" @@ -208,46 +217,46 @@ msgid "" "file:`.pth` files in it will be processed." msgstr "" -#: ../../library/site.rst:188 +#: ../../library/site.rst:196 msgid "" "Path to the base directory for the user site-packages. Can be ``None`` if :" "func:`getuserbase` hasn't been called yet. Default value is :file:`~/." "local` for UNIX and macOS non-framework builds, :file:`~/Library/Python/{X.Y}" "` for macOS framework builds, and :file:`{%APPDATA%}\\\\Python` for " "Windows. This value is used to compute the installation directories for " -"scripts, data files, Python modules, etc. for the user installation scheme. " -"See also :envvar:`PYTHONUSERBASE`." +"scripts, data files, Python modules, etc. for the :ref:`user installation " +"scheme `. See also :envvar:`PYTHONUSERBASE`." msgstr "" -#: ../../library/site.rst:200 +#: ../../library/site.rst:208 msgid "" "Adds all the standard site-specific directories to the module search path. " "This function is called automatically when this module is imported, unless " "the Python interpreter was started with the :option:`-S` flag." msgstr "" -#: ../../library/site.rst:204 +#: ../../library/site.rst:212 msgid "This function used to be called unconditionally." msgstr "" -#: ../../library/site.rst:210 +#: ../../library/site.rst:218 msgid "" "Add a directory to sys.path and process its :file:`.pth` files. Typically " "used in :mod:`sitecustomize` or :mod:`usercustomize` (see above)." msgstr "" -#: ../../library/site.rst:216 +#: ../../library/site.rst:224 msgid "Return a list containing all global site-packages directories." msgstr "" -#: ../../library/site.rst:223 +#: ../../library/site.rst:231 msgid "" "Return the path of the user base directory, :data:`USER_BASE`. If it is not " "initialized yet, this function will also set it, respecting :envvar:" "`PYTHONUSERBASE`." msgstr "" -#: ../../library/site.rst:232 +#: ../../library/site.rst:240 msgid "" "Return the path of the user-specific site-packages directory, :data:" "`USER_SITE`. If it is not initialized yet, this function will also set it, " @@ -255,17 +264,17 @@ msgid "" "packages was added to ``sys.path`` :data:`ENABLE_USER_SITE` should be used." msgstr "" -#: ../../library/site.rst:244 +#: ../../library/site.rst:252 msgid "Command Line Interface" -msgstr "" +msgstr "命令列介面" -#: ../../library/site.rst:248 +#: ../../library/site.rst:256 msgid "" "The :mod:`site` module also provides a way to get the user directories from " "the command line:" msgstr "" -#: ../../library/site.rst:256 +#: ../../library/site.rst:264 msgid "" "If it is called without arguments, it will print the contents of :data:`sys." "path` on the standard output, followed by the value of :data:`USER_BASE` and " @@ -273,21 +282,21 @@ msgid "" "finally the value of :data:`ENABLE_USER_SITE`." msgstr "" -#: ../../library/site.rst:263 +#: ../../library/site.rst:271 msgid "Print the path to the user base directory." msgstr "" -#: ../../library/site.rst:267 +#: ../../library/site.rst:275 msgid "Print the path to the user site-packages directory." msgstr "" -#: ../../library/site.rst:269 +#: ../../library/site.rst:277 msgid "" "If both options are given, user base and user site will be printed (always " "in this order), separated by :data:`os.pathsep`." msgstr "" -#: ../../library/site.rst:272 +#: ../../library/site.rst:280 msgid "" "If any option is given, the script will exit with one of these values: ``0`` " "if the user site-packages directory is enabled, ``1`` if it was disabled by " @@ -295,16 +304,15 @@ msgid "" "administrator, and a value greater than 2 if there is an error." msgstr "" -#: ../../library/site.rst:279 +#: ../../library/site.rst:287 msgid ":pep:`370` -- Per user site-packages directory" msgstr "" -#: ../../library/site.rst:280 +#: ../../library/site.rst:288 msgid ":ref:`sys-path-init` -- The initialization of :data:`sys.path`." msgstr "" -#: ../../library/site.rst:16 ../../library/site.rst:112 -#: ../../library/site.rst:124 +#: ../../library/site.rst:16 msgid "module" msgstr "module(模組)" @@ -351,11 +359,3 @@ msgstr "configuration(設定)" #: ../../library/site.rst:77 msgid "file" msgstr "file(檔案)" - -#: ../../library/site.rst:112 -msgid "sitecustomize" -msgstr "sitecustomize" - -#: ../../library/site.rst:124 -msgid "usercustomize" -msgstr "usercustomize" diff --git a/library/socket.po b/library/socket.po index 6ef99f085a..1c2482488b 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-09-09 00:03+0000\n" +"POT-Creation-Date: 2023-10-11 17:13+0000\n" "PO-Revision-Date: 2018-05-23 16:10+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -2313,7 +2313,7 @@ msgid "" "and IPv6. The server side will listen to the first address family available " "(it should listen to both instead). On most of IPv6-ready systems, IPv6 will " "take precedence and the server may not accept IPv4 traffic. The client side " -"will try to connect to the all addresses returned as a result of the name " +"will try to connect to all the addresses returned as a result of the name " "resolution, and sends traffic to the first one connected successfully. ::" msgstr "" diff --git a/library/socketserver.po b/library/socketserver.po index 6502379140..b4a24654b3 100644 --- a/library/socketserver.po +++ b/library/socketserver.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-10-11 17:13+0000\n" "PO-Revision-Date: 2018-05-23 16:10+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -152,41 +152,47 @@ msgid "" "available on POSIX platforms that support :func:`~os.fork`." msgstr "" -#: ../../library/socketserver.rst:119 +#: ../../library/socketserver.rst:121 msgid "" -":meth:`socketserver.ForkingMixIn.server_close` waits until all child " -"processes complete, except if :attr:`socketserver.ForkingMixIn." -"block_on_close` attribute is false." +":meth:`ForkingMixIn.server_close ` waits until all " +"child processes complete, except if :attr:`block_on_close` attribute is " +"``False``." msgstr "" -#: ../../library/socketserver.rst:123 +#: ../../library/socketserver.rst:125 msgid "" -":meth:`socketserver.ThreadingMixIn.server_close` waits until all non-daemon " -"threads complete, except if :attr:`socketserver.ThreadingMixIn." -"block_on_close` attribute is false. Use daemonic threads by setting :data:" -"`ThreadingMixIn.daemon_threads` to ``True`` to not wait until threads " -"complete." +":meth:`ThreadingMixIn.server_close ` waits until " +"all non-daemon threads complete, except if :attr:`block_on_close` attribute " +"is ``False``." msgstr "" -#: ../../library/socketserver.rst:132 +#: ../../library/socketserver.rst:131 msgid "" -":meth:`socketserver.ForkingMixIn.server_close` and :meth:`socketserver." -"ThreadingMixIn.server_close` now waits until all child processes and non-" -"daemonic threads complete. Add a new :attr:`socketserver.ForkingMixIn." -"block_on_close` class attribute to opt-in for the pre-3.7 behaviour." +"For :class:`ThreadingMixIn` use daemonic threads by setting :data:" +"`ThreadingMixIn.daemon_threads ` to ``True`` to not wait " +"until threads complete." msgstr "" -#: ../../library/socketserver.rst:148 +#: ../../library/socketserver.rst:137 +msgid "" +":meth:`ForkingMixIn.server_close ` and :meth:" +"`ThreadingMixIn.server_close ` now waits until all " +"child processes and non-daemonic threads complete. Add a new :attr:" +"`ForkingMixIn.block_on_close ` class attribute to opt-in for " +"the pre-3.7 behaviour." +msgstr "" + +#: ../../library/socketserver.rst:153 msgid "These classes are pre-defined using the mix-in classes." msgstr "" -#: ../../library/socketserver.rst:150 +#: ../../library/socketserver.rst:155 msgid "" "The ``ForkingUnixStreamServer`` and ``ForkingUnixDatagramServer`` classes " "were added." msgstr "" -#: ../../library/socketserver.rst:154 +#: ../../library/socketserver.rst:159 msgid "" "To implement a service, you must derive a class from :class:" "`BaseRequestHandler` and redefine its :meth:`~BaseRequestHandler.handle` " @@ -197,7 +203,7 @@ msgid "" "`DatagramRequestHandler`." msgstr "" -#: ../../library/socketserver.rst:162 +#: ../../library/socketserver.rst:167 msgid "" "Of course, you still have to use your head! For instance, it makes no sense " "to use a forking server if the service contains state in memory that can be " @@ -207,7 +213,7 @@ msgid "" "probably have to use locks to protect the integrity of the shared data." msgstr "" -#: ../../library/socketserver.rst:169 +#: ../../library/socketserver.rst:174 msgid "" "On the other hand, if you are building an HTTP server where all data is " "stored externally (for instance, in the file system), a synchronous class " @@ -217,7 +223,7 @@ msgid "" "appropriate." msgstr "" -#: ../../library/socketserver.rst:175 +#: ../../library/socketserver.rst:180 msgid "" "In some cases, it may be appropriate to process part of a request " "synchronously, but to finish processing in a forked child depending on the " @@ -226,7 +232,7 @@ msgid "" "`~BaseRequestHandler.handle` method." msgstr "" -#: ../../library/socketserver.rst:180 +#: ../../library/socketserver.rst:185 msgid "" "Another approach to handling multiple simultaneous requests in an " "environment that supports neither threads nor :func:`~os.fork` (or where " @@ -238,11 +244,11 @@ msgid "" "subprocesses cannot be used)." msgstr "" -#: ../../library/socketserver.rst:193 +#: ../../library/socketserver.rst:198 msgid "Server Objects" msgstr "" -#: ../../library/socketserver.rst:197 +#: ../../library/socketserver.rst:202 msgid "" "This is the superclass of all Server objects in the module. It defines the " "interface, given below, but does not implement most of the methods, which is " @@ -250,14 +256,14 @@ msgid "" "`server_address` and :attr:`RequestHandlerClass` attributes." msgstr "" -#: ../../library/socketserver.rst:205 +#: ../../library/socketserver.rst:210 msgid "" "Return an integer file descriptor for the socket on which the server is " "listening. This function is most commonly passed to :mod:`selectors`, to " "allow monitoring multiple servers in the same process." msgstr "" -#: ../../library/socketserver.rst:212 +#: ../../library/socketserver.rst:217 msgid "" "Process a single request. This function calls the following methods in " "order: :meth:`get_request`, :meth:`verify_request`, and :meth:" @@ -268,7 +274,7 @@ msgid "" "`handle_request` will return." msgstr "" -#: ../../library/socketserver.rst:224 +#: ../../library/socketserver.rst:229 msgid "" "Handle requests until an explicit :meth:`shutdown` request. Poll for " "shutdown every *poll_interval* seconds. Ignores the :attr:`timeout` " @@ -278,41 +284,41 @@ msgid "" "clean up zombie child processes." msgstr "" -#: ../../library/socketserver.rst:232 +#: ../../library/socketserver.rst:237 msgid "Added ``service_actions`` call to the ``serve_forever`` method." msgstr "" -#: ../../library/socketserver.rst:238 +#: ../../library/socketserver.rst:243 msgid "" "This is called in the :meth:`serve_forever` loop. This method can be " "overridden by subclasses or mixin classes to perform actions specific to a " "given service, such as cleanup actions." msgstr "" -#: ../../library/socketserver.rst:246 +#: ../../library/socketserver.rst:251 msgid "" "Tell the :meth:`serve_forever` loop to stop and wait until it does. :meth:" "`shutdown` must be called while :meth:`serve_forever` is running in a " "different thread otherwise it will deadlock." msgstr "" -#: ../../library/socketserver.rst:253 +#: ../../library/socketserver.rst:258 msgid "Clean up the server. May be overridden." msgstr "" -#: ../../library/socketserver.rst:258 +#: ../../library/socketserver.rst:263 msgid "" "The family of protocols to which the server's socket belongs. Common " "examples are :const:`socket.AF_INET` and :const:`socket.AF_UNIX`." msgstr "" -#: ../../library/socketserver.rst:264 +#: ../../library/socketserver.rst:269 msgid "" "The user-provided request handler class; an instance of this class is " "created for each request." msgstr "" -#: ../../library/socketserver.rst:270 +#: ../../library/socketserver.rst:275 msgid "" "The address on which the server is listening. The format of addresses " "varies depending on the protocol family; see the documentation for the :mod:" @@ -321,22 +327,22 @@ msgid "" "``('127.0.0.1', 80)``, for example." msgstr "" -#: ../../library/socketserver.rst:279 +#: ../../library/socketserver.rst:284 msgid "" "The socket object on which the server will listen for incoming requests." msgstr "" -#: ../../library/socketserver.rst:282 +#: ../../library/socketserver.rst:287 msgid "The server classes support the following class variables:" msgstr "" -#: ../../library/socketserver.rst:288 +#: ../../library/socketserver.rst:293 msgid "" "Whether the server will allow the reuse of an address. This defaults to :" "const:`False`, and can be set in subclasses to change the policy." msgstr "" -#: ../../library/socketserver.rst:294 +#: ../../library/socketserver.rst:299 msgid "" "The size of the request queue. If it takes a long time to process a single " "request, any requests that arrive while the server is busy are placed into a " @@ -345,40 +351,40 @@ msgid "" "default value is usually 5, but this can be overridden by subclasses." msgstr "" -#: ../../library/socketserver.rst:303 +#: ../../library/socketserver.rst:308 msgid "" "The type of socket used by the server; :const:`socket.SOCK_STREAM` and :" "const:`socket.SOCK_DGRAM` are two common values." msgstr "" -#: ../../library/socketserver.rst:309 +#: ../../library/socketserver.rst:314 msgid "" "Timeout duration, measured in seconds, or :const:`None` if no timeout is " "desired. If :meth:`handle_request` receives no incoming requests within the " "timeout period, the :meth:`handle_timeout` method is called." msgstr "" -#: ../../library/socketserver.rst:314 +#: ../../library/socketserver.rst:319 msgid "" "There are various server methods that can be overridden by subclasses of " "base server classes like :class:`TCPServer`; these methods aren't useful to " "external users of the server object." msgstr "" -#: ../../library/socketserver.rst:323 +#: ../../library/socketserver.rst:328 msgid "" "Actually processes the request by instantiating :attr:`RequestHandlerClass` " "and calling its :meth:`~BaseRequestHandler.handle` method." msgstr "" -#: ../../library/socketserver.rst:329 +#: ../../library/socketserver.rst:334 msgid "" "Must accept a request from the socket, and return a 2-tuple containing the " "*new* socket object to be used to communicate with the client, and the " "client's address." msgstr "" -#: ../../library/socketserver.rst:336 +#: ../../library/socketserver.rst:341 msgid "" "This function is called if the :meth:`~BaseRequestHandler.handle` method of " "a :attr:`RequestHandlerClass` instance raises an exception. The default " @@ -386,11 +392,11 @@ msgid "" "further requests." msgstr "" -#: ../../library/socketserver.rst:341 +#: ../../library/socketserver.rst:346 msgid "Now only called for exceptions derived from the :exc:`Exception` class." msgstr "" -#: ../../library/socketserver.rst:348 +#: ../../library/socketserver.rst:353 msgid "" "This function is called when the :attr:`timeout` attribute has been set to a " "value other than :const:`None` and the timeout period has passed with no " @@ -399,7 +405,7 @@ msgid "" "threading servers this method does nothing." msgstr "" -#: ../../library/socketserver.rst:357 +#: ../../library/socketserver.rst:362 msgid "" "Calls :meth:`finish_request` to create an instance of the :attr:" "`RequestHandlerClass`. If desired, this function can create a new process " @@ -407,20 +413,20 @@ msgid "" "`ThreadingMixIn` classes do this." msgstr "" -#: ../../library/socketserver.rst:369 +#: ../../library/socketserver.rst:374 msgid "" "Called by the server's constructor to activate the server. The default " "behavior for a TCP server just invokes :meth:`~socket.socket.listen` on the " "server's socket. May be overridden." msgstr "" -#: ../../library/socketserver.rst:376 +#: ../../library/socketserver.rst:381 msgid "" "Called by the server's constructor to bind the socket to the desired " "address. May be overridden." msgstr "" -#: ../../library/socketserver.rst:382 +#: ../../library/socketserver.rst:387 msgid "" "Must return a Boolean value; if the value is :const:`True`, the request will " "be processed, and if it's :const:`False`, the request will be denied. This " @@ -428,17 +434,17 @@ msgid "" "default implementation always returns :const:`True`." msgstr "" -#: ../../library/socketserver.rst:388 +#: ../../library/socketserver.rst:393 msgid "" "Support for the :term:`context manager` protocol was added. Exiting the " "context manager is equivalent to calling :meth:`server_close`." msgstr "" -#: ../../library/socketserver.rst:394 +#: ../../library/socketserver.rst:399 msgid "Request Handler Objects" msgstr "" -#: ../../library/socketserver.rst:398 +#: ../../library/socketserver.rst:403 msgid "" "This is the superclass of all request handler objects. It defines the " "interface, given below. A concrete request handler subclass must define a " @@ -446,73 +452,94 @@ msgid "" "instance of the subclass is created for each request." msgstr "" -#: ../../library/socketserver.rst:407 +#: ../../library/socketserver.rst:412 msgid "" "Called before the :meth:`handle` method to perform any initialization " "actions required. The default implementation does nothing." msgstr "" -#: ../../library/socketserver.rst:413 +#: ../../library/socketserver.rst:418 msgid "" "This function must do all the work required to service a request. The " "default implementation does nothing. Several instance attributes are " -"available to it; the request is available as :attr:`self.request`; the " -"client address as :attr:`self.client_address`; and the server instance as :" -"attr:`self.server`, in case it needs access to per-server information." +"available to it; the request is available as :attr:`request`; the client " +"address as :attr:`client_address`; and the server instance as :attr:" +"`server`, in case it needs access to per-server information." msgstr "" -#: ../../library/socketserver.rst:419 +#: ../../library/socketserver.rst:424 msgid "" -"The type of :attr:`self.request` is different for datagram or stream " -"services. For stream services, :attr:`self.request` is a socket object; for " -"datagram services, :attr:`self.request` is a pair of string and socket." +"The type of :attr:`request` is different for datagram or stream services. " +"For stream services, :attr:`request` is a socket object; for datagram " +"services, :attr:`request` is a pair of string and socket." msgstr "" -#: ../../library/socketserver.rst:426 +#: ../../library/socketserver.rst:431 msgid "" "Called after the :meth:`handle` method to perform any clean-up actions " "required. The default implementation does nothing. If :meth:`setup` raises " "an exception, this function will not be called." msgstr "" -#: ../../library/socketserver.rst:434 +#: ../../library/socketserver.rst:438 +msgid "" +"The *new* :class:`socket.socket` object to be used to communicate with the " +"client." +msgstr "" + +#: ../../library/socketserver.rst:444 +msgid "Client address returned by :meth:`BaseServer.get_request`." +msgstr "" + +#: ../../library/socketserver.rst:449 +msgid ":class:`BaseServer` object used for handling the request." +msgstr "" + +#: ../../library/socketserver.rst:455 msgid "" "These :class:`BaseRequestHandler` subclasses override the :meth:" "`~BaseRequestHandler.setup` and :meth:`~BaseRequestHandler.finish` methods, " -"and provide :attr:`self.rfile` and :attr:`self.wfile` attributes. The :attr:" -"`self.rfile` and :attr:`self.wfile` attributes can be read or written, " -"respectively, to get the request data or return data to the client. The :" -"attr:`!rfile` attributes support the :class:`io.BufferedIOBase` readable " -"interface, and :attr:`!wfile` attributes support the :class:`!io." -"BufferedIOBase` writable interface." +"and provide :attr:`rfile` and :attr:`wfile` attributes." msgstr "" -#: ../../library/socketserver.rst:443 +#: ../../library/socketserver.rst:461 msgid "" -":attr:`StreamRequestHandler.wfile` also supports the :class:`io." -"BufferedIOBase` writable interface." +"A file object from which receives the request is read. Support the :class:" +"`io.BufferedIOBase` readable interface." msgstr "" -#: ../../library/socketserver.rst:449 +#: ../../library/socketserver.rst:466 +msgid "" +"A file object to which the reply is written. Support the :class:`io." +"BufferedIOBase` writable interface" +msgstr "" + +#: ../../library/socketserver.rst:470 +msgid "" +":attr:`wfile` also supports the :class:`io.BufferedIOBase` writable " +"interface." +msgstr "" + +#: ../../library/socketserver.rst:476 msgid "Examples" msgstr "範例" -#: ../../library/socketserver.rst:452 +#: ../../library/socketserver.rst:479 msgid ":class:`socketserver.TCPServer` Example" msgstr ":class:`socketserver.TCPServer` 範例" -#: ../../library/socketserver.rst:454 ../../library/socketserver.rst:553 +#: ../../library/socketserver.rst:481 ../../library/socketserver.rst:580 msgid "This is the server side::" msgstr "" -#: ../../library/socketserver.rst:484 +#: ../../library/socketserver.rst:511 msgid "" "An alternative request handler class that makes use of streams (file-like " "objects that simplify communication by providing the standard file " "interface)::" msgstr "" -#: ../../library/socketserver.rst:499 +#: ../../library/socketserver.rst:526 msgid "" "The difference is that the ``readline()`` call in the second handler will " "call ``recv()`` multiple times until it encounters a newline character, " @@ -520,47 +547,47 @@ msgid "" "has been sent from the client in one ``sendall()`` call." msgstr "" -#: ../../library/socketserver.rst:505 ../../library/socketserver.rst:577 +#: ../../library/socketserver.rst:532 ../../library/socketserver.rst:604 msgid "This is the client side::" msgstr "" -#: ../../library/socketserver.rst:526 ../../library/socketserver.rst:652 +#: ../../library/socketserver.rst:553 ../../library/socketserver.rst:679 msgid "The output of the example should look something like this:" msgstr "" -#: ../../library/socketserver.rst:528 +#: ../../library/socketserver.rst:555 msgid "Server:" msgstr "" -#: ../../library/socketserver.rst:538 +#: ../../library/socketserver.rst:565 msgid "Client:" msgstr "" -#: ../../library/socketserver.rst:551 +#: ../../library/socketserver.rst:578 msgid ":class:`socketserver.UDPServer` Example" msgstr ":class:`socketserver.UDPServer` 範例" -#: ../../library/socketserver.rst:596 +#: ../../library/socketserver.rst:623 msgid "" "The output of the example should look exactly like for the TCP server " "example." msgstr "" -#: ../../library/socketserver.rst:600 +#: ../../library/socketserver.rst:627 msgid "Asynchronous Mixins" msgstr "" -#: ../../library/socketserver.rst:602 +#: ../../library/socketserver.rst:629 msgid "" "To build asynchronous handlers, use the :class:`ThreadingMixIn` and :class:" "`ForkingMixIn` classes." msgstr "" -#: ../../library/socketserver.rst:605 +#: ../../library/socketserver.rst:632 msgid "An example for the :class:`ThreadingMixIn` class::" msgstr "" -#: ../../library/socketserver.rst:663 +#: ../../library/socketserver.rst:690 msgid "" "The :class:`ForkingMixIn` class is used in the same way, except that the " "server will spawn a new process for each request. Available only on POSIX " diff --git a/library/sqlite3.po b/library/sqlite3.po index cacf25b635..af64d9d6f7 100644 --- a/library/sqlite3.po +++ b/library/sqlite3.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-10-11 17:13+0000\n" "PO-Revision-Date: 2018-05-23 16:10+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -2166,10 +2166,11 @@ msgid "" "manager does nothing." msgstr "" -#: ../../library/sqlite3.rst:2410 +#: ../../library/sqlite3.rst:2409 msgid "" "The context manager neither implicitly opens a new transaction nor closes " -"the connection." +"the connection. If you need a closing context manager, consider using :meth:" +"`contextlib.closing`." msgstr "" #: ../../library/sqlite3.rst:2443 diff --git a/library/statistics.po b/library/statistics.po index 7c0597019a..40db5fa227 100644 --- a/library/statistics.po +++ b/library/statistics.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-15 00:03+0000\n" +"POT-Creation-Date: 2023-10-11 17:13+0000\n" "PO-Revision-Date: 2023-07-22 21:15+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -28,13 +28,13 @@ msgstr ":mod:`statistics` --- 數學統計函式" msgid "**Source code:** :source:`Lib/statistics.py`" msgstr "**原始碼:**\\ :source:`Lib/statistics.py`" -#: ../../library/statistics.rst:21 +#: ../../library/statistics.rst:22 msgid "" "This module provides functions for calculating mathematical statistics of " "numeric (:class:`~numbers.Real`-valued) data." msgstr "這個模組提供計算數值 (:class:`Real`-valued) 資料的數學統計函式。" -#: ../../library/statistics.rst:24 +#: ../../library/statistics.rst:25 msgid "" "The module is not intended to be a competitor to third-party libraries such " "as `NumPy `_, `SciPy `_, or " @@ -46,7 +46,7 @@ msgstr "" ">`_ 等第三方函式庫,或者像 Minitab、SAS 和 Matlab 等專門設計給專業統計學家的" "高階統計軟體互相競爭。此模組的目標在於繪圖和科學計算。" -#: ../../library/statistics.rst:30 +#: ../../library/statistics.rst:31 msgid "" "Unless explicitly noted, these functions support :class:`int`, :class:" "`float`, :class:`~decimal.Decimal` and :class:`~fractions.Fraction`. " @@ -62,7 +62,7 @@ msgstr "" "輸入資料含有混合型別,你可以考慮使用 :func:`map` 來確保結果是一致的,例如:" "``map(float, input_data)``。" -#: ../../library/statistics.rst:38 +#: ../../library/statistics.rst:39 msgid "" "Some datasets use ``NaN`` (not a number) values to represent missing data. " "Since NaNs have unusual comparison semantics, they cause surprising or " @@ -78,186 +78,186 @@ msgstr "" "``median_grouped()``、 ``mode()``、 ``multimode()`` 以及 ``quantiles()``。在" "呼叫這些函數之前,應該先移除 NaN 值:" -#: ../../library/statistics.rst:68 +#: ../../library/statistics.rst:69 msgid "Averages and measures of central location" msgstr "平均值與中央位置量數" -#: ../../library/statistics.rst:70 +#: ../../library/statistics.rst:71 msgid "" "These functions calculate an average or typical value from a population or " "sample." msgstr "這些函式計算來自一個母體或樣本的平均值或代表值。" -#: ../../library/statistics.rst:74 +#: ../../library/statistics.rst:75 msgid ":func:`mean`" msgstr ":func:`mean`" -#: ../../library/statistics.rst:74 +#: ../../library/statistics.rst:75 msgid "Arithmetic mean (\"average\") of data." msgstr "資料的算術平均數(平均值)。" -#: ../../library/statistics.rst:75 +#: ../../library/statistics.rst:76 msgid ":func:`fmean`" msgstr ":func:`fmean`" -#: ../../library/statistics.rst:75 +#: ../../library/statistics.rst:76 msgid "Fast, floating point arithmetic mean, with optional weighting." msgstr "快速浮點數算數平均數,可調整權重。" -#: ../../library/statistics.rst:76 +#: ../../library/statistics.rst:77 msgid ":func:`geometric_mean`" msgstr ":func:`geometric_mean`" -#: ../../library/statistics.rst:76 +#: ../../library/statistics.rst:77 msgid "Geometric mean of data." msgstr "資料的幾何平均數。" -#: ../../library/statistics.rst:77 +#: ../../library/statistics.rst:78 msgid ":func:`harmonic_mean`" msgstr ":func:`harmonic_mean`" -#: ../../library/statistics.rst:77 +#: ../../library/statistics.rst:78 msgid "Harmonic mean of data." msgstr "資料的調和平均數。" -#: ../../library/statistics.rst:78 +#: ../../library/statistics.rst:79 msgid ":func:`median`" msgstr ":func:`median`" -#: ../../library/statistics.rst:78 +#: ../../library/statistics.rst:79 msgid "Median (middle value) of data." msgstr "資料的中位數(中間值)。" -#: ../../library/statistics.rst:79 +#: ../../library/statistics.rst:80 msgid ":func:`median_low`" msgstr ":func:`median_low`" -#: ../../library/statistics.rst:79 +#: ../../library/statistics.rst:80 msgid "Low median of data." msgstr "資料中較小的中位數。" -#: ../../library/statistics.rst:80 +#: ../../library/statistics.rst:81 msgid ":func:`median_high`" msgstr ":func:`median_high`" -#: ../../library/statistics.rst:80 +#: ../../library/statistics.rst:81 msgid "High median of data." msgstr "資料中較大的中位數。" -#: ../../library/statistics.rst:81 +#: ../../library/statistics.rst:82 msgid ":func:`median_grouped`" msgstr ":func:`median_grouped`" -#: ../../library/statistics.rst:81 +#: ../../library/statistics.rst:82 msgid "Median, or 50th percentile, of grouped data." msgstr "分組資料的中位數或 50% 處。" -#: ../../library/statistics.rst:82 +#: ../../library/statistics.rst:83 msgid ":func:`mode`" msgstr ":func:`mode`" -#: ../../library/statistics.rst:82 +#: ../../library/statistics.rst:83 msgid "Single mode (most common value) of discrete or nominal data." msgstr "" "離散 (discrete) 或名目 (nomial) 資料中的眾數(出現次數最多次的值),只回傳一" "個。" -#: ../../library/statistics.rst:83 +#: ../../library/statistics.rst:84 msgid ":func:`multimode`" msgstr ":func:`multimode`" -#: ../../library/statistics.rst:83 +#: ../../library/statistics.rst:84 msgid "List of modes (most common values) of discrete or nominal data." msgstr "離散或名目資料中的眾數(出現次數最多次的值)組成的 list。" -#: ../../library/statistics.rst:84 +#: ../../library/statistics.rst:85 msgid ":func:`quantiles`" msgstr ":func:`quantiles`" -#: ../../library/statistics.rst:84 +#: ../../library/statistics.rst:85 msgid "Divide data into intervals with equal probability." msgstr "將資料分成數個具有相等機率的區間,即分位數 (quantile)。" -#: ../../library/statistics.rst:88 +#: ../../library/statistics.rst:89 msgid "Measures of spread" msgstr "離度 (spread) 的測量" -#: ../../library/statistics.rst:90 +#: ../../library/statistics.rst:91 msgid "" "These functions calculate a measure of how much the population or sample " "tends to deviate from the typical or average values." msgstr "這些函式計算母體或樣本偏離平均值的程度。" -#: ../../library/statistics.rst:94 +#: ../../library/statistics.rst:95 msgid ":func:`pstdev`" msgstr ":func:`pstdev`" -#: ../../library/statistics.rst:94 +#: ../../library/statistics.rst:95 msgid "Population standard deviation of data." msgstr "資料的母體標準差。" -#: ../../library/statistics.rst:95 +#: ../../library/statistics.rst:96 msgid ":func:`pvariance`" msgstr ":func:`pvariance`" -#: ../../library/statistics.rst:95 +#: ../../library/statistics.rst:96 msgid "Population variance of data." msgstr "資料的母體變異數。" -#: ../../library/statistics.rst:96 +#: ../../library/statistics.rst:97 msgid ":func:`stdev`" msgstr ":func:`stdev`" -#: ../../library/statistics.rst:96 +#: ../../library/statistics.rst:97 msgid "Sample standard deviation of data." msgstr "資料的樣本標準差。" -#: ../../library/statistics.rst:97 +#: ../../library/statistics.rst:98 msgid ":func:`variance`" msgstr ":func:`variance`" -#: ../../library/statistics.rst:97 +#: ../../library/statistics.rst:98 msgid "Sample variance of data." msgstr "資料的樣本變異數。" -#: ../../library/statistics.rst:101 +#: ../../library/statistics.rst:102 msgid "Statistics for relations between two inputs" msgstr "兩個輸入之間的關係統計" -#: ../../library/statistics.rst:103 +#: ../../library/statistics.rst:104 msgid "" "These functions calculate statistics regarding relations between two inputs." msgstr "這些函式計算兩個輸入之間的關係統計數據。" -#: ../../library/statistics.rst:106 +#: ../../library/statistics.rst:107 msgid ":func:`covariance`" msgstr ":func:`covariance`" -#: ../../library/statistics.rst:106 +#: ../../library/statistics.rst:107 msgid "Sample covariance for two variables." msgstr "兩變數的樣本共變異數。" -#: ../../library/statistics.rst:107 +#: ../../library/statistics.rst:108 msgid ":func:`correlation`" msgstr ":func:`correlation`" -#: ../../library/statistics.rst:107 +#: ../../library/statistics.rst:108 msgid "Pearson and Spearman's correlation coefficients." msgstr "Pearson 與 Spearman 相關係數 (correlation coefficient)。" -#: ../../library/statistics.rst:108 +#: ../../library/statistics.rst:109 msgid ":func:`linear_regression`" msgstr ":func:`linear_regression`" -#: ../../library/statistics.rst:108 +#: ../../library/statistics.rst:109 msgid "Slope and intercept for simple linear regression." msgstr "簡單線性迴歸的斜率和截距。" -#: ../../library/statistics.rst:113 +#: ../../library/statistics.rst:114 msgid "Function details" msgstr "函式細節" -#: ../../library/statistics.rst:115 +#: ../../library/statistics.rst:116 msgid "" "Note: The functions do not require the data given to them to be sorted. " "However, for reading convenience, most of the examples show sorted sequences." @@ -265,13 +265,13 @@ msgstr "" "註:這些函數並不要求輸入的資料必須排序過。為了閱讀方便,大部份的範例仍已排序" "過。" -#: ../../library/statistics.rst:120 +#: ../../library/statistics.rst:121 msgid "" "Return the sample arithmetic mean of *data* which can be a sequence or " "iterable." msgstr "回傳 *data* 的樣本算數平均數,輸入可為一個 sequence 或者 iterable。" -#: ../../library/statistics.rst:122 +#: ../../library/statistics.rst:123 msgid "" "The arithmetic mean is the sum of the data divided by the number of data " "points. It is commonly called \"the average\", although it is only one of " @@ -281,15 +281,15 @@ msgstr "" "算數平均數為資料總和除以資料點的數目。他通常被稱為「平均值」,儘管它只是眾多" "不同的數學平均值之一。它是衡量資料集中位置的一種指標。" -#: ../../library/statistics.rst:127 +#: ../../library/statistics.rst:128 msgid "If *data* is empty, :exc:`StatisticsError` will be raised." msgstr "若 *data* 為空,則會引發 :exc:`StatisticsError`。" -#: ../../library/statistics.rst:129 +#: ../../library/statistics.rst:130 msgid "Some examples of use:" msgstr "使用範例:" -#: ../../library/statistics.rst:148 +#: ../../library/statistics.rst:149 msgid "" "The mean is strongly affected by `outliers `_ and is not necessarily a typical example of the data points. For " @@ -301,7 +301,7 @@ msgstr "" "低的\\ `集中趨勢 (central tendency) `_ 度量,請參考 :func:`median`。" -#: ../../library/statistics.rst:154 +#: ../../library/statistics.rst:155 msgid "" "The sample mean gives an unbiased estimate of the true population mean, so " "that when taken on average over all the possible samples, ``mean(sample)`` " @@ -314,11 +314,11 @@ msgstr "" "*data* 為整個母體而非單一樣本,則 ``mean(data)`` 等同於計算真實的母體平均數 " "μ。" -#: ../../library/statistics.rst:163 +#: ../../library/statistics.rst:164 msgid "Convert *data* to floats and compute the arithmetic mean." msgstr "將 *data* 轉換為浮點數並計算其算數平均數。" -#: ../../library/statistics.rst:165 +#: ../../library/statistics.rst:166 msgid "" "This runs faster than the :func:`mean` function and it always returns a :" "class:`float`. The *data* may be a sequence or iterable. If the input " @@ -328,7 +328,7 @@ msgstr "" "可以是一個 sequence 或者 iterable。如果輸入的資料為空,則引發 :exc:" "`StatisticsError`。" -#: ../../library/statistics.rst:174 +#: ../../library/statistics.rst:175 msgid "" "Optional weighting is supported. For example, a professor assigns a grade " "for a course by weighting quizzes at 20%, homework at 20%, a midterm exam at " @@ -337,7 +337,7 @@ msgstr "" "支援選擇性的加權。例如,一位教授以 20% 的比重計算小考分數,20% 的比重計算作業" "分數,30% 的比重計算期中考試分數,以及 30% 的比重計算期末考試分數:" -#: ../../library/statistics.rst:185 +#: ../../library/statistics.rst:186 msgid "" "If *weights* is supplied, it must be the same length as the *data* or a :exc:" "`ValueError` will be raised." @@ -345,15 +345,15 @@ msgstr "" "如果有提供 *weights*,它必須與 *data* 長度相同,否則將引發 :exc:" "`ValueError`。" -#: ../../library/statistics.rst:190 ../../library/statistics.rst:258 +#: ../../library/statistics.rst:191 ../../library/statistics.rst:259 msgid "Added support for *weights*." msgstr "新增 *weights* 的支援。" -#: ../../library/statistics.rst:196 +#: ../../library/statistics.rst:197 msgid "Convert *data* to floats and compute the geometric mean." msgstr "將 *data* 轉換成浮點數並計算其幾何平均數。" -#: ../../library/statistics.rst:198 +#: ../../library/statistics.rst:199 msgid "" "The geometric mean indicates the central tendency or typical value of the " "*data* using the product of the values (as opposed to the arithmetic mean " @@ -362,7 +362,7 @@ msgstr "" "幾何平均數使用數值的乘積(與之對照,算數平均數使用的是數值的和)來表示 " "*data* 的集中趨勢或典型值。" -#: ../../library/statistics.rst:202 +#: ../../library/statistics.rst:203 msgid "" "Raises a :exc:`StatisticsError` if the input dataset is empty, if it " "contains a zero, or if it contains a negative value. The *data* may be a " @@ -371,13 +371,13 @@ msgstr "" "若輸入的資料集為空、包含零、包含負值,則引發 :exc:`StatisticsError`。*data* " "可為 sequence 或者 iterable。" -#: ../../library/statistics.rst:206 +#: ../../library/statistics.rst:207 msgid "" "No special efforts are made to achieve exact results. (However, this may " "change in the future.)" msgstr "目前沒有特別為了精確結果而特別多下什麼工夫。(然而,未來或許會有。)" -#: ../../library/statistics.rst:219 +#: ../../library/statistics.rst:220 msgid "" "Return the harmonic mean of *data*, a sequence or iterable of real-valued " "numbers. If *weights* is omitted or *None*, then equal weighting is assumed." @@ -385,7 +385,7 @@ msgstr "" "回傳 *data* 的調和平均數。*data* 可為實數 (real-valued) sequence 或者 " "iterable。如果省略 *weights* 或者 *weights* 為 *None*,則假設各權重相等。" -#: ../../library/statistics.rst:223 +#: ../../library/statistics.rst:224 msgid "" "The harmonic mean is the reciprocal of the arithmetic :func:`mean` of the " "reciprocals of the data. For example, the harmonic mean of three values *a*, " @@ -396,7 +396,7 @@ msgstr "" "三個數 *a*,*b* 與 *c* 的調和平均數等於 ``3/(1/a + 1/b + 1/c)``。若其中一個值" "為零,結果將為零。" -#: ../../library/statistics.rst:228 +#: ../../library/statistics.rst:229 msgid "" "The harmonic mean is a type of average, a measure of the central location of " "the data. It is often appropriate when averaging ratios or rates, for " @@ -405,7 +405,7 @@ msgstr "" "調和平均數是一種平均數,是衡量資料中心位置的一種方法。它通常用於計算比率 " "(ratio) 或率 (rate) 的平均,例如速率(speed)。" -#: ../../library/statistics.rst:232 +#: ../../library/statistics.rst:233 msgid "" "Suppose a car travels 10 km at 40 km/hr, then another 10 km at 60 km/hr. " "What is the average speed?" @@ -413,7 +413,7 @@ msgstr "" "假設一輛汽車以時速 40 公里的速率行駛 10 公里,然後再以時速 60 公里的速率行駛 " "10 公里,求汽車的平均速率?" -#: ../../library/statistics.rst:240 +#: ../../library/statistics.rst:241 msgid "" "Suppose a car travels 40 km/hr for 5 km, and when traffic clears, speeds-up " "to 60 km/hr for the remaining 30 km of the journey. What is the average " @@ -422,7 +422,7 @@ msgstr "" "假設一輛汽車以時速 40 公里的速率行駛 5 公里,然後在交通順暢時,加速到時速 60 " "公里,以此速度行駛剩下的 30 公里。求汽車的平均速率?" -#: ../../library/statistics.rst:249 +#: ../../library/statistics.rst:250 msgid "" ":exc:`StatisticsError` is raised if *data* is empty, any element is less " "than zero, or if the weighted sum isn't positive." @@ -430,7 +430,7 @@ msgstr "" "若 *data* 為空、含有任何小於零的元素、或者加權總和不為正數,則引發 :exc:" "`StatisticsError`。" -#: ../../library/statistics.rst:252 +#: ../../library/statistics.rst:253 msgid "" "The current algorithm has an early-out when it encounters a zero in the " "input. This means that the subsequent inputs are not tested for validity. " @@ -439,7 +439,7 @@ msgstr "" "目前的演算法設計為,若在輸入當中遇到零,則會提前退出。這意味著後續的輸入並未" "進行有效性檢查。(這種行為在未來可能會改變。)" -#: ../../library/statistics.rst:263 +#: ../../library/statistics.rst:264 msgid "" "Return the median (middle value) of numeric data, using the common \"mean of " "middle two\" method. If *data* is empty, :exc:`StatisticsError` is raised. " @@ -448,7 +448,7 @@ msgstr "" "使用常見的「中間兩數取平均」方法回傳數值資料的中位數 (中間值)。若 *data* 為" "空,則會引發 :exc:`StatisticsError`。*data* 可為一個 sequence 或者 iterable。" -#: ../../library/statistics.rst:267 +#: ../../library/statistics.rst:268 msgid "" "The median is a robust measure of central location and is less affected by " "the presence of outliers. When the number of data points is odd, the middle " @@ -457,13 +457,13 @@ msgstr "" "中位數是一種穩健的衡量資料中心位置的方法,較不易被離群值影響。當資料點數量為" "奇數時,會回傳中間的資料點:" -#: ../../library/statistics.rst:276 +#: ../../library/statistics.rst:277 msgid "" "When the number of data points is even, the median is interpolated by taking " "the average of the two middle values:" msgstr "當資料點數量為偶數時,中位數透過中間兩個值的平均數來插值計算:" -#: ../../library/statistics.rst:284 +#: ../../library/statistics.rst:285 msgid "" "This is suited for when your data is discrete, and you don't mind that the " "median may not be an actual data point." @@ -471,7 +471,7 @@ msgstr "" "若你的資料為離散資料,並且你不介意中位數可能並非真實的資料點,那這函式適合" "你。" -#: ../../library/statistics.rst:287 +#: ../../library/statistics.rst:288 msgid "" "If the data is ordinal (supports order operations) but not numeric (doesn't " "support addition), consider using :func:`median_low` or :func:`median_high` " @@ -480,7 +480,7 @@ msgstr "" "若你的資料為順序 (ordinal) 資料(支援排序操作)但並非數值型(不支援加法),可" "以考慮改用 :func:`median_low` 或是 :func:`median_high` 代替。" -#: ../../library/statistics.rst:293 +#: ../../library/statistics.rst:294 msgid "" "Return the low median of numeric data. If *data* is empty, :exc:" "`StatisticsError` is raised. *data* can be a sequence or iterable." @@ -488,7 +488,7 @@ msgstr "" "回傳數值型資料的低中位數 (low median)。若 *data* 為空,則引發 :exc:" "`StatisticsError`。*data* 可為 sequence 或者 iterable。" -#: ../../library/statistics.rst:296 +#: ../../library/statistics.rst:297 msgid "" "The low median is always a member of the data set. When the number of data " "points is odd, the middle value is returned. When it is even, the smaller " @@ -497,7 +497,7 @@ msgstr "" "低中位數一定會在原本的資料集當中。當資料點數量為奇數時,回傳中間值。當數量為" "偶數時,回傳兩個中間值當中較小的值。" -#: ../../library/statistics.rst:307 +#: ../../library/statistics.rst:308 msgid "" "Use the low median when your data are discrete and you prefer the median to " "be an actual data point rather than interpolated." @@ -505,7 +505,7 @@ msgstr "" "當你的資料為離散資料,且你希望中位數是實際的資料點而不是插值時,可以用低中位" "數。" -#: ../../library/statistics.rst:313 +#: ../../library/statistics.rst:314 msgid "" "Return the high median of data. If *data* is empty, :exc:`StatisticsError` " "is raised. *data* can be a sequence or iterable." @@ -513,7 +513,7 @@ msgstr "" "回傳數值型資料的高中位數 (high median)。若 *data* 為空,則引發 :exc:" "`StatisticsError`。*data* 可為 sequence 或者 iterable。" -#: ../../library/statistics.rst:316 +#: ../../library/statistics.rst:317 msgid "" "The high median is always a member of the data set. When the number of data " "points is odd, the middle value is returned. When it is even, the larger of " @@ -522,7 +522,7 @@ msgstr "" "高中位數一定會在原本的資料集當中。當資料點數量為奇數時,回傳中間值。當數量為" "偶數時,回傳兩個中間值當中較大的值。" -#: ../../library/statistics.rst:327 +#: ../../library/statistics.rst:328 msgid "" "Use the high median when your data are discrete and you prefer the median to " "be an actual data point rather than interpolated." @@ -530,7 +530,7 @@ msgstr "" "當你的資料為離散資料,且你希望中位數是實際的資料點而不是插值時,可以用高中位" "數。" -#: ../../library/statistics.rst:333 +#: ../../library/statistics.rst:334 msgid "" "Return the median of grouped continuous data, calculated as the 50th " "percentile, using interpolation. If *data* is empty, :exc:`StatisticsError` " @@ -540,7 +540,7 @@ msgstr "" "為空,則會引發 :exc:`StatisticsError`。*data* 可為一個 sequence 或者 " "iterable。" -#: ../../library/statistics.rst:342 +#: ../../library/statistics.rst:343 msgid "" "In the following example, the data are rounded, so that each value " "represents the midpoint of data classes, e.g. 1 is the midpoint of the class " @@ -552,7 +552,7 @@ msgstr "" "0.5--1.5 的中點,2 是組 1.5--2.5 的中點,3 是組 2.5--3.5 的中點等。根據輸入的" "資料,中間值落在 3.5--4.5 的組別中,並使用內插法來估計它:" -#: ../../library/statistics.rst:353 +#: ../../library/statistics.rst:354 msgid "" "Optional argument *interval* represents the class interval, and defaults to " "1. Changing the class interval naturally will change the interpolation:" @@ -560,13 +560,13 @@ msgstr "" "選擇性引數 *interval* 表示組距 (class interval),預設值為 1。改變組距自然會改" "變內插值:" -#: ../../library/statistics.rst:363 +#: ../../library/statistics.rst:364 msgid "" "This function does not check whether the data points are at least *interval* " "apart." msgstr "此函式不檢查資料點是否至少間隔 *interval* 以上。" -#: ../../library/statistics.rst:368 +#: ../../library/statistics.rst:369 msgid "" "Under some circumstances, :func:`median_grouped` may coerce data points to " "floats. This behaviour is likely to change in the future." @@ -574,7 +574,7 @@ msgstr "" "在部份情況下,:func:`median_grouped` 可能會強制將資料點轉換為浮點數。這種行為" "在未來可能會改變。" -#: ../../library/statistics.rst:373 +#: ../../library/statistics.rst:374 msgid "" "\"Statistics for the Behavioral Sciences\", Frederick J Gravetter and Larry " "B Wallnau (8th Edition)." @@ -582,7 +582,7 @@ msgstr "" "\"Statistics for the Behavioral Sciences\", Frederick J Gravetter and Larry " "B Wallnau (8th Edition)." -#: ../../library/statistics.rst:376 +#: ../../library/statistics.rst:377 msgid "" "The `SSMEDIAN `_ function in the Gnome Gnumeric " @@ -593,7 +593,7 @@ msgstr "" "stable/gnumeric.html#gnumeric-function-SSMEDIAN>`_ 函式,包括\\ `這篇討論 " "`_。" -#: ../../library/statistics.rst:384 +#: ../../library/statistics.rst:385 msgid "" "Return the single most common data point from discrete or nominal *data*. " "The mode (when it exists) is the most typical value and serves as a measure " @@ -602,7 +602,7 @@ msgstr "" "回傳離散或名目 *data* 中出現次數最多次的值,只回傳一個。眾數(如果存在)是最" "典型的值,並用來衡量資料的中心位置。" -#: ../../library/statistics.rst:388 +#: ../../library/statistics.rst:389 msgid "" "If there are multiple modes with the same frequency, returns the first one " "encountered in the *data*. If the smallest or largest of those is desired " @@ -614,20 +614,20 @@ msgstr "" "``max(multimode(data))``。如果輸入的 *data* 為空,則會引發 :exc:" "`StatisticsError`。" -#: ../../library/statistics.rst:393 +#: ../../library/statistics.rst:394 msgid "" "``mode`` assumes discrete data and returns a single value. This is the " "standard treatment of the mode as commonly taught in schools:" msgstr "" "``mode`` 假定為離散資料,並回傳單一的值。這也是一般學校教授的標準眾數定義:" -#: ../../library/statistics.rst:401 +#: ../../library/statistics.rst:402 msgid "" "The mode is unique in that it is the only statistic in this package that " "also applies to nominal (non-numeric) data:" msgstr "眾數特別之處在於它是此套件中唯一也適用於名目(非數值型)資料的統計量:" -#: ../../library/statistics.rst:409 +#: ../../library/statistics.rst:410 msgid "" "Now handles multimodal datasets by returning the first mode encountered. " "Formerly, it raised :exc:`StatisticsError` when more than one mode was found." @@ -635,7 +635,7 @@ msgstr "" "現在,遇到資料中有多個眾數時,會回傳第一個遇到的眾數。在以前,當找到大於一個" "眾數時,會引發 :exc:`StatisticsError`。" -#: ../../library/statistics.rst:417 +#: ../../library/statistics.rst:418 msgid "" "Return a list of the most frequently occurring values in the order they were " "first encountered in the *data*. Will return more than one result if there " @@ -645,7 +645,7 @@ msgstr "" "次出現的順序排列。如果有多個眾數,將會回傳所有結果。若 *data* 為空,則回傳空" "的 list:" -#: ../../library/statistics.rst:433 +#: ../../library/statistics.rst:434 msgid "" "Return the population standard deviation (the square root of the population " "variance). See :func:`pvariance` for arguments and other details." @@ -653,7 +653,7 @@ msgstr "" "回傳母體標準差(即母體變異數的平方根)。有關引數以及其他細節,請參見 :func:" "`pvariance`。" -#: ../../library/statistics.rst:444 +#: ../../library/statistics.rst:445 msgid "" "Return the population variance of *data*, a non-empty sequence or iterable " "of real-valued numbers. Variance, or second moment about the mean, is a " @@ -665,7 +665,7 @@ msgstr "" "數,或者以平均數為中心的二階動差,用於衡量資料的變異性(離度或分散程度)。變" "異數大表示資料分散,變異數小表示資料集中在平均數附近。" -#: ../../library/statistics.rst:450 +#: ../../library/statistics.rst:451 msgid "" "If the optional second argument *mu* is given, it is typically the mean of " "the *data*. It can also be used to compute the second moment around a point " @@ -676,7 +676,7 @@ msgstr "" "算非以平均值為中心的第二動差。如果沒有傳入此引數或者引數為 `None` (預設" "值),則自動計算資料的算數平均數。" -#: ../../library/statistics.rst:455 +#: ../../library/statistics.rst:456 msgid "" "Use this function to calculate the variance from the entire population. To " "estimate the variance from a sample, the :func:`variance` function is " @@ -685,16 +685,16 @@ msgstr "" "使用此函式來計算整個母體的變異數。如果要從樣本估算變異數,:func:`variance` 通" "常是較好的選擇。" -#: ../../library/statistics.rst:459 +#: ../../library/statistics.rst:460 msgid "Raises :exc:`StatisticsError` if *data* is empty." msgstr "若 *data* 為空,則引發 :exc:`StatisticsError`。" -#: ../../library/statistics.rst:461 ../../library/statistics.rst:531 -#: ../../library/statistics.rst:635 +#: ../../library/statistics.rst:462 ../../library/statistics.rst:532 +#: ../../library/statistics.rst:636 msgid "Examples:" msgstr "範例:" -#: ../../library/statistics.rst:469 +#: ../../library/statistics.rst:470 msgid "" "If you have already calculated the mean of your data, you can pass it as the " "optional second argument *mu* to avoid recalculation:" @@ -702,11 +702,11 @@ msgstr "" "如果已經計算出資料的平均值,你可以將其作為選擇性的第二個引數 *mu* 傳遞以避免" "重新計算:" -#: ../../library/statistics.rst:478 +#: ../../library/statistics.rst:479 msgid "Decimals and Fractions are supported:" msgstr "支援小數 (decimal) 與分數 (fraction):" -#: ../../library/statistics.rst:492 +#: ../../library/statistics.rst:493 msgid "" "When called with the entire population, this gives the population variance " "σ². When called on a sample instead, this is the biased sample variance s², " @@ -715,7 +715,7 @@ msgstr "" "當在整個母體上呼叫此函式時,會回傳母體變異數 σ²。當在樣本上呼叫此函式時,會回" "傳有偏差的樣本變異數 s²,也就是具有 N 個自由度的變異數。" -#: ../../library/statistics.rst:496 +#: ../../library/statistics.rst:497 msgid "" "If you somehow know the true population mean μ, you may use this function to " "calculate the variance of a sample, giving the known population mean as the " @@ -727,7 +727,7 @@ msgstr "" "引數提供給此函式,用以計算樣本的變異數。只要資料點是母體的隨機樣本,結果將是" "母體變異數的不偏估計。" -#: ../../library/statistics.rst:505 +#: ../../library/statistics.rst:506 msgid "" "Return the sample standard deviation (the square root of the sample " "variance). See :func:`variance` for arguments and other details." @@ -735,7 +735,7 @@ msgstr "" "回傳樣本標準差(即樣本變異數的平方根)。有關引數以及其他細節,請參見 :func:" "`variance`。" -#: ../../library/statistics.rst:516 +#: ../../library/statistics.rst:517 msgid "" "Return the sample variance of *data*, an iterable of at least two real-" "valued numbers. Variance, or second moment about the mean, is a measure of " @@ -747,7 +747,7 @@ msgstr "" "平均數為中心的二階動差,用於衡量資料的變異性(離度或分散程度)。變異數大表示" "資料分散,變異數小表示資料集中在平均數附近。" -#: ../../library/statistics.rst:522 +#: ../../library/statistics.rst:523 msgid "" "If the optional second argument *xbar* is given, it should be the mean of " "*data*. If it is missing or ``None`` (the default), the mean is " @@ -756,7 +756,7 @@ msgstr "" "若有傳入選擇性的第二個引數 *xbar*,它應該是 *data* 的平均值。如果沒有傳入或者" "為 ``None`` (預設值),則自動計算資料的平均值。" -#: ../../library/statistics.rst:526 +#: ../../library/statistics.rst:527 msgid "" "Use this function when your data is a sample from a population. To calculate " "the variance from the entire population, see :func:`pvariance`." @@ -764,11 +764,11 @@ msgstr "" "當你的資料是來自母體的樣本時,請使用此函式。若要從整個母體計算變異數,請參" "見 :func:`pvariance`。" -#: ../../library/statistics.rst:529 +#: ../../library/statistics.rst:530 msgid "Raises :exc:`StatisticsError` if *data* has fewer than two values." msgstr "若 *data* 內少於兩個值,則引發 :exc:`StatisticsError`。" -#: ../../library/statistics.rst:539 +#: ../../library/statistics.rst:540 msgid "" "If you have already calculated the mean of your data, you can pass it as the " "optional second argument *xbar* to avoid recalculation:" @@ -776,7 +776,7 @@ msgstr "" "如果已經計算出資料的平均值,你可以將其作為選擇性的第二個引數 *mu* 傳遞以避免" "重新計算:" -#: ../../library/statistics.rst:548 +#: ../../library/statistics.rst:549 msgid "" "This function does not attempt to verify that you have passed the actual " "mean as *xbar*. Using arbitrary values for *xbar* can lead to invalid or " @@ -785,11 +785,11 @@ msgstr "" "此函式不會驗證你傳入的 *xbar* 是否為實際的平均數。傳入任意的 *xbar* 會導致無" "效或不可能的結果。" -#: ../../library/statistics.rst:552 +#: ../../library/statistics.rst:553 msgid "Decimal and Fraction values are supported:" msgstr "支援小數 (decimal) 與分數 (fraction):" -#: ../../library/statistics.rst:566 +#: ../../library/statistics.rst:567 msgid "" "This is the sample variance s² with Bessel's correction, also known as " "variance with N-1 degrees of freedom. Provided that the data points are " @@ -800,7 +800,7 @@ msgstr "" "為 N-1 的變異數。只要資料點具有代表性(例如:獨立且具有相同分布),結果應該會" "是對真實母體變異數的不偏估計。" -#: ../../library/statistics.rst:571 +#: ../../library/statistics.rst:572 msgid "" "If you somehow know the actual population mean μ you should pass it to the :" "func:`pvariance` function as the *mu* parameter to get the variance of a " @@ -809,7 +809,7 @@ msgstr "" "若你剛好知道真正的母體平均數 μ,你應該將其作為 *mu* 參數傳入 :func:" "`pvariance` 函式來計算樣本變異數。" -#: ../../library/statistics.rst:577 +#: ../../library/statistics.rst:578 msgid "" "Divide *data* into *n* continuous intervals with equal probability. Returns " "a list of ``n - 1`` cut points separating the intervals." @@ -817,7 +817,7 @@ msgstr "" "將 *data* 分成 *n* 個具有相等機率的連續區間。回傳一個包含 ``n - 1`` 個用於切" "分各區間的分隔點的 list。" -#: ../../library/statistics.rst:580 +#: ../../library/statistics.rst:581 msgid "" "Set *n* to 4 for quartiles (the default). Set *n* to 10 for deciles. Set " "*n* to 100 for percentiles which gives the 99 cuts points that separate " @@ -828,7 +828,7 @@ msgstr "" "分位數 (percentile),這將給出 99 個分隔點將 *data* 分成 100 個大小相等的組。" "如果 *n* 不是至少為 1,則引發 :exc:`StatisticsError`。" -#: ../../library/statistics.rst:585 +#: ../../library/statistics.rst:586 msgid "" "The *data* can be any iterable containing sample data. For meaningful " "results, the number of data points in *data* should be larger than *n*. " @@ -837,7 +837,7 @@ msgstr "" "*data* 可以是包含樣本資料的任何 iterable。為了取得有意義的結果,*data* 中的資" "料點數量應大於 *n*。如果資料點少於兩個,則引發 :exc:`StatisticsError`。" -#: ../../library/statistics.rst:589 +#: ../../library/statistics.rst:590 msgid "" "The cut points are linearly interpolated from the two nearest data points. " "For example, if a cut point falls one-third of the distance between two " @@ -846,7 +846,7 @@ msgstr "" "分隔點是從兩個最近的資料點線性內插值計算出來的。舉例來說,如果分隔點落在兩個" "樣本值 ``100`` 與 ``112`` 之間的距離三分之一處,則分隔點的值將為 ``104``。" -#: ../../library/statistics.rst:594 +#: ../../library/statistics.rst:595 msgid "" "The *method* for computing quantiles can be varied depending on whether the " "*data* includes or excludes the lowest and highest possible values from the " @@ -855,7 +855,7 @@ msgstr "" "計算分位數的 *method* 可以根據 *data* 是否包含或排除來自母體的最小與最大可能" "的值而改變。" -#: ../../library/statistics.rst:598 +#: ../../library/statistics.rst:599 msgid "" "The default *method* is \"exclusive\" and is used for data sampled from a " "population that can have more extreme values than found in the samples. The " @@ -869,7 +869,7 @@ msgstr "" "1)``。給定九個樣本資料,此方法將對資料排序且計算下列百分位數:10%、20%、30%、" "40%、50%、60%、70%、80%、90%。" -#: ../../library/statistics.rst:605 +#: ../../library/statistics.rst:606 msgid "" "Setting the *method* to \"inclusive\" is used for describing population data " "or for samples that are known to include the most extreme values from the " @@ -886,7 +886,7 @@ msgstr "" "給定十一個個樣本資料,此方法將對資料排序且計算下列百分位數:0%、10%、20%、" "30%、40%、50%、60%、70%、80%、90%、100%。" -#: ../../library/statistics.rst:629 +#: ../../library/statistics.rst:630 msgid "" "Return the sample covariance of two inputs *x* and *y*. Covariance is a " "measure of the joint variability of two inputs." @@ -894,14 +894,14 @@ msgstr "" "回傳兩輸入 *x* 與 *y* 的樣本共變異數 (sample covariance)。共變異數是衡量兩輸" "入的聯合變異性 (joint variability) 的指標。" -#: ../../library/statistics.rst:632 +#: ../../library/statistics.rst:633 msgid "" "Both inputs must be of the same length (no less than two), otherwise :exc:" "`StatisticsError` is raised." msgstr "" "兩輸入必須具有相同長度(至少兩個),否則會引發 :exc:`StatisticsError`。" -#: ../../library/statistics.rst:653 +#: ../../library/statistics.rst:654 msgid "" "Return the `Pearson's correlation coefficient `_ for two inputs. Pearson's correlation " @@ -912,7 +912,7 @@ msgstr "" "en.wikipedia.org/wiki/Pearson_correlation_coefficient>`_。Pearson 相關係數 " "*r* 的值介於 -1 與 +1 之間。它衡量線性關係的強度與方向。" -#: ../../library/statistics.rst:659 +#: ../../library/statistics.rst:660 msgid "" "If *method* is \"ranked\", computes `Spearman's rank correlation coefficient " "`_ " @@ -926,7 +926,7 @@ msgstr "" "則取平均,令相同的值排名也相同。所得係數衡量單調關係 (monotonic " "relationship) 的強度。" -#: ../../library/statistics.rst:665 +#: ../../library/statistics.rst:666 msgid "" "Spearman's correlation coefficient is appropriate for ordinal data or for " "continuous data that doesn't meet the linear proportion requirement for " @@ -935,7 +935,7 @@ msgstr "" "Spearman 相關係數適用於順序型資料,或者不符合 Pearson 相關係數要求的線性比例" "關係的連續型 (continuous) 資料。" -#: ../../library/statistics.rst:669 +#: ../../library/statistics.rst:670 msgid "" "Both inputs must be of the same length (no less than two), and need not to " "be constant, otherwise :exc:`StatisticsError` is raised." @@ -943,7 +943,7 @@ msgstr "" "兩輸入必須具有相同長度(至少兩個),且不須為常數,否則會引發 :exc:" "`StatisticsError`。" -#: ../../library/statistics.rst:672 +#: ../../library/statistics.rst:673 msgid "" "Example with `Kepler's laws of planetary motion `_:" @@ -951,11 +951,11 @@ msgstr "" "以 `Kepler 行星運動定律 `_\\ 為例:" -#: ../../library/statistics.rst:699 +#: ../../library/statistics.rst:700 msgid "Added support for Spearman's rank correlation coefficient." msgstr "新增了對 Spearman 等級相關係數的支援。" -#: ../../library/statistics.rst:704 +#: ../../library/statistics.rst:705 msgid "" "Return the slope and intercept of `simple linear regression `_ parameters estimated using " @@ -969,11 +969,11 @@ msgstr "" "迴歸描述自變數 (independent variable) *x* 與應變數 (dependent variable) *y* " "之間的關係,用以下的線性函式表示:" -#: ../../library/statistics.rst:710 +#: ../../library/statistics.rst:711 msgid "*y = slope \\* x + intercept + noise*" msgstr "*y = slope \\* x + intercept + noise*" -#: ../../library/statistics.rst:712 +#: ../../library/statistics.rst:713 msgid "" "where ``slope`` and ``intercept`` are the regression parameters that are " "estimated, and ``noise`` represents the variability of the data that was not " @@ -983,7 +983,7 @@ msgstr "" "其中 ``slope`` 和 ``intercept`` 是被估計的迴歸參數,而 ``noise`` 表示由線性迴" "歸未解釋的資料變異性(它等於應變數的預測值與實際值之差)。" -#: ../../library/statistics.rst:718 +#: ../../library/statistics.rst:719 msgid "" "Both inputs must be of the same length (no less than two), and the " "independent variable *x* cannot be constant; otherwise a :exc:" @@ -992,7 +992,7 @@ msgstr "" "兩輸入必須具有相同長度(至少兩個),且自變數 *x* 不得為常數,否則會引發 :exc:" "`StatisticsError`。" -#: ../../library/statistics.rst:722 +#: ../../library/statistics.rst:723 msgid "" "For example, we can use the `release dates of the Monty Python films " "`_ to predict the " @@ -1003,7 +1003,7 @@ msgstr "" "wikipedia.org/wiki/Monty_Python#Films>`_\\ 來預測至 2019 年為止,假設他們保持" "固定的製作速度,應該會產生的 Monty Python 電影的累計數量。" -#: ../../library/statistics.rst:736 +#: ../../library/statistics.rst:737 msgid "" "If *proportional* is true, the independent variable *x* and the dependent " "variable *y* are assumed to be directly proportional. The data is fit to a " @@ -1014,31 +1014,38 @@ msgstr "" "資料座落在通過原點的一直線上。由於 *intercept* 始終為 0.0,因此線性函式可簡化" "如下:" -#: ../../library/statistics.rst:742 +#: ../../library/statistics.rst:743 msgid "*y = slope \\* x + noise*" msgstr "*y = slope \\* x + noise*" -#: ../../library/statistics.rst:746 +#: ../../library/statistics.rst:745 +msgid "" +"Continuing the example from :func:`correlation`, we look to see how well a " +"model based on major planets can predict the orbital distances for dwarf " +"planets:" +msgstr "" + +#: ../../library/statistics.rst:765 msgid "Added support for *proportional*." msgstr "新增 *proportional* 的支援。" -#: ../../library/statistics.rst:750 +#: ../../library/statistics.rst:769 msgid "Exceptions" msgstr "例外" -#: ../../library/statistics.rst:752 +#: ../../library/statistics.rst:771 msgid "A single exception is defined:" msgstr "定義了一個單一的例外:" -#: ../../library/statistics.rst:756 +#: ../../library/statistics.rst:775 msgid "Subclass of :exc:`ValueError` for statistics-related exceptions." msgstr ":exc:`ValueError` 的子類別,用於和統計相關的例外。" -#: ../../library/statistics.rst:760 +#: ../../library/statistics.rst:779 msgid ":class:`NormalDist` objects" msgstr ":class:`NormalDist` 物件" -#: ../../library/statistics.rst:762 +#: ../../library/statistics.rst:781 msgid "" ":class:`NormalDist` is a tool for creating and manipulating normal " "distributions of a `random variable `_ 的常態分布的工" "具。它是一個將量測資料的平均數與標準差視為單一實體的類別。" -#: ../../library/statistics.rst:768 +#: ../../library/statistics.rst:787 msgid "" "Normal distributions arise from the `Central Limit Theorem `_ and have a wide range of " @@ -1058,7 +1065,7 @@ msgstr "" "常態分布源自於\\ `中央極限定理 (Central Limit Theorem) `_,在統計學中有著廣泛的應用。" -#: ../../library/statistics.rst:774 +#: ../../library/statistics.rst:793 msgid "" "Returns a new *NormalDist* object where *mu* represents the `arithmetic mean " "`_ and *sigma* represents the " @@ -1068,11 +1075,11 @@ msgstr "" "en.wikipedia.org/wiki/Arithmetic_mean>`_\\ 而 *sigma* 代表\\ `標準差 " "`_。" -#: ../../library/statistics.rst:779 +#: ../../library/statistics.rst:798 msgid "If *sigma* is negative, raises :exc:`StatisticsError`." msgstr "若 *sigma* 為負值,則引發 :exc:`StatisticsError`。" -#: ../../library/statistics.rst:783 +#: ../../library/statistics.rst:802 msgid "" "A read-only property for the `arithmetic mean `_ of a normal distribution." @@ -1080,14 +1087,14 @@ msgstr "" "常態分布中的\\ `算數平均數 `_\\ 唯讀屬性。" -#: ../../library/statistics.rst:789 +#: ../../library/statistics.rst:808 msgid "" "A read-only property for the `median `_ of a normal distribution." msgstr "" "常態分布中的\\ `中位數 `_\\ 唯讀屬性。" -#: ../../library/statistics.rst:795 +#: ../../library/statistics.rst:814 msgid "" "A read-only property for the `mode `_ of a normal distribution." @@ -1095,7 +1102,7 @@ msgstr "" "常態分布中的\\ `眾數 `_\\ 唯" "讀屬性。" -#: ../../library/statistics.rst:801 +#: ../../library/statistics.rst:820 msgid "" "A read-only property for the `standard deviation `_ of a normal distribution." @@ -1103,7 +1110,7 @@ msgstr "" "常態分布中的\\ `標準差 `_\\ 唯讀屬性。" -#: ../../library/statistics.rst:807 +#: ../../library/statistics.rst:826 msgid "" "A read-only property for the `variance `_ of a normal distribution. Equal to the square of the standard " @@ -1112,7 +1119,7 @@ msgstr "" "常態分布中的\\ `變異數 `_\\ 唯讀屬" "性。" -#: ../../library/statistics.rst:813 +#: ../../library/statistics.rst:832 msgid "" "Makes a normal distribution instance with *mu* and *sigma* parameters " "estimated from the *data* using :func:`fmean` and :func:`stdev`." @@ -1120,7 +1127,7 @@ msgstr "" "利用 :func:`fmean` 與 :func:`stdev` 函式,估計 *data* 的 *mu* 與 *sigma* 參" "數,建立一個常態分布的實例。" -#: ../../library/statistics.rst:816 +#: ../../library/statistics.rst:835 msgid "" "The *data* can be any :term:`iterable` and should consist of values that can " "be converted to type :class:`float`. If *data* does not contain at least " @@ -1132,7 +1139,7 @@ msgstr "" "若 *data* 沒有包含至少兩個以上的元素在內,則引發 :exc:`StatisticsError`,因為" "至少需要一個點來估計中央值且至少需要兩個點來估計分散情形。" -#: ../../library/statistics.rst:824 +#: ../../library/statistics.rst:843 msgid "" "Generates *n* random samples for a given mean and standard deviation. " "Returns a :class:`list` of :class:`float` values." @@ -1140,7 +1147,7 @@ msgstr "" "給定平均值與標準差,產生 *n* 個隨機樣本。回傳一個由 :class:`float` 組成的 :" "class:`list`。" -#: ../../library/statistics.rst:827 +#: ../../library/statistics.rst:846 msgid "" "If *seed* is given, creates a new instance of the underlying random number " "generator. This is useful for creating reproducible results, even in a " @@ -1149,7 +1156,7 @@ msgstr "" "若有給定 *seed*,則會建立一個以此為基礎的亂數產生器實例。這對於建立可重現的結" "果很有幫助,即使在多執行緒情境下也是如此。" -#: ../../library/statistics.rst:833 +#: ../../library/statistics.rst:852 msgid "" "Using a `probability density function (pdf) `_, compute the relative likelihood that a " @@ -1161,7 +1168,7 @@ msgstr "" "值 *x* 的相對概度 (relative likelihood)。數學上,它是比率 ``P(x <= X < " "x+dx) / dx`` 在 *dx* 趨近於零時的極限值。" -#: ../../library/statistics.rst:839 +#: ../../library/statistics.rst:858 msgid "" "The relative likelihood is computed as the probability of a sample occurring " "in a narrow range divided by the width of the range (hence the word " @@ -1171,7 +1178,7 @@ msgstr "" "相對概度是樣本出現在狹窄範圍的機率,除以該範圍的寬度(故稱為「密度」)計算而" "得。由於概度是相對於其它點,故其值可大於 ``1.0``。" -#: ../../library/statistics.rst:846 +#: ../../library/statistics.rst:865 msgid "" "Using a `cumulative distribution function (cdf) `_, compute the probability that a " @@ -1182,7 +1189,7 @@ msgstr "" "wikipedia.org/wiki/Cumulative_distribution_function>`_ 計算隨機變數 *X* 小於" "或等於 *x* 的機率。數學上,它記為 ``P(X <= x)``。" -#: ../../library/statistics.rst:853 +#: ../../library/statistics.rst:872 msgid "" "Compute the inverse cumulative distribution function, also known as the " "`quantile function `_ or " @@ -1196,7 +1203,7 @@ msgstr "" "org/web/20190203145224/https://www.statisticshowto.datasciencecentral.com/" "inverse-distribution-function/>`_ 函式。數學上記為 ``x : P(X <= x) = p``。" -#: ../../library/statistics.rst:859 +#: ../../library/statistics.rst:878 msgid "" "Finds the value *x* of the random variable *X* such that the probability of " "the variable being less than or equal to that value equals the given " @@ -1204,7 +1211,7 @@ msgid "" msgstr "" "找出一個值 *x*,使得隨機變數 *X* 小於或等於該值的機率等於給定的機率 *p*。" -#: ../../library/statistics.rst:865 +#: ../../library/statistics.rst:884 msgid "" "Measures the agreement between two normal probability distributions. Returns " "a value between 0.0 and 1.0 giving `the overlapping area for the two " @@ -1213,7 +1220,7 @@ msgstr "" "衡量兩常態分布之間的一致性。回傳一個介於 0.0 與 1.0 之間的值,表示\\ `兩機率" "密度函式的重疊區域 `_。" -#: ../../library/statistics.rst:872 +#: ../../library/statistics.rst:891 msgid "" "Divide the normal distribution into *n* continuous intervals with equal " "probability. Returns a list of (n - 1) cut points separating the intervals." @@ -1221,7 +1228,7 @@ msgstr "" "將常態分布分割成 *n* 個具有相等機率的連續區間。回傳一個 list,包含 (n-1) 個切" "割區間的分隔點。" -#: ../../library/statistics.rst:876 +#: ../../library/statistics.rst:895 msgid "" "Set *n* to 4 for quartiles (the default). Set *n* to 10 for deciles. Set " "*n* to 100 for percentiles which gives the 99 cuts points that separate the " @@ -1231,7 +1238,7 @@ msgstr "" "*n* 設定為 100 表示百分位數,這會產生 99 個分隔點,將常態分布切割成大小相等的" "群組。" -#: ../../library/statistics.rst:882 +#: ../../library/statistics.rst:901 msgid "" "Compute the `Standard Score `_ describing *x* in terms of the number of standard " @@ -1242,7 +1249,7 @@ msgstr "" "probability-and-statistics/z-score/>`_,用以描述在常態分布中,*x* 高出或低於" "平均數幾個標準差:``(x - mean) / stdev``。" -#: ../../library/statistics.rst:890 +#: ../../library/statistics.rst:909 msgid "" "Instances of :class:`NormalDist` support addition, subtraction, " "multiplication and division by a constant. These operations are used for " @@ -1251,14 +1258,14 @@ msgstr "" ":class:`NormalDist` 的實例支援對常數的加法、減法、乘法與除法。這些操作用於平" "移與縮放。例如:" -#: ../../library/statistics.rst:900 +#: ../../library/statistics.rst:919 msgid "" "Dividing a constant by an instance of :class:`NormalDist` is not supported " "because the result wouldn't be normally distributed." msgstr "" "不支援將常數除以 :class:`NormalDist` 的實例,因為結果將不符合常態分布。" -#: ../../library/statistics.rst:903 +#: ../../library/statistics.rst:922 msgid "" "Since normal distributions arise from additive effects of independent " "variables, it is possible to `add and subtract two independent normally " @@ -1271,19 +1278,19 @@ msgstr "" "Sum_of_normally_distributed_random_variables>`_,並且表示為 :class:" "`NormalDist` 的實例。例如:" -#: ../../library/statistics.rst:923 +#: ../../library/statistics.rst:942 msgid ":class:`NormalDist` Examples and Recipes" msgstr ":class:`NormalDist` 範例與錦囊妙計" -#: ../../library/statistics.rst:927 +#: ../../library/statistics.rst:946 msgid "Classic probability problems" msgstr "經典機率問題" -#: ../../library/statistics.rst:929 +#: ../../library/statistics.rst:948 msgid ":class:`NormalDist` readily solves classic probability problems." msgstr ":class:`NormalDist` 可以輕易地解決經典的機率問題。" -#: ../../library/statistics.rst:931 +#: ../../library/statistics.rst:950 msgid "" "For example, given `historical data for SAT exams `_ showing that scores are " @@ -1295,7 +1302,7 @@ msgstr "" "tables/dt17_226.40.asp>`_,顯示成績為平均 1060、標準差 195 的常態分布。我們要" "求出分數在 1100 與 1200 之間(四捨五入至最接近的整數)的學生的百分比:" -#: ../../library/statistics.rst:944 +#: ../../library/statistics.rst:963 msgid "" "Find the `quartiles `_ and `deciles " "`_ for the SAT scores:" @@ -1303,11 +1310,11 @@ msgstr "" "找出 SAT 分數的\\ `四分位數 `_\\ 以及" "\\ `十分位數 `_:" -#: ../../library/statistics.rst:956 +#: ../../library/statistics.rst:975 msgid "Monte Carlo inputs for simulations" msgstr "用於模擬的蒙地卡羅 (Monte Carlo) 輸入" -#: ../../library/statistics.rst:958 +#: ../../library/statistics.rst:977 msgid "" "To estimate the distribution for a model than isn't easy to solve " "analytically, :class:`NormalDist` can generate input samples for a `Monte " @@ -1317,11 +1324,11 @@ msgstr "" "樣本以進行\\ `蒙地卡羅模擬 `_:" -#: ../../library/statistics.rst:975 +#: ../../library/statistics.rst:994 msgid "Approximating binomial distributions" msgstr "近似二項分布" -#: ../../library/statistics.rst:977 +#: ../../library/statistics.rst:996 msgid "" "Normal distributions can be used to approximate `Binomial distributions " "`_ when the sample " @@ -1331,7 +1338,7 @@ msgstr "" "(Binomial distributions) `_。" -#: ../../library/statistics.rst:982 +#: ../../library/statistics.rst:1001 msgid "" "For example, an open source conference has 750 attendees and two rooms with " "a 500 person capacity. There is a talk about Python and another about Ruby. " @@ -1344,15 +1351,15 @@ msgstr "" "向參與 Python 講座。假設參與者的偏好沒有改變,那麼 Python 會議室未超過自身容" "量限制的機率是?" -#: ../../library/statistics.rst:1016 +#: ../../library/statistics.rst:1035 msgid "Naive bayesian classifier" msgstr "單純貝氏分類器 (Naive bayesian classifier)" -#: ../../library/statistics.rst:1018 +#: ../../library/statistics.rst:1037 msgid "Normal distributions commonly arise in machine learning problems." msgstr "常態分布常在機器學習問題中出現。" -#: ../../library/statistics.rst:1020 +#: ../../library/statistics.rst:1039 msgid "" "Wikipedia has a `nice example of a Naive Bayesian Classifier `_. The " @@ -1363,7 +1370,7 @@ msgstr "" "wiki/Naive_Bayes_classifier#Person_classification>`_。課題為從身高、體重與鞋" "子尺寸等符合常態分布的特徵量測值中判斷一個人的性別。" -#: ../../library/statistics.rst:1025 +#: ../../library/statistics.rst:1044 msgid "" "We're given a training dataset with measurements for eight people. The " "measurements are assumed to be normally distributed, so we summarize the " @@ -1372,13 +1379,13 @@ msgstr "" "給定一組包含八個人的量測值的訓練資料集。假設這些量測值服從常態分布,我們可以" "利用 :class:`NormalDist` 來總結資料:" -#: ../../library/statistics.rst:1038 +#: ../../library/statistics.rst:1057 msgid "" "Next, we encounter a new person whose feature measurements are known but " "whose gender is unknown:" msgstr "接著,我們遇到一個新的人,他的特徵量測值已知,但性別未知:" -#: ../../library/statistics.rst:1047 +#: ../../library/statistics.rst:1066 msgid "" "Starting with a 50% `prior probability `_ of being male or female, we compute the posterior as " @@ -1389,7 +1396,7 @@ msgstr "" "org/wiki/Prior_probability>`_ 為開端,我們將後驗機率 (posterior probability) " "計算為先驗機率乘以給定性別下,各特徵量測值的概度乘積:" -#: ../../library/statistics.rst:1062 +#: ../../library/statistics.rst:1081 msgid "" "The final prediction goes to the largest posterior. This is known as the " "`maximum a posteriori `_ 或者 MAP:" -#: ../../library/statistics.rst:1073 +#: ../../library/statistics.rst:1092 msgid "Kernel density estimation" msgstr "核密度估計 (Kernel density estimation)" -#: ../../library/statistics.rst:1075 +#: ../../library/statistics.rst:1094 msgid "" "It is possible to estimate a continuous probability density function from a " "fixed number of discrete samples." msgstr "可以從固定數量的離散樣本估計出連續機率密度函式。" -#: ../../library/statistics.rst:1078 +#: ../../library/statistics.rst:1097 msgid "" "The basic idea is to smooth the data using `a kernel function such as a " "normal distribution, triangular distribution, or uniform distribution " @@ -1422,7 +1429,7 @@ msgstr "" "wikipedia.org/wiki/Kernel_(statistics)#Kernel_functions_in_common_use>`_\\ 來" "使資料更加平滑。平滑程度由單個參數 ``h`` 控制,代表核函數的變異數。" -#: ../../library/statistics.rst:1097 +#: ../../library/statistics.rst:1116 msgid "" "`Wikipedia has an example `_ where we can use the ``kde_normal()`` " @@ -1433,7 +1440,7 @@ msgstr "" "Kernel_density_estimation#Example>`_,我們可以使用 ``kde_normal()`` 這個錦囊" "妙計來生成並繪製從小樣本估計的機率密度函式:" -#: ../../library/statistics.rst:1109 +#: ../../library/statistics.rst:1128 msgid "The points in ``xarr`` and ``yarr`` can be used to make a PDF plot:" msgstr "``xarr`` 和 ``yarr`` 中的點可用於繪製 PDF 圖:" diff --git a/library/symtable.po b/library/symtable.po index a1da8da3f2..deb26241d8 100644 --- a/library/symtable.po +++ b/library/symtable.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-15 20:43+0000\n" +"POT-Creation-Date: 2023-10-11 17:13+0000\n" "PO-Revision-Date: 2015-12-09 17:51+0000\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -63,37 +63,56 @@ msgstr "" #: ../../library/symtable.rst:40 msgid "" "Return the type of the symbol table. Possible values are ``'class'``, " -"``'module'``, and ``'function'``." +"``'module'``, ``'function'``, ``'annotation'``, ``'TypeVar bound'``, ``'type " +"alias'``, and ``'type parameter'``. The latter four refer to different " +"flavors of :ref:`annotation scopes `." msgstr "" -"回傳符號表的種類。可能的值為 ``'class'``、``'module'`` 和 ``'function'``。" +"回傳符號表的種類。可能的值為 ``'class'``、``'module'``、``'function'``、" +"``'annotation'``、``'TypeVar bound'``、``'type alias'`` 和 ``'type " +"parameter'``。後四個是指不同的\\ :ref:`註釋範圍 (annotation scopes) " +"`。" #: ../../library/symtable.rst:45 +msgid "" +"Added ``'annotation'``, ``'TypeVar bound'``, ``'type alias'``, and ``'type " +"parameter'`` as possible return values." +msgstr "" +"新增了 ``'annotation'``、``'TypeVar bound'``、``'type alias'`` 和 ``'type " +"parameter'`` 作為可能的回傳值。" + +#: ../../library/symtable.rst:51 msgid "Return the table's identifier." msgstr "回傳表的識別器。" -#: ../../library/symtable.rst:49 +#: ../../library/symtable.rst:55 msgid "" "Return the table's name. This is the name of the class if the table is for " "a class, the name of the function if the table is for a function, or " -"``'top'`` if the table is global (:meth:`get_type` returns ``'module'``)." +"``'top'`` if the table is global (:meth:`get_type` returns ``'module'``). " +"For type parameter scopes (which are used for generic classes, functions, " +"and type aliases), it is the name of the underlying class, function, or type " +"alias. For type alias scopes, it is the name of the type alias. For :class:" +"`~typing.TypeVar` bound scopes, it is the name of the ``TypeVar``." msgstr "" "回傳表的名稱。如果表用於類別,則這是類別的名稱;如果表用於函式,則這是函式的" "名稱;如果表是全域的,則為 ``'top'`` (:meth:`get_type` 會回傳 " -"``'module'``)。" +"``'module'``)。對於型別參數作用域(用於泛型類別、函式和型別別名),它是底層" +"類別、函式或型別別名的名稱。對於型別別名作用域,它是型別別名的名稱。對於 :" +"class:`~typing.TypeVar` 綁定範圍,它會是 ``TypeVar`` 的名稱。" -#: ../../library/symtable.rst:55 +#: ../../library/symtable.rst:65 msgid "Return the number of the first line in the block this table represents." msgstr "回傳此表所代表的區塊中第一行的編號。" -#: ../../library/symtable.rst:59 +#: ../../library/symtable.rst:69 msgid "Return ``True`` if the locals in this table can be optimized." msgstr "如果可以最佳化該表中的區域變數,則回傳 ``True``。" -#: ../../library/symtable.rst:63 +#: ../../library/symtable.rst:73 msgid "Return ``True`` if the block is a nested class or function." msgstr "如果區塊是巢狀類別或函式,則回傳 ``True``。" -#: ../../library/symtable.rst:67 +#: ../../library/symtable.rst:77 msgid "" "Return ``True`` if the block has nested namespaces within it. These can be " "obtained with :meth:`get_children`." @@ -101,7 +120,7 @@ msgstr "" "如果區塊內有巢狀命名空間,則回傳 ``True``。這些可以通過 :meth:`get_children` " "獲得。" -#: ../../library/symtable.rst:72 +#: ../../library/symtable.rst:82 msgid "" "Return a view object containing the names of symbols in the table. See the :" "ref:`documentation of view objects `." @@ -109,97 +128,97 @@ msgstr "" "回傳包含表中符號之名稱的視圖物件 (view object)。請參閱\\ :ref:`視圖物件的文" "件 `。" -#: ../../library/symtable.rst:77 +#: ../../library/symtable.rst:87 msgid "Lookup *name* in the table and return a :class:`Symbol` instance." msgstr "在表中查找 *name* 並回傳一個 :class:`Symbol` 實例。" -#: ../../library/symtable.rst:81 +#: ../../library/symtable.rst:91 msgid "Return a list of :class:`Symbol` instances for names in the table." msgstr "回傳表中名稱的 :class:`Symbol` 實例串列。" -#: ../../library/symtable.rst:85 +#: ../../library/symtable.rst:95 msgid "Return a list of the nested symbol tables." msgstr "回傳巢狀符號表的串列。" -#: ../../library/symtable.rst:90 +#: ../../library/symtable.rst:100 msgid "" "A namespace for a function or method. This class inherits :class:" "`SymbolTable`." msgstr "一個函式或方法的命名空間。該類別繼承自 :class:`SymbolTable`。" -#: ../../library/symtable.rst:95 +#: ../../library/symtable.rst:105 msgid "Return a tuple containing names of parameters to this function." msgstr "回傳一個包含此函式參數名稱的元組 (tuple)。" -#: ../../library/symtable.rst:99 +#: ../../library/symtable.rst:109 msgid "Return a tuple containing names of locals in this function." msgstr "回傳一個包含此函式中區域變數 (locals) 名稱的元組。" -#: ../../library/symtable.rst:103 +#: ../../library/symtable.rst:113 msgid "Return a tuple containing names of globals in this function." msgstr "回傳一個包含此函式中全域變數 (globals) 名稱的元組。" -#: ../../library/symtable.rst:107 +#: ../../library/symtable.rst:117 msgid "Return a tuple containing names of nonlocals in this function." msgstr "回傳一個包含此函式中非區域變數 (nonlocals) 名稱的元組。" -#: ../../library/symtable.rst:111 +#: ../../library/symtable.rst:121 msgid "Return a tuple containing names of free variables in this function." msgstr "回傳一個包含此函式中自由變數 (free variables) 名稱的元組。" -#: ../../library/symtable.rst:116 +#: ../../library/symtable.rst:126 msgid "A namespace of a class. This class inherits :class:`SymbolTable`." msgstr "一個類別的命名空間。該類別繼承自 :class:`SymbolTable`。" -#: ../../library/symtable.rst:120 +#: ../../library/symtable.rst:130 msgid "Return a tuple containing the names of methods declared in the class." msgstr "回傳一個包含類別中聲明的方法名稱的元組。" -#: ../../library/symtable.rst:125 +#: ../../library/symtable.rst:135 msgid "" "An entry in a :class:`SymbolTable` corresponding to an identifier in the " "source. The constructor is not public." msgstr "" ":class:`SymbolTable` 中的條目對應於來源中的識別器。建構函式不是公開的。" -#: ../../library/symtable.rst:130 +#: ../../library/symtable.rst:140 msgid "Return the symbol's name." msgstr "回傳符號的名稱。" -#: ../../library/symtable.rst:134 +#: ../../library/symtable.rst:144 msgid "Return ``True`` if the symbol is used in its block." msgstr "如果該符號在其區塊中使用,則回傳 ``True``。" -#: ../../library/symtable.rst:138 +#: ../../library/symtable.rst:148 msgid "Return ``True`` if the symbol is created from an import statement." msgstr "如果符號是從 import 陳述式建立的,則回傳 ``True``。" -#: ../../library/symtable.rst:142 +#: ../../library/symtable.rst:152 msgid "Return ``True`` if the symbol is a parameter." msgstr "如果符號是一個參數,則回傳 ``True``。" -#: ../../library/symtable.rst:146 +#: ../../library/symtable.rst:156 msgid "Return ``True`` if the symbol is global." msgstr "如果符號是全域的,則回傳 ``True``。" -#: ../../library/symtable.rst:150 +#: ../../library/symtable.rst:160 msgid "Return ``True`` if the symbol is nonlocal." msgstr "如果符號是非區域的,則回傳 ``True``。" -#: ../../library/symtable.rst:154 +#: ../../library/symtable.rst:164 msgid "" "Return ``True`` if the symbol is declared global with a global statement." msgstr "如果使用全域陳述式將符號聲明為全域的,則回傳 ``True``。" -#: ../../library/symtable.rst:158 +#: ../../library/symtable.rst:168 msgid "Return ``True`` if the symbol is local to its block." msgstr "如果符號是其區塊的區域符號,則回傳 ``True``。" -#: ../../library/symtable.rst:162 +#: ../../library/symtable.rst:172 msgid "Return ``True`` if the symbol is annotated." msgstr "如果符號有被註釋,則回傳 ``True``。" -#: ../../library/symtable.rst:168 +#: ../../library/symtable.rst:178 msgid "" "Return ``True`` if the symbol is referenced in its block, but not assigned " "to." @@ -207,28 +226,28 @@ msgstr "" "如果該符號在其區塊中被參照 (referenced) 但未被賦值 (assigned),則回傳 " "``True``。" -#: ../../library/symtable.rst:173 +#: ../../library/symtable.rst:183 msgid "Return ``True`` if the symbol is assigned to in its block." msgstr "如果該符號被賦值到其區塊中,則回傳 ``True``。" -#: ../../library/symtable.rst:177 +#: ../../library/symtable.rst:187 msgid "Return ``True`` if name binding introduces new namespace." msgstr "如果名稱綁定引入 (introduce) 新的命名空間,則回傳 ``True``。" -#: ../../library/symtable.rst:179 +#: ../../library/symtable.rst:189 msgid "" "If the name is used as the target of a function or class statement, this " "will be true." msgstr "如果名稱用作函式或類別陳述式的目標,則這將會是 true。" -#: ../../library/symtable.rst:182 +#: ../../library/symtable.rst:192 msgid "For example::" msgstr "" "舉例來說:\n" "\n" "::" -#: ../../library/symtable.rst:188 +#: ../../library/symtable.rst:198 msgid "" "Note that a single name can be bound to multiple objects. If the result is " "``True``, the name may also be bound to other objects, like an int or list, " @@ -237,11 +256,11 @@ msgstr "" "請注意,單個名稱可以綁定到多個物件。如果結果為 ``True``,則該名稱也可能被綁定" "到其他物件,例如 int 或 list,而不會引入新的命名空間。" -#: ../../library/symtable.rst:194 +#: ../../library/symtable.rst:204 msgid "Return a list of namespaces bound to this name." msgstr "回傳綁定到該名稱的命名空間的串列。" -#: ../../library/symtable.rst:198 +#: ../../library/symtable.rst:208 msgid "" "Return the namespace bound to this name. If more than one or no namespace is " "bound to this name, a :exc:`ValueError` is raised." diff --git a/library/sys.monitoring.po b/library/sys.monitoring.po index 58353e1ae7..00d44ff013 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-09-06 00:03+0000\n" +"POT-Creation-Date: 2023-10-11 17:13+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -302,7 +302,7 @@ msgstr "" #: ../../library/sys.monitoring.rst:150 msgid "" -"The ``C_RETURN`` and ``C_RAISE`` events are are controlled by the ``CALL`` " +"The ``C_RETURN`` and ``C_RAISE`` events are controlled by the ``CALL`` " "event. ``C_RETURN`` and ``C_RAISE`` events will only be seen if the " "corresponding ``CALL`` event is being monitored." msgstr "" diff --git a/library/sys.po b/library/sys.po index 0b47041954..93f7eb9d6e 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-09-09 00:03+0000\n" +"POT-Creation-Date: 2023-10-11 17:13+0000\n" "PO-Revision-Date: 2023-04-26 02:54+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -966,7 +966,7 @@ msgstr "" msgid "" "Return the current value of the flags that are used for :c:func:`dlopen` " "calls. Symbolic names for the flag values can be found in the :mod:`os` " -"module (``RTLD_xxx`` constants, e.g. :const:`os.RTLD_LAZY`)." +"module (:samp:`RTLD_{xxx}` constants, e.g. :const:`os.RTLD_LAZY`)." msgstr "" #: ../../library/sys.rst:759 ../../library/sys.rst:1447 @@ -1829,8 +1829,8 @@ msgid "" "enable a lazy resolving of symbols when importing a module, if called as " "``sys.setdlopenflags(0)``. To share symbols across extension modules, call " "as ``sys.setdlopenflags(os.RTLD_GLOBAL)``. Symbolic names for the flag " -"values can be found in the :mod:`os` module (``RTLD_xxx`` constants, e.g. :" -"const:`os.RTLD_LAZY`)." +"values can be found in the :mod:`os` module (:samp:`RTLD_{xxx}` constants, e." +"g. :const:`os.RTLD_LAZY`)." msgstr "" #: ../../library/sys.rst:1451 diff --git a/library/sysconfig.po b/library/sysconfig.po index ed92e796c6..0b9bffd1ea 100644 --- a/library/sysconfig.po +++ b/library/sysconfig.po @@ -1,5 +1,4 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2022, Python Software Foundation +# Copyright (C) 2001-2023, Python Software Foundation # This file is distributed under the same license as the Python package. # # Translators: @@ -7,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-20 15:45+0000\n" +"POT-Creation-Date: 2023-10-12 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-" @@ -34,227 +33,479 @@ msgid "" "variables relevant for the current platform." msgstr "" -#: ../../library/sysconfig.rst:24 +#: ../../library/sysconfig.rst:25 msgid "Configuration variables" msgstr "" -#: ../../library/sysconfig.rst:26 +#: ../../library/sysconfig.rst:27 msgid "" "A Python distribution contains a :file:`Makefile` and a :file:`pyconfig.h` " "header file that are necessary to build both the Python binary itself and " "third-party C extensions compiled using ``setuptools``." msgstr "" -#: ../../library/sysconfig.rst:30 +#: ../../library/sysconfig.rst:31 msgid "" ":mod:`sysconfig` puts all variables found in these files in a dictionary " "that can be accessed using :func:`get_config_vars` or :func:`get_config_var`." msgstr "" -#: ../../library/sysconfig.rst:33 +#: ../../library/sysconfig.rst:34 msgid "Notice that on Windows, it's a much smaller set." msgstr "" -#: ../../library/sysconfig.rst:37 +#: ../../library/sysconfig.rst:38 msgid "" "With no arguments, return a dictionary of all configuration variables " "relevant for the current platform." msgstr "" -#: ../../library/sysconfig.rst:40 +#: ../../library/sysconfig.rst:41 msgid "" "With arguments, return a list of values that result from looking up each " "argument in the configuration variable dictionary." msgstr "" -#: ../../library/sysconfig.rst:43 +#: ../../library/sysconfig.rst:44 msgid "For each argument, if the value is not found, return ``None``." msgstr "" -#: ../../library/sysconfig.rst:48 +#: ../../library/sysconfig.rst:49 msgid "" "Return the value of a single variable *name*. Equivalent to " "``get_config_vars().get(name)``." msgstr "" -#: ../../library/sysconfig.rst:51 +#: ../../library/sysconfig.rst:52 msgid "If *name* is not found, return ``None``." msgstr "" -#: ../../library/sysconfig.rst:53 +#: ../../library/sysconfig.rst:54 msgid "Example of usage::" msgstr "" "用法範例:\n" "\n" "::" -#: ../../library/sysconfig.rst:66 +#: ../../library/sysconfig.rst:68 msgid "Installation paths" msgstr "" -#: ../../library/sysconfig.rst:68 +#: ../../library/sysconfig.rst:70 msgid "" "Python uses an installation scheme that differs depending on the platform " "and on the installation options. These schemes are stored in :mod:" "`sysconfig` under unique identifiers based on the value returned by :const:" -"`os.name`." +"`os.name`. The schemes are used by package installers to determine where to " +"copy files to." msgstr "" -#: ../../library/sysconfig.rst:72 -msgid "" -"Every new component that is installed using :mod:`!distutils` or a Distutils-" -"based system will follow the same scheme to copy its file in the right " -"places." -msgstr "" - -#: ../../library/sysconfig.rst:76 +#: ../../library/sysconfig.rst:75 msgid "Python currently supports nine schemes:" msgstr "" -#: ../../library/sysconfig.rst:78 +#: ../../library/sysconfig.rst:77 msgid "" "*posix_prefix*: scheme for POSIX platforms like Linux or macOS. This is the " "default scheme used when Python or a component is installed." msgstr "" -#: ../../library/sysconfig.rst:80 +#: ../../library/sysconfig.rst:79 msgid "" -"*posix_home*: scheme for POSIX platforms used when a *home* option is used " -"upon installation. This scheme is used when a component is installed " -"through Distutils with a specific home prefix." +"*posix_home*: scheme for POSIX platforms, when the *home* option is used. " +"This scheme defines paths located under a specific home prefix." msgstr "" -#: ../../library/sysconfig.rst:83 +#: ../../library/sysconfig.rst:81 msgid "" -"*posix_user*: scheme for POSIX platforms used when a component is installed " -"through Distutils and the *user* option is used. This scheme defines paths " -"located under the user home directory." +"*posix_user*: scheme for POSIX platforms, when the *user* option is used. " +"This scheme defines paths located under the user's home directory (:const:" +"`site.USER_BASE`)." msgstr "" -#: ../../library/sysconfig.rst:86 +#: ../../library/sysconfig.rst:84 msgid "" "*posix_venv*: scheme for :mod:`Python virtual environments ` on POSIX " "platforms; by default it is the same as *posix_prefix*." msgstr "" -#: ../../library/sysconfig.rst:88 -msgid "*nt*: scheme for NT platforms like Windows." +#: ../../library/sysconfig.rst:86 +msgid "" +"*nt*: scheme for Windows. This is the default scheme used when Python or a " +"component is installed." msgstr "" -#: ../../library/sysconfig.rst:89 -msgid "*nt_user*: scheme for NT platforms, when the *user* option is used." +#: ../../library/sysconfig.rst:88 +msgid "*nt_user*: scheme for Windows, when the *user* option is used." msgstr "" -#: ../../library/sysconfig.rst:90 +#: ../../library/sysconfig.rst:89 msgid "" -"*nt_venv*: scheme for :mod:`Python virtual environments ` on NT " -"platforms; by default it is the same as *nt*." +"*nt_venv*: scheme for :mod:`Python virtual environments ` on Windows; " +"by default it is the same as *nt*." msgstr "" -#: ../../library/sysconfig.rst:92 +#: ../../library/sysconfig.rst:91 msgid "" "*venv*: a scheme with values from either *posix_venv* or *nt_venv* depending " "on the platform Python runs on." msgstr "" -#: ../../library/sysconfig.rst:94 +#: ../../library/sysconfig.rst:93 msgid "*osx_framework_user*: scheme for macOS, when the *user* option is used." msgstr "" -#: ../../library/sysconfig.rst:96 +#: ../../library/sysconfig.rst:95 msgid "" "Each scheme is itself composed of a series of paths and each path has a " "unique identifier. Python currently uses eight paths:" msgstr "" -#: ../../library/sysconfig.rst:99 +#: ../../library/sysconfig.rst:98 msgid "" "*stdlib*: directory containing the standard Python library files that are " "not platform-specific." msgstr "" -#: ../../library/sysconfig.rst:101 +#: ../../library/sysconfig.rst:100 msgid "" "*platstdlib*: directory containing the standard Python library files that " "are platform-specific." msgstr "" -#: ../../library/sysconfig.rst:103 +#: ../../library/sysconfig.rst:102 msgid "*platlib*: directory for site-specific, platform-specific files." msgstr "" -#: ../../library/sysconfig.rst:104 -msgid "*purelib*: directory for site-specific, non-platform-specific files." +#: ../../library/sysconfig.rst:103 +msgid "" +"*purelib*: directory for site-specific, non-platform-specific files ('pure' " +"Python)." msgstr "" -#: ../../library/sysconfig.rst:105 +#: ../../library/sysconfig.rst:104 msgid "" "*include*: directory for non-platform-specific header files for the Python C-" "API." msgstr "" -#: ../../library/sysconfig.rst:107 +#: ../../library/sysconfig.rst:106 msgid "" "*platinclude*: directory for platform-specific header files for the Python C-" "API." msgstr "" -#: ../../library/sysconfig.rst:109 +#: ../../library/sysconfig.rst:108 msgid "*scripts*: directory for script files." msgstr "" -#: ../../library/sysconfig.rst:110 +#: ../../library/sysconfig.rst:109 msgid "*data*: directory for data files." msgstr "" -#: ../../library/sysconfig.rst:112 -msgid ":mod:`sysconfig` provides some functions to determine these paths." +#: ../../library/sysconfig.rst:115 +msgid "User scheme" +msgstr "" + +#: ../../library/sysconfig.rst:117 +msgid "" +"This scheme is designed to be the most convenient solution for users that " +"don't have write permission to the global site-packages directory or don't " +"want to install into it." msgstr "" -#: ../../library/sysconfig.rst:116 +#: ../../library/sysconfig.rst:121 +msgid "" +"Files will be installed into subdirectories of :const:`site.USER_BASE` " +"(written as :file:`{userbase}` hereafter). This scheme installs pure Python " +"modules and extension modules in the same location (also known as :const:" +"`site.USER_SITE`)." +msgstr "" + +#: ../../library/sysconfig.rst:126 +msgid "``posix_user``" +msgstr "``posix_user``" + +#: ../../library/sysconfig.rst:129 ../../library/sysconfig.rst:144 +#: ../../library/sysconfig.rst:159 ../../library/sysconfig.rst:187 +#: ../../library/sysconfig.rst:229 ../../library/sysconfig.rst:245 +msgid "Path" +msgstr "" + +#: ../../library/sysconfig.rst:129 ../../library/sysconfig.rst:144 +#: ../../library/sysconfig.rst:159 ../../library/sysconfig.rst:187 +#: ../../library/sysconfig.rst:229 ../../library/sysconfig.rst:245 +msgid "Installation directory" +msgstr "" + +#: ../../library/sysconfig.rst:131 ../../library/sysconfig.rst:146 +#: ../../library/sysconfig.rst:161 ../../library/sysconfig.rst:189 +#: ../../library/sysconfig.rst:231 ../../library/sysconfig.rst:247 +msgid "*stdlib*" +msgstr "*stdlib*" + +#: ../../library/sysconfig.rst:131 ../../library/sysconfig.rst:132 +msgid ":file:`{userbase}/lib/python{X.Y}`" +msgstr ":file:`{userbase}/lib/python{X.Y}`" + +#: ../../library/sysconfig.rst:132 ../../library/sysconfig.rst:147 +#: ../../library/sysconfig.rst:162 ../../library/sysconfig.rst:190 +#: ../../library/sysconfig.rst:232 ../../library/sysconfig.rst:248 +msgid "*platstdlib*" +msgstr "*platstdlib*" + +#: ../../library/sysconfig.rst:133 ../../library/sysconfig.rst:148 +#: ../../library/sysconfig.rst:163 ../../library/sysconfig.rst:191 +#: ../../library/sysconfig.rst:233 ../../library/sysconfig.rst:249 +msgid "*platlib*" +msgstr "*platlib*" + +#: ../../library/sysconfig.rst:133 ../../library/sysconfig.rst:134 +msgid ":file:`{userbase}/lib/python{X.Y}/site-packages`" +msgstr ":file:`{userbase}/lib/python{X.Y}/site-packages`" + +#: ../../library/sysconfig.rst:134 ../../library/sysconfig.rst:149 +#: ../../library/sysconfig.rst:164 ../../library/sysconfig.rst:192 +#: ../../library/sysconfig.rst:234 ../../library/sysconfig.rst:250 +msgid "*purelib*" +msgstr "*purelib*" + +#: ../../library/sysconfig.rst:135 ../../library/sysconfig.rst:150 +#: ../../library/sysconfig.rst:165 ../../library/sysconfig.rst:193 +#: ../../library/sysconfig.rst:235 ../../library/sysconfig.rst:251 +msgid "*include*" +msgstr "*include*" + +#: ../../library/sysconfig.rst:135 ../../library/sysconfig.rst:165 +msgid ":file:`{userbase}/include/python{X.Y}`" +msgstr ":file:`{userbase}/include/python{X.Y}`" + +#: ../../library/sysconfig.rst:136 ../../library/sysconfig.rst:151 +#: ../../library/sysconfig.rst:166 ../../library/sysconfig.rst:195 +#: ../../library/sysconfig.rst:237 ../../library/sysconfig.rst:253 +msgid "*scripts*" +msgstr "*scripts*" + +#: ../../library/sysconfig.rst:136 ../../library/sysconfig.rst:166 +msgid ":file:`{userbase}/bin`" +msgstr ":file:`{userbase}/bin`" + +#: ../../library/sysconfig.rst:137 ../../library/sysconfig.rst:152 +#: ../../library/sysconfig.rst:167 ../../library/sysconfig.rst:196 +#: ../../library/sysconfig.rst:238 ../../library/sysconfig.rst:254 +msgid "*data*" +msgstr "*data*" + +#: ../../library/sysconfig.rst:137 ../../library/sysconfig.rst:152 +#: ../../library/sysconfig.rst:167 +msgid ":file:`{userbase}`" +msgstr ":file:`{userbase}`" + +#: ../../library/sysconfig.rst:141 +msgid "``nt_user``" +msgstr "``nt_user``" + +#: ../../library/sysconfig.rst:146 ../../library/sysconfig.rst:147 +msgid ":file:`{userbase}\\\\Python{XY}`" +msgstr ":file:`{userbase}\\\\Python{XY}`" + +#: ../../library/sysconfig.rst:148 ../../library/sysconfig.rst:149 +msgid ":file:`{userbase}\\\\Python{XY}\\\\site-packages`" +msgstr ":file:`{userbase}\\\\Python{XY}\\\\site-packages`" + +#: ../../library/sysconfig.rst:150 +msgid ":file:`{userbase}\\\\Python{XY}\\\\Include`" +msgstr ":file:`{userbase}\\\\Python{XY}\\\\Include`" + +#: ../../library/sysconfig.rst:151 +msgid ":file:`{userbase}\\\\Python{XY}\\\\Scripts`" +msgstr ":file:`{userbase}\\\\Python{XY}\\\\Scripts`" + +#: ../../library/sysconfig.rst:156 +msgid "``osx_framework_user``" +msgstr "``osx_framework_user``" + +#: ../../library/sysconfig.rst:161 ../../library/sysconfig.rst:162 +msgid ":file:`{userbase}/lib/python`" +msgstr ":file:`{userbase}/lib/python`" + +#: ../../library/sysconfig.rst:163 ../../library/sysconfig.rst:164 +msgid ":file:`{userbase}/lib/python/site-packages`" +msgstr ":file:`{userbase}/lib/python/site-packages`" + +#: ../../library/sysconfig.rst:174 +msgid "Home scheme" +msgstr "" + +#: ../../library/sysconfig.rst:176 +msgid "" +"The idea behind the \"home scheme\" is that you build and maintain a " +"personal stash of Python modules. This scheme's name is derived from the " +"idea of a \"home\" directory on Unix, since it's not unusual for a Unix user " +"to make their home directory have a layout similar to :file:`/usr/` or :file:" +"`/usr/local/`. This scheme can be used by anyone, regardless of the " +"operating system they are installing for." +msgstr "" + +#: ../../library/sysconfig.rst:184 +msgid "``posix_home``" +msgstr "``posix_home``" + +#: ../../library/sysconfig.rst:189 ../../library/sysconfig.rst:190 +#: ../../library/sysconfig.rst:191 ../../library/sysconfig.rst:192 +msgid ":file:`{home}/lib/python`" +msgstr ":file:`{home}/lib/python`" + +#: ../../library/sysconfig.rst:193 ../../library/sysconfig.rst:194 +msgid ":file:`{home}/include/python`" +msgstr ":file:`{home}/include/python`" + +#: ../../library/sysconfig.rst:194 ../../library/sysconfig.rst:236 +#: ../../library/sysconfig.rst:252 +msgid "*platinclude*" +msgstr "*platinclude*" + +#: ../../library/sysconfig.rst:195 +msgid ":file:`{home}/bin`" +msgstr ":file:`{home}/bin`" + +#: ../../library/sysconfig.rst:196 +msgid ":file:`{home}`" +msgstr ":file:`{home}`" + +#: ../../library/sysconfig.rst:203 +msgid "Prefix scheme" +msgstr "" + +#: ../../library/sysconfig.rst:205 +msgid "" +"The \"prefix scheme\" is useful when you wish to use one Python installation " +"to perform the build/install (i.e., to run the setup script), but install " +"modules into the third-party module directory of a different Python " +"installation (or something that looks like a different Python " +"installation). If this sounds a trifle unusual, it is---that's why the user " +"and home schemes come before. However, there are at least two known cases " +"where the prefix scheme will be useful." +msgstr "" + +#: ../../library/sysconfig.rst:212 +msgid "" +"First, consider that many Linux distributions put Python in :file:`/usr`, " +"rather than the more traditional :file:`/usr/local`. This is entirely " +"appropriate, since in those cases Python is part of \"the system\" rather " +"than a local add-on. However, if you are installing Python modules from " +"source, you probably want them to go in :file:`/usr/local/lib/python2.{X}` " +"rather than :file:`/usr/lib/python2.{X}`." +msgstr "" + +#: ../../library/sysconfig.rst:219 +msgid "" +"Another possibility is a network filesystem where the name used to write to " +"a remote directory is different from the name used to read it: for example, " +"the Python interpreter accessed as :file:`/usr/local/bin/python` might " +"search for modules in :file:`/usr/local/lib/python2.{X}`, but those modules " +"would have to be installed to, say, :file:`/mnt/{@server}/export/lib/python2." +"{X}`." +msgstr "" + +#: ../../library/sysconfig.rst:226 +msgid "``posix_prefix``" +msgstr "``posix_prefix``" + +#: ../../library/sysconfig.rst:231 ../../library/sysconfig.rst:232 +msgid ":file:`{prefix}/lib/python{X.Y}`" +msgstr ":file:`{prefix}/lib/python{X.Y}`" + +#: ../../library/sysconfig.rst:233 ../../library/sysconfig.rst:234 +msgid ":file:`{prefix}/lib/python{X.Y}/site-packages`" +msgstr ":file:`{prefix}/lib/python{X.Y}/site-packages`" + +#: ../../library/sysconfig.rst:235 ../../library/sysconfig.rst:236 +msgid ":file:`{prefix}/include/python{X.Y}`" +msgstr ":file:`{prefix}/include/python{X.Y}`" + +#: ../../library/sysconfig.rst:237 +msgid ":file:`{prefix}/bin`" +msgstr ":file:`{prefix}/bin`" + +#: ../../library/sysconfig.rst:238 ../../library/sysconfig.rst:254 +msgid ":file:`{prefix}`" +msgstr ":file:`{prefix}`" + +#: ../../library/sysconfig.rst:242 +msgid "``nt``" +msgstr "``nt``" + +#: ../../library/sysconfig.rst:247 ../../library/sysconfig.rst:248 +msgid ":file:`{prefix}\\\\Lib`" +msgstr ":file:`{prefix}\\\\Lib`" + +#: ../../library/sysconfig.rst:249 ../../library/sysconfig.rst:250 +msgid ":file:`{prefix}\\\\Lib\\\\site-packages`" +msgstr ":file:`{prefix}\\\\Lib\\\\site-packages`" + +#: ../../library/sysconfig.rst:251 ../../library/sysconfig.rst:252 +msgid ":file:`{prefix}\\\\Include`" +msgstr ":file:`{prefix}\\\\Include`" + +#: ../../library/sysconfig.rst:253 +msgid ":file:`{prefix}\\\\Scripts`" +msgstr ":file:`{prefix}\\\\Scripts`" + +#: ../../library/sysconfig.rst:259 +msgid "Installation path functions" +msgstr "安裝路徑函式" + +#: ../../library/sysconfig.rst:261 +msgid "" +":mod:`sysconfig` provides some functions to determine these installation " +"paths." +msgstr "" + +#: ../../library/sysconfig.rst:265 msgid "" "Return a tuple containing all schemes currently supported in :mod:" "`sysconfig`." msgstr "" -#: ../../library/sysconfig.rst:122 +#: ../../library/sysconfig.rst:271 msgid "Return the default scheme name for the current platform." msgstr "" -#: ../../library/sysconfig.rst:124 +#: ../../library/sysconfig.rst:273 msgid "" "This function was previously named ``_get_default_scheme()`` and considered " "an implementation detail." msgstr "" -#: ../../library/sysconfig.rst:128 +#: ../../library/sysconfig.rst:277 msgid "" "When Python runs from a virtual environment, the *venv* scheme is returned." msgstr "" -#: ../../library/sysconfig.rst:134 +#: ../../library/sysconfig.rst:283 msgid "" "Return a preferred scheme name for an installation layout specified by *key*." msgstr "" -#: ../../library/sysconfig.rst:136 +#: ../../library/sysconfig.rst:285 msgid "*key* must be either ``\"prefix\"``, ``\"home\"``, or ``\"user\"``." msgstr "" -#: ../../library/sysconfig.rst:138 +#: ../../library/sysconfig.rst:287 msgid "" "The return value is a scheme name listed in :func:`get_scheme_names`. It can " "be passed to :mod:`sysconfig` functions that take a *scheme* argument, such " "as :func:`get_paths`." msgstr "" -#: ../../library/sysconfig.rst:144 +#: ../../library/sysconfig.rst:293 msgid "" "When Python runs from a virtual environment and ``key=\"prefix\"``, the " "*venv* scheme is returned." msgstr "" -#: ../../library/sysconfig.rst:151 +#: ../../library/sysconfig.rst:300 msgid "" "Return a dict containing preferred scheme names on the current platform. " "Python implementers and redistributors may add their preferred schemes to " @@ -264,109 +515,111 @@ msgid "" "mix with those by the other." msgstr "" -#: ../../library/sysconfig.rst:158 +#: ../../library/sysconfig.rst:307 msgid "" "End users should not use this function, but :func:`get_default_scheme` and :" "func:`get_preferred_scheme()` instead." msgstr "" -#: ../../library/sysconfig.rst:166 +#: ../../library/sysconfig.rst:315 msgid "" "Return a tuple containing all path names currently supported in :mod:" "`sysconfig`." msgstr "" -#: ../../library/sysconfig.rst:172 +#: ../../library/sysconfig.rst:321 msgid "" "Return an installation path corresponding to the path *name*, from the " "install scheme named *scheme*." msgstr "" -#: ../../library/sysconfig.rst:175 +#: ../../library/sysconfig.rst:324 msgid "" "*name* has to be a value from the list returned by :func:`get_path_names`." msgstr "" -#: ../../library/sysconfig.rst:177 +#: ../../library/sysconfig.rst:326 msgid "" ":mod:`sysconfig` stores installation paths corresponding to each path name, " "for each platform, with variables to be expanded. For instance the *stdlib* " "path for the *nt* scheme is: ``{base}/Lib``." msgstr "" -#: ../../library/sysconfig.rst:181 +#: ../../library/sysconfig.rst:330 msgid "" ":func:`get_path` will use the variables returned by :func:`get_config_vars` " "to expand the path. All variables have default values for each platform so " "one may call this function and get the default value." msgstr "" -#: ../../library/sysconfig.rst:185 +#: ../../library/sysconfig.rst:334 msgid "" "If *scheme* is provided, it must be a value from the list returned by :func:" "`get_scheme_names`. Otherwise, the default scheme for the current platform " "is used." msgstr "" -#: ../../library/sysconfig.rst:189 +#: ../../library/sysconfig.rst:338 msgid "" "If *vars* is provided, it must be a dictionary of variables that will update " "the dictionary returned by :func:`get_config_vars`." msgstr "" -#: ../../library/sysconfig.rst:192 +#: ../../library/sysconfig.rst:341 msgid "" "If *expand* is set to ``False``, the path will not be expanded using the " "variables." msgstr "" -#: ../../library/sysconfig.rst:195 +#: ../../library/sysconfig.rst:344 msgid "If *name* is not found, raise a :exc:`KeyError`." -msgstr "" +msgstr "如果找不到 *name*,則引發 :exc:`KeyError`。" -#: ../../library/sysconfig.rst:200 +#: ../../library/sysconfig.rst:349 msgid "" "Return a dictionary containing all installation paths corresponding to an " "installation scheme. See :func:`get_path` for more information." msgstr "" -#: ../../library/sysconfig.rst:203 +#: ../../library/sysconfig.rst:352 msgid "" "If *scheme* is not provided, will use the default scheme for the current " "platform." msgstr "" -#: ../../library/sysconfig.rst:206 +#: ../../library/sysconfig.rst:355 msgid "" "If *vars* is provided, it must be a dictionary of variables that will update " "the dictionary used to expand the paths." msgstr "" -#: ../../library/sysconfig.rst:209 +#: ../../library/sysconfig.rst:358 msgid "If *expand* is set to false, the paths will not be expanded." msgstr "" -#: ../../library/sysconfig.rst:211 +#: ../../library/sysconfig.rst:360 msgid "" "If *scheme* is not an existing scheme, :func:`get_paths` will raise a :exc:" "`KeyError`." msgstr "" -#: ../../library/sysconfig.rst:216 +#: ../../library/sysconfig.rst:365 msgid "Other functions" msgstr "其他函式" -#: ../../library/sysconfig.rst:220 +#: ../../library/sysconfig.rst:369 msgid "" "Return the ``MAJOR.MINOR`` Python version number as a string. Similar to " "``'%d.%d' % sys.version_info[:2]``." msgstr "" +"回傳 ``MAJOR.MINOR`` Python 版本號碼字串。類似於 ``'%d.%d' % sys." +"version_info[:2]``。" -#: ../../library/sysconfig.rst:226 +#: ../../library/sysconfig.rst:375 msgid "Return a string that identifies the current platform." msgstr "" -#: ../../library/sysconfig.rst:228 +#: ../../library/sysconfig.rst:377 msgid "" "This is used mainly to distinguish platform-specific build directories and " "platform-specific built distributions. Typically includes the OS name and " @@ -375,99 +628,99 @@ msgid "" "version isn't particularly important." msgstr "" -#: ../../library/sysconfig.rst:234 +#: ../../library/sysconfig.rst:383 msgid "Examples of returned values:" msgstr "" -#: ../../library/sysconfig.rst:236 +#: ../../library/sysconfig.rst:385 msgid "linux-i586" msgstr "linux-i586" -#: ../../library/sysconfig.rst:237 +#: ../../library/sysconfig.rst:386 msgid "linux-alpha (?)" msgstr "linux-alpha (?)" -#: ../../library/sysconfig.rst:238 +#: ../../library/sysconfig.rst:387 msgid "solaris-2.6-sun4u" msgstr "solaris-2.6-sun4u" -#: ../../library/sysconfig.rst:240 +#: ../../library/sysconfig.rst:389 msgid "Windows will return one of:" msgstr "" -#: ../../library/sysconfig.rst:242 +#: ../../library/sysconfig.rst:391 msgid "win-amd64 (64bit Windows on AMD64, aka x86_64, Intel64, and EM64T)" msgstr "" -#: ../../library/sysconfig.rst:243 +#: ../../library/sysconfig.rst:392 msgid "win32 (all others - specifically, sys.platform is returned)" msgstr "" -#: ../../library/sysconfig.rst:245 +#: ../../library/sysconfig.rst:394 msgid "macOS can return:" msgstr "" -#: ../../library/sysconfig.rst:247 +#: ../../library/sysconfig.rst:396 msgid "macosx-10.6-ppc" msgstr "macosx-10.6-ppc" -#: ../../library/sysconfig.rst:248 +#: ../../library/sysconfig.rst:397 msgid "macosx-10.4-ppc64" msgstr "macosx-10.4-ppc64" -#: ../../library/sysconfig.rst:249 +#: ../../library/sysconfig.rst:398 msgid "macosx-10.3-i386" msgstr "macosx-10.3-i386" -#: ../../library/sysconfig.rst:250 +#: ../../library/sysconfig.rst:399 msgid "macosx-10.4-fat" msgstr "macosx-10.4-fat" -#: ../../library/sysconfig.rst:252 +#: ../../library/sysconfig.rst:401 msgid "" "For other non-POSIX platforms, currently just returns :data:`sys.platform`." msgstr "" -#: ../../library/sysconfig.rst:257 +#: ../../library/sysconfig.rst:406 msgid "" "Return ``True`` if the running Python interpreter was built from source and " "is being run from its built location, and not from a location resulting from " "e.g. running ``make install`` or installing via a binary installer." msgstr "" -#: ../../library/sysconfig.rst:264 +#: ../../library/sysconfig.rst:413 msgid "Parse a :file:`config.h`\\-style file." msgstr "" -#: ../../library/sysconfig.rst:266 +#: ../../library/sysconfig.rst:415 msgid "" "*fp* is a file-like object pointing to the :file:`config.h`\\-like file." msgstr "" -#: ../../library/sysconfig.rst:268 +#: ../../library/sysconfig.rst:417 msgid "" "A dictionary containing name/value pairs is returned. If an optional " "dictionary is passed in as the second argument, it is used instead of a new " "dictionary, and updated with the values read in the file." msgstr "" -#: ../../library/sysconfig.rst:275 +#: ../../library/sysconfig.rst:424 msgid "Return the path of :file:`pyconfig.h`." -msgstr "" +msgstr "回傳 :file:`pyconfig.h` 的路徑。" -#: ../../library/sysconfig.rst:279 +#: ../../library/sysconfig.rst:428 msgid "Return the path of :file:`Makefile`." -msgstr "" +msgstr "回傳 :file:`Makefile` 的路徑。" -#: ../../library/sysconfig.rst:283 +#: ../../library/sysconfig.rst:433 msgid "Using :mod:`sysconfig` as a script" -msgstr "" +msgstr "將 :mod:`sysconfig` 作為腳本使用" -#: ../../library/sysconfig.rst:285 +#: ../../library/sysconfig.rst:435 msgid "You can use :mod:`sysconfig` as a script with Python's *-m* option:" msgstr "" -#: ../../library/sysconfig.rst:311 +#: ../../library/sysconfig.rst:461 msgid "" "This call will print in the standard output the information returned by :" "func:`get_platform`, :func:`get_python_version`, :func:`get_path` and :func:" diff --git a/library/textwrap.po b/library/textwrap.po index b3e2baf799..8bb1b9de67 100644 --- a/library/textwrap.po +++ b/library/textwrap.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-21 00:03+0000\n" +"POT-Creation-Date: 2023-10-11 17:13+0000\n" "PO-Revision-Date: 2015-12-09 17:51+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -253,8 +253,8 @@ msgid "" "However, the sentence detection algorithm is imperfect: it assumes that a " "sentence ending consists of a lowercase letter followed by one of ``'.'``, " "``'!'``, or ``'?'``, possibly followed by one of ``'\"'`` or ``\"'\"``, " -"followed by a space. One problem with this is algorithm is that it is " -"unable to detect the difference between \"Dr.\" in ::" +"followed by a space. One problem with this algorithm is that it is unable " +"to detect the difference between \"Dr.\" in ::" msgstr "" #: ../../library/textwrap.rst:246 diff --git a/library/timeit.po b/library/timeit.po index e750ba6a16..5320b6898d 100644 --- a/library/timeit.po +++ b/library/timeit.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-27 18:15+0000\n" +"POT-Creation-Date: 2023-10-11 17:13+0000\n" "PO-Revision-Date: 2023-05-20 13:21+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -205,7 +205,7 @@ msgid "" "the total time >= 0.2 second, returning the eventual (number of loops, time " "taken for that number of loops). It calls :meth:`.timeit` with increasing " "numbers from the sequence 1, 2, 5, 10, 20, 50, ... until the time taken is " -"at least 0.2 second." +"at least 0.2 seconds." msgstr "" "這是一個便捷函式,它重複呼叫 :meth:`.timeit` 以使得總時間 >= 0.2 秒,再回傳最" "終結果(迴圈數、該迴圈數所花費的時間)。它以 1、2、5、10、20、50... 的順序遞" diff --git a/library/tty.po b/library/tty.po index 1a933d2ef3..112a009880 100644 --- a/library/tty.po +++ b/library/tty.po @@ -9,7 +9,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-10-11 17:13+0000\n" "PO-Revision-Date: 2021-12-17 17:00+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -67,7 +67,11 @@ msgstr "" "將檔案描述器 *fd* 的模式更改為 raw。如果 *when* 被省略,則預設為 :const:" "`termios.TCSAFLUSH`,並傳遞給 :func:`termios.tcsetattr`。" -#: ../../library/tty.rst:49 +#: ../../library/tty.rst:46 ../../library/tty.rst:57 +msgid "The return value is now the original tty attributes, instead of None." +msgstr "" + +#: ../../library/tty.rst:52 #, fuzzy msgid "" "Change the mode of file descriptor *fd* to cbreak. If *when* is omitted, it " @@ -78,10 +82,10 @@ msgstr "" "將檔案描述器 *fd* 的模式更改為 cbreak。如果 *when* 被省略,則預設為 :const:" "`termios.TCSAFLUSH`,並傳遞給 :func:`termios.tcsetattr`。" -#: ../../library/tty.rst:57 +#: ../../library/tty.rst:63 msgid "Module :mod:`termios`" msgstr ":mod:`termios` 模組" -#: ../../library/tty.rst:58 +#: ../../library/tty.rst:64 msgid "Low-level terminal control interface." msgstr "低階終端機控制介面。" diff --git a/library/typing.po b/library/typing.po index 5a8c520a50..59abe80c15 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-09-11 00:03+0000\n" +"POT-Creation-Date: 2023-10-11 17:13+0000\n" "PO-Revision-Date: 2023-09-05 14:49+0800\n" "Last-Translator: RockLeon \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -449,8 +449,8 @@ msgid "" "of type :class:`int` and returns a :class:`str`." msgstr "" -#: ../../library/typing.rst:271 ../../library/typing.rst:2873 -#: ../../library/typing.rst:3015 +#: ../../library/typing.rst:271 ../../library/typing.rst:2888 +#: ../../library/typing.rst:3030 msgid "For example:" msgstr "舉例來說:" @@ -488,7 +488,7 @@ msgid "" "ReturnType]`` respectively." msgstr "" -#: ../../library/typing.rst:341 ../../library/typing.rst:3544 +#: ../../library/typing.rst:341 ../../library/typing.rst:3559 msgid "" "``Callable`` now supports :class:`ParamSpec` and :data:`Concatenate`. See :" "pep:`612` for more details." @@ -870,7 +870,7 @@ 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:2813 +#: ../../library/typing.rst:1446 ../../library/typing.rst:2828 msgid "For example::" msgstr "" "舉例來說:\n" @@ -1199,7 +1199,7 @@ msgid "" "scopes cannot be overridden in subclasses." msgstr "" -#: ../../library/typing.rst:1248 ../../library/typing.rst:2829 +#: ../../library/typing.rst:1248 ../../library/typing.rst:2844 msgid "" "There is no runtime checking of these properties. See :pep:`591` for more " "details." @@ -1260,8 +1260,8 @@ msgstr "" #: ../../library/typing.rst:1293 msgid "" -"The responsibility of how to interpret the metadata lies with the the tool " -"or library encountering an ``Annotated`` annotation. A tool or library " +"The responsibility of how to interpret the metadata lies with the tool or " +"library encountering an ``Annotated`` annotation. A tool or library " "encountering an ``Annotated`` type can scan through the metadata elements to " "determine if they are of interest (e.g., using :func:`isinstance`)." msgstr "" @@ -1864,7 +1864,7 @@ msgid "Typed version of :func:`collections.namedtuple`." msgstr "" #: ../../library/typing.rst:2029 ../../library/typing.rst:2106 -#: ../../library/typing.rst:3055 +#: ../../library/typing.rst:3070 msgid "Usage::" msgstr "" @@ -2153,21 +2153,32 @@ msgid "" "``Point2D.__total__`` gives the value of the ``total`` argument. Example:" msgstr "" -#: ../../library/typing.rst:2401 +#: ../../library/typing.rst:2395 +msgid "" +"This attribute reflects *only* the value of the ``total`` argument to the " +"current ``TypedDict`` class, not whether the class is semantically total. " +"For example, a ``TypedDict`` with ``__total__`` set to True may have keys " +"marked with :data:`NotRequired`, or it may inherit from another " +"``TypedDict`` with ``total=False``. Therefore, it is generally better to " +"use :attr:`__required_keys__` and :attr:`__optional_keys__` for " +"introspection." +msgstr "" + +#: ../../library/typing.rst:2408 msgid "" "``Point2D.__required_keys__`` and ``Point2D.__optional_keys__`` return :" "class:`frozenset` objects containing required and non-required keys, " "respectively." msgstr "" -#: ../../library/typing.rst:2404 +#: ../../library/typing.rst:2411 msgid "" "Keys marked with :data:`Required` will always appear in " "``__required_keys__`` and keys marked with :data:`NotRequired` will always " "appear in ``__optional_keys__``." msgstr "" -#: ../../library/typing.rst:2407 +#: ../../library/typing.rst:2414 msgid "" "For backwards compatibility with Python 3.10 and below, it is also possible " "to use inheritance to declare both required and non-required keys in the " @@ -2176,133 +2187,142 @@ msgid "" "``TypedDict`` with a different value for ``total``:" msgstr "" -#: ../../library/typing.rst:2430 +#: ../../library/typing.rst:2439 +msgid "" +"If ``from __future__ import annotations`` is used or if annotations are " +"given as strings, annotations are not evaluated when the ``TypedDict`` is " +"defined. Therefore, the runtime introspection that ``__required_keys__`` and " +"``__optional_keys__`` rely on may not work properly, and the values of the " +"attributes may be incorrect." +msgstr "" + +#: ../../library/typing.rst:2445 msgid "" "See :pep:`589` for more examples and detailed rules of using ``TypedDict``." msgstr "" -#: ../../library/typing.rst:2434 +#: ../../library/typing.rst:2449 msgid "" "Added support for marking individual keys as :data:`Required` or :data:" "`NotRequired`. See :pep:`655`." msgstr "" -#: ../../library/typing.rst:2438 +#: ../../library/typing.rst:2453 msgid "Added support for generic ``TypedDict``\\ s." msgstr "" -#: ../../library/typing.rst:2442 +#: ../../library/typing.rst:2457 msgid "Protocols" msgstr "協定" -#: ../../library/typing.rst:2444 +#: ../../library/typing.rst:2459 msgid "" "The following protocols are provided by the typing module. All are decorated " "with :func:`@runtime_checkable `." msgstr "" -#: ../../library/typing.rst:2449 +#: ../../library/typing.rst:2464 msgid "" "An ABC with one abstract method ``__abs__`` that is covariant in its return " "type." msgstr "" -#: ../../library/typing.rst:2454 +#: ../../library/typing.rst:2469 msgid "An ABC with one abstract method ``__bytes__``." msgstr "一個有抽象方法 ``__bytes__`` 的 ABC。" -#: ../../library/typing.rst:2458 +#: ../../library/typing.rst:2473 msgid "An ABC with one abstract method ``__complex__``." msgstr "一個有抽象方法 ``__complex__`` 的 ABC。" -#: ../../library/typing.rst:2462 +#: ../../library/typing.rst:2477 msgid "An ABC with one abstract method ``__float__``." msgstr "一個有抽象方法 ``__float__`` 的 ABC。" -#: ../../library/typing.rst:2466 +#: ../../library/typing.rst:2481 msgid "An ABC with one abstract method ``__index__``." msgstr "一個有抽象方法 ``__index__`` 的 ABC。" -#: ../../library/typing.rst:2472 +#: ../../library/typing.rst:2487 msgid "An ABC with one abstract method ``__int__``." msgstr "一個有抽象方法 ``__int__`` 的 ABC。" -#: ../../library/typing.rst:2476 +#: ../../library/typing.rst:2491 msgid "" "An ABC with one abstract method ``__round__`` that is covariant in its " "return type." msgstr "" -#: ../../library/typing.rst:2480 +#: ../../library/typing.rst:2495 msgid "ABCs for working with IO" msgstr "" -#: ../../library/typing.rst:2486 +#: ../../library/typing.rst:2501 msgid "" "Generic type ``IO[AnyStr]`` and its subclasses ``TextIO(IO[str])`` and " "``BinaryIO(IO[bytes])`` represent the types of I/O streams such as returned " "by :func:`open`." msgstr "" -#: ../../library/typing.rst:2492 +#: ../../library/typing.rst:2507 msgid "Functions and decorators" msgstr "函式與裝飾器" -#: ../../library/typing.rst:2496 +#: ../../library/typing.rst:2511 msgid "Cast a value to a type." msgstr "" -#: ../../library/typing.rst:2498 +#: ../../library/typing.rst:2513 msgid "" "This returns the value unchanged. To the type checker this signals that the " "return value has the designated type, but at runtime we intentionally don't " "check anything (we want this to be as fast as possible)." msgstr "" -#: ../../library/typing.rst:2505 +#: ../../library/typing.rst:2520 msgid "" "Ask a static type checker to confirm that *val* has an inferred type of " "*typ*." msgstr "" -#: ../../library/typing.rst:2507 +#: ../../library/typing.rst:2522 msgid "" "At runtime this does nothing: it returns the first argument unchanged with " "no checks or side effects, no matter the actual type of the argument." msgstr "" -#: ../../library/typing.rst:2510 +#: ../../library/typing.rst:2525 msgid "" "When a static type checker encounters a call to ``assert_type()``, it emits " "an error if the value is not of the specified type::" msgstr "" -#: ../../library/typing.rst:2517 +#: ../../library/typing.rst:2532 msgid "" "This function is useful for ensuring the type checker's understanding of a " "script is in line with the developer's intentions::" msgstr "" -#: ../../library/typing.rst:2531 +#: ../../library/typing.rst:2546 msgid "" "Ask a static type checker to confirm that a line of code is unreachable." msgstr "" -#: ../../library/typing.rst:2533 +#: ../../library/typing.rst:2548 msgid "Example::" msgstr "" "舉例來說:\n" "\n" "::" -#: ../../library/typing.rst:2544 +#: ../../library/typing.rst:2559 msgid "" "Here, the annotations allow the type checker to infer that the last case can " "never execute, because ``arg`` is either an :class:`int` or a :class:`str`, " "and both options are covered by earlier cases." msgstr "" -#: ../../library/typing.rst:2549 +#: ../../library/typing.rst:2564 msgid "" "If a type checker finds that a call to ``assert_never()`` is reachable, it " "will emit an error. For example, if the type annotation for ``arg`` was " @@ -2312,59 +2332,59 @@ msgid "" "passed in must be the bottom type, :data:`Never`, and nothing else." msgstr "" -#: ../../library/typing.rst:2557 +#: ../../library/typing.rst:2572 msgid "At runtime, this throws an exception when called." msgstr "" -#: ../../library/typing.rst:2560 +#: ../../library/typing.rst:2575 msgid "" "`Unreachable Code and Exhaustiveness Checking `__ has more information about " "exhaustiveness checking with static typing." msgstr "" -#: ../../library/typing.rst:2568 +#: ../../library/typing.rst:2583 msgid "Reveal the inferred static type of an expression." msgstr "" -#: ../../library/typing.rst:2570 +#: ../../library/typing.rst:2585 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:2576 +#: ../../library/typing.rst:2591 msgid "" "This can be useful when you want to debug how your type checker handles a " "particular piece of code." msgstr "" -#: ../../library/typing.rst:2579 +#: ../../library/typing.rst:2594 msgid "" "The function returns its argument unchanged, which allows using it within an " "expression::" msgstr "" -#: ../../library/typing.rst:2584 +#: ../../library/typing.rst:2599 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:2589 +#: ../../library/typing.rst:2604 msgid "" "At runtime, this function prints the runtime type of its argument to stderr " "and returns it unchanged::" msgstr "" -#: ../../library/typing.rst:2601 +#: ../../library/typing.rst:2616 msgid "" "Decorator to mark an object as providing :func:`dataclass `-like behavior." msgstr "" -#: ../../library/typing.rst:2604 +#: ../../library/typing.rst:2619 msgid "" "``dataclass_transform`` may be used to decorate a class, metaclass, or a " "function that is itself a decorator. The presence of " @@ -2373,19 +2393,19 @@ msgid "" "to :func:`@dataclasses.dataclass `." msgstr "" -#: ../../library/typing.rst:2611 +#: ../../library/typing.rst:2626 msgid "Example usage with a decorator function:" msgstr "" -#: ../../library/typing.rst:2625 +#: ../../library/typing.rst:2640 msgid "On a base class::" msgstr "" -#: ../../library/typing.rst:2634 +#: ../../library/typing.rst:2649 msgid "On a metaclass::" msgstr "" -#: ../../library/typing.rst:2645 +#: ../../library/typing.rst:2660 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:2783 +#: ../../library/typing.rst:2798 msgid "" "*func* is the function object for the implementation of the overloaded " "function. For example, given the definition of ``process`` in the " @@ -2603,32 +2623,32 @@ msgid "" "returns an empty sequence." msgstr "" -#: ../../library/typing.rst:2790 +#: ../../library/typing.rst:2805 msgid "" "``get_overloads()`` can be used for introspecting an overloaded function at " "runtime." msgstr "" -#: ../../library/typing.rst:2798 +#: ../../library/typing.rst:2813 msgid "Clear all registered overloads in the internal registry." msgstr "" -#: ../../library/typing.rst:2800 +#: ../../library/typing.rst:2815 msgid "This can be used to reclaim the memory used by the registry." msgstr "" -#: ../../library/typing.rst:2807 +#: ../../library/typing.rst:2822 msgid "Decorator to indicate final methods and final classes." msgstr "" -#: ../../library/typing.rst:2809 +#: ../../library/typing.rst:2824 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:2834 +#: ../../library/typing.rst:2849 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__\", " @@ -2638,11 +2658,11 @@ msgid "" "exception." msgstr "" -#: ../../library/typing.rst:2845 +#: ../../library/typing.rst:2860 msgid "Decorator to indicate that annotations are not type hints." msgstr "" -#: ../../library/typing.rst:2847 +#: ../../library/typing.rst:2862 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 " @@ -2650,38 +2670,38 @@ msgid "" "will ignore all annotations in a function or class with this decorator." msgstr "" -#: ../../library/typing.rst:2853 +#: ../../library/typing.rst:2868 msgid "``@no_type_check`` mutates the decorated object in place." msgstr "" -#: ../../library/typing.rst:2857 +#: ../../library/typing.rst:2872 msgid "Decorator to give another decorator the :func:`no_type_check` effect." msgstr "" -#: ../../library/typing.rst:2859 +#: ../../library/typing.rst:2874 msgid "" "This wraps the decorator with something that wraps the decorated function " "in :func:`no_type_check`." msgstr "" -#: ../../library/typing.rst:2865 +#: ../../library/typing.rst:2880 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:2868 +#: ../../library/typing.rst:2883 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:2890 +#: ../../library/typing.rst:2905 msgid "There is no runtime checking of this property." msgstr "" -#: ../../library/typing.rst:2892 +#: ../../library/typing.rst:2907 msgid "" "The decorator will attempt to set an ``__override__`` attribute to ``True`` " "on the decorated object. Thus, a check like ``if getattr(obj, " @@ -2691,38 +2711,38 @@ msgid "" "without raising an exception." msgstr "" -#: ../../library/typing.rst:2899 +#: ../../library/typing.rst:2914 msgid "See :pep:`698` for more details." msgstr "更多細節請見 :pep:`698`。" -#: ../../library/typing.rst:2906 +#: ../../library/typing.rst:2921 msgid "Decorator to mark a class or function as unavailable at runtime." msgstr "" -#: ../../library/typing.rst:2908 +#: ../../library/typing.rst:2923 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:2919 +#: ../../library/typing.rst:2934 msgid "" "Note that returning instances of private classes is not recommended. It is " "usually preferable to make such classes public." msgstr "" -#: ../../library/typing.rst:2923 +#: ../../library/typing.rst:2938 msgid "Introspection helpers" msgstr "" -#: ../../library/typing.rst:2927 +#: ../../library/typing.rst:2942 msgid "" "Return a dictionary containing type hints for a function, method, module or " "class object." msgstr "" -#: ../../library/typing.rst:2930 +#: ../../library/typing.rst:2945 msgid "" "This is often the same as ``obj.__annotations__``. In addition, forward " "references encoded as string literals are handled by evaluating them in " @@ -2731,21 +2751,21 @@ msgid "" "__mro__`` in reverse order." msgstr "" -#: ../../library/typing.rst:2936 +#: ../../library/typing.rst:2951 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:2953 +#: ../../library/typing.rst:2968 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:2958 +#: ../../library/typing.rst:2973 msgid "" "Added ``include_extras`` parameter as part of :pep:`593`. See the " "documentation on :data:`Annotated` for more information." @@ -2753,20 +2773,20 @@ msgstr "" "新增 ``include_extras`` 參數(如 :pep:`593` 中所述)。更多資訊請見 :data:" "`Annotated` 的文件。" -#: ../../library/typing.rst:2962 +#: ../../library/typing.rst:2977 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:2969 +#: ../../library/typing.rst:2984 msgid "" "Get the unsubscripted version of a type: for a typing object of the form " "``X[Y, Z, ...]`` return ``X``." msgstr "" -#: ../../library/typing.rst:2972 +#: ../../library/typing.rst:2987 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 :" @@ -2774,17 +2794,17 @@ msgid "" "class:`ParamSpec`. Return ``None`` for unsupported objects." msgstr "" -#: ../../library/typing.rst:2978 ../../library/typing.rst:3001 +#: ../../library/typing.rst:2993 ../../library/typing.rst:3016 msgid "Examples:" msgstr "舉例:" -#: ../../library/typing.rst:2993 +#: ../../library/typing.rst:3008 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:2996 +#: ../../library/typing.rst:3011 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 " @@ -2792,40 +2812,40 @@ msgid "" "objects." msgstr "" -#: ../../library/typing.rst:3013 +#: ../../library/typing.rst:3028 msgid "Check if a type is a :class:`TypedDict`." msgstr "" -#: ../../library/typing.rst:3034 +#: ../../library/typing.rst:3049 msgid "" "Class used for internal typing representation of string forward references." msgstr "" -#: ../../library/typing.rst:3036 +#: ../../library/typing.rst:3051 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:3041 +#: ../../library/typing.rst:3056 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:3048 +#: ../../library/typing.rst:3063 msgid "Constant" msgstr "常數" -#: ../../library/typing.rst:3052 +#: ../../library/typing.rst:3067 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:3063 +#: ../../library/typing.rst:3078 msgid "" "The first type annotation must be enclosed in quotes, making it a \"forward " "reference\", to hide the ``expensive_mod`` reference from the interpreter " @@ -2833,7 +2853,7 @@ msgid "" "second annotation does not need to be enclosed in quotes." msgstr "" -#: ../../library/typing.rst:3070 +#: ../../library/typing.rst:3085 msgid "" "If ``from __future__ import annotations`` is used, annotations are not " "evaluated at function definition time. Instead, they are stored as strings " @@ -2841,11 +2861,11 @@ msgid "" "annotation (see :pep:`563`)." msgstr "" -#: ../../library/typing.rst:3082 +#: ../../library/typing.rst:3097 msgid "Deprecated aliases" msgstr "棄用的別名" -#: ../../library/typing.rst:3084 +#: ../../library/typing.rst:3099 msgid "" "This module defines several deprecated aliases to pre-existing standard " "library classes. These were originally included in the typing module in " @@ -2854,7 +2874,7 @@ msgid "" "existing classes were enhanced to support ``[]`` (see :pep:`585`)." msgstr "" -#: ../../library/typing.rst:3091 +#: ../../library/typing.rst:3106 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 " @@ -2862,7 +2882,7 @@ msgid "" "the interpreter for these aliases." msgstr "" -#: ../../library/typing.rst:3096 +#: ../../library/typing.rst:3111 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 " @@ -2870,188 +2890,188 @@ msgid "" "typing module without deprecation warnings until at least Python 3.14." msgstr "" -#: ../../library/typing.rst:3101 +#: ../../library/typing.rst:3116 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:3107 +#: ../../library/typing.rst:3122 msgid "Aliases to built-in types" msgstr "內建型別的別名" -#: ../../library/typing.rst:3111 +#: ../../library/typing.rst:3126 msgid "Deprecated alias to :class:`dict`." msgstr "棄用 :class:`dict` 的別名。" -#: ../../library/typing.rst:3113 +#: ../../library/typing.rst:3128 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:3117 ../../library/typing.rst:3359 +#: ../../library/typing.rst:3132 ../../library/typing.rst:3374 msgid "This type can be used as follows::" msgstr "" -#: ../../library/typing.rst:3122 +#: ../../library/typing.rst:3137 msgid "" ":class:`builtins.dict ` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3128 +#: ../../library/typing.rst:3143 msgid "Deprecated alias to :class:`list`." msgstr "棄用 :class:`list` 的別名。" -#: ../../library/typing.rst:3130 +#: ../../library/typing.rst:3145 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:3134 +#: ../../library/typing.rst:3149 msgid "This type may be used as follows::" msgstr "" -#: ../../library/typing.rst:3142 +#: ../../library/typing.rst:3157 msgid "" ":class:`builtins.list ` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3148 +#: ../../library/typing.rst:3163 msgid "Deprecated alias to :class:`builtins.set `." msgstr "棄用 :class:`builtins.set ` 的別名。" -#: ../../library/typing.rst:3150 +#: ../../library/typing.rst:3165 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:3154 +#: ../../library/typing.rst:3169 msgid "" ":class:`builtins.set ` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3160 +#: ../../library/typing.rst:3175 msgid "Deprecated alias to :class:`builtins.frozenset `." msgstr "棄用 :class:`builtins.frozenset ` 的別名。" -#: ../../library/typing.rst:3162 +#: ../../library/typing.rst:3177 msgid "" ":class:`builtins.frozenset ` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3169 +#: ../../library/typing.rst:3184 msgid "Deprecated alias for :class:`tuple`." msgstr "棄用 :class:`tuple` 的別名。" -#: ../../library/typing.rst:3171 +#: ../../library/typing.rst:3186 msgid "" ":class:`tuple` and ``Tuple`` are special-cased in the type system; see :ref:" "`annotating-tuples` for more details." msgstr "" -#: ../../library/typing.rst:3174 +#: ../../library/typing.rst:3189 msgid "" ":class:`builtins.tuple ` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3180 +#: ../../library/typing.rst:3195 msgid "Deprecated alias to :class:`type`." msgstr "棄用 :class:`type` 的別名。" -#: ../../library/typing.rst:3182 +#: ../../library/typing.rst:3197 msgid "" "See :ref:`type-of-class-objects` for details on using :class:`type` or " "``typing.Type`` in type annotations." msgstr "" -#: ../../library/typing.rst:3187 +#: ../../library/typing.rst:3202 msgid "" ":class:`builtins.type ` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3194 +#: ../../library/typing.rst:3209 msgid "Aliases to types in :mod:`collections`" msgstr ":mod:`collections` 中型別的別名" -#: ../../library/typing.rst:3198 +#: ../../library/typing.rst:3213 msgid "Deprecated alias to :class:`collections.defaultdict`." msgstr "棄用 :class:`collections.defaultdict` 的別名。" -#: ../../library/typing.rst:3202 +#: ../../library/typing.rst:3217 msgid "" ":class:`collections.defaultdict` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3208 +#: ../../library/typing.rst:3223 msgid "Deprecated alias to :class:`collections.OrderedDict`." msgstr "棄用 :class:`collections.OrderedDict` 的別名。" -#: ../../library/typing.rst:3212 +#: ../../library/typing.rst:3227 msgid "" ":class:`collections.OrderedDict` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3218 +#: ../../library/typing.rst:3233 msgid "Deprecated alias to :class:`collections.ChainMap`." msgstr "棄用 :class:`collections.ChainMap` 的別名。" -#: ../../library/typing.rst:3223 +#: ../../library/typing.rst:3238 msgid "" ":class:`collections.ChainMap` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3229 +#: ../../library/typing.rst:3244 msgid "Deprecated alias to :class:`collections.Counter`." msgstr "棄用 :class:`collections.Counter` 的別名。" -#: ../../library/typing.rst:3234 +#: ../../library/typing.rst:3249 msgid "" ":class:`collections.Counter` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3240 +#: ../../library/typing.rst:3255 msgid "Deprecated alias to :class:`collections.deque`." msgstr "棄用 :class:`collections.deque` 的別名。" -#: ../../library/typing.rst:3245 +#: ../../library/typing.rst:3260 msgid "" ":class:`collections.deque` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3252 +#: ../../library/typing.rst:3267 msgid "Aliases to other concrete types" msgstr "" -#: ../../library/typing.rst:3257 +#: ../../library/typing.rst:3272 msgid "" "The ``typing.io`` namespace is deprecated and will be removed. These types " "should be directly imported from ``typing`` instead." msgstr "" -#: ../../library/typing.rst:3261 +#: ../../library/typing.rst:3276 msgid "" "Deprecated aliases corresponding to the return types from :func:`re.compile` " "and :func:`re.match`." msgstr "" -#: ../../library/typing.rst:3264 +#: ../../library/typing.rst:3279 msgid "" "These types (and the corresponding functions) are generic over :data:" "`AnyStr`. ``Pattern`` can be specialised as ``Pattern[str]`` or " @@ -3059,391 +3079,391 @@ msgid "" "``Match[bytes]``." msgstr "" -#: ../../library/typing.rst:3272 +#: ../../library/typing.rst:3287 msgid "" "The ``typing.re`` namespace is deprecated and will be removed. These types " "should be directly imported from ``typing`` instead." msgstr "" -#: ../../library/typing.rst:3273 +#: ../../library/typing.rst:3288 msgid "" "Classes ``Pattern`` and ``Match`` from :mod:`re` now support ``[]``. See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3279 +#: ../../library/typing.rst:3294 msgid "Deprecated alias for :class:`str`." msgstr "棄用 :class:`str` 的別名。" -#: ../../library/typing.rst:3281 +#: ../../library/typing.rst:3296 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:3285 +#: ../../library/typing.rst:3300 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:3293 +#: ../../library/typing.rst:3308 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:3303 +#: ../../library/typing.rst:3318 msgid "Aliases to container ABCs in :mod:`collections.abc`" msgstr ":mod:`collections.abc` 中容器 ABC 的別名" -#: ../../library/typing.rst:3307 +#: ../../library/typing.rst:3322 msgid "Deprecated alias to :class:`collections.abc.Set`." msgstr "棄用 :class:`collections.abc.Set` 的別名。" -#: ../../library/typing.rst:3309 +#: ../../library/typing.rst:3324 msgid "" ":class:`collections.abc.Set` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3315 +#: ../../library/typing.rst:3330 msgid "" "This type represents the types :class:`bytes`, :class:`bytearray`, and :" "class:`memoryview` of byte sequences." msgstr "" -#: ../../library/typing.rst:3319 +#: ../../library/typing.rst:3334 msgid "" "Prefer :class:`collections.abc.Buffer`, or a union like ``bytes | bytearray " "| memoryview``." msgstr "" -#: ../../library/typing.rst:3323 +#: ../../library/typing.rst:3338 msgid "Deprecated alias to :class:`collections.abc.Collection`." msgstr "棄用 :class:`collections.abc.Collection` 的別名。" -#: ../../library/typing.rst:3327 +#: ../../library/typing.rst:3342 msgid "" ":class:`collections.abc.Collection` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3333 +#: ../../library/typing.rst:3348 msgid "Deprecated alias to :class:`collections.abc.Container`." msgstr "棄用 :class:`collections.abc.Container` 的別名。" -#: ../../library/typing.rst:3335 +#: ../../library/typing.rst:3350 msgid "" ":class:`collections.abc.Container` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3341 +#: ../../library/typing.rst:3356 msgid "Deprecated alias to :class:`collections.abc.ItemsView`." msgstr "棄用 :class:`collections.abc.ItemsView` 的別名。" -#: ../../library/typing.rst:3343 +#: ../../library/typing.rst:3358 msgid "" ":class:`collections.abc.ItemsView` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3349 +#: ../../library/typing.rst:3364 msgid "Deprecated alias to :class:`collections.abc.KeysView`." msgstr "棄用 :class:`collections.abc.KeysView` 的別名。" -#: ../../library/typing.rst:3351 +#: ../../library/typing.rst:3366 msgid "" ":class:`collections.abc.KeysView` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3357 +#: ../../library/typing.rst:3372 msgid "Deprecated alias to :class:`collections.abc.Mapping`." msgstr "棄用 :class:`collections.abc.Mapping` 的別名。" -#: ../../library/typing.rst:3364 +#: ../../library/typing.rst:3379 msgid "" ":class:`collections.abc.Mapping` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3370 +#: ../../library/typing.rst:3385 msgid "Deprecated alias to :class:`collections.abc.MappingView`." msgstr "棄用 :class:`collections.abc.MappingView` 的別名。" -#: ../../library/typing.rst:3372 +#: ../../library/typing.rst:3387 msgid "" ":class:`collections.abc.MappingView` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3378 +#: ../../library/typing.rst:3393 msgid "Deprecated alias to :class:`collections.abc.MutableMapping`." msgstr "棄用 :class:`collections.abc.MutableMapping` 的別名。" -#: ../../library/typing.rst:3380 +#: ../../library/typing.rst:3395 msgid "" ":class:`collections.abc.MutableMapping` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3387 +#: ../../library/typing.rst:3402 msgid "Deprecated alias to :class:`collections.abc.MutableSequence`." msgstr "棄用 :class:`collections.abc.MutableSequence` 的別名。" -#: ../../library/typing.rst:3389 +#: ../../library/typing.rst:3404 msgid "" ":class:`collections.abc.MutableSequence` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3396 +#: ../../library/typing.rst:3411 msgid "Deprecated alias to :class:`collections.abc.MutableSet`." msgstr "棄用 :class:`collections.abc.MutableSet` 的別名。" -#: ../../library/typing.rst:3398 +#: ../../library/typing.rst:3413 msgid "" ":class:`collections.abc.MutableSet` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3404 +#: ../../library/typing.rst:3419 msgid "Deprecated alias to :class:`collections.abc.Sequence`." msgstr "棄用 :class:`collections.abc.Sequence` 的別名。" -#: ../../library/typing.rst:3406 +#: ../../library/typing.rst:3421 msgid "" ":class:`collections.abc.Sequence` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3412 +#: ../../library/typing.rst:3427 msgid "Deprecated alias to :class:`collections.abc.ValuesView`." msgstr "棄用 :class:`collections.abc.ValuesView` 的別名。" -#: ../../library/typing.rst:3414 +#: ../../library/typing.rst:3429 msgid "" ":class:`collections.abc.ValuesView` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3421 +#: ../../library/typing.rst:3436 msgid "Aliases to asynchronous ABCs in :mod:`collections.abc`" msgstr "" -#: ../../library/typing.rst:3425 +#: ../../library/typing.rst:3440 msgid "Deprecated alias to :class:`collections.abc.Coroutine`." msgstr "棄用 :class:`collections.abc.Coroutine` 的別名。" -#: ../../library/typing.rst:3427 +#: ../../library/typing.rst:3442 msgid "" "The variance and order of type variables correspond to those of :class:" "`Generator`, for example::" msgstr "" -#: ../../library/typing.rst:3438 +#: ../../library/typing.rst:3453 msgid "" ":class:`collections.abc.Coroutine` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3444 +#: ../../library/typing.rst:3459 msgid "Deprecated alias to :class:`collections.abc.AsyncGenerator`." msgstr "棄用 :class:`collections.abc.AsyncGenerator` 的別名。" -#: ../../library/typing.rst:3446 +#: ../../library/typing.rst:3461 msgid "" "An async generator can be annotated by the generic type " "``AsyncGenerator[YieldType, SendType]``. For example::" msgstr "" -#: ../../library/typing.rst:3455 +#: ../../library/typing.rst:3470 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:3459 +#: ../../library/typing.rst:3474 msgid "" "If your generator will only yield values, set the ``SendType`` to ``None``::" msgstr "" -#: ../../library/typing.rst:3467 +#: ../../library/typing.rst:3482 msgid "" "Alternatively, annotate your generator as having a return type of either " "``AsyncIterable[YieldType]`` or ``AsyncIterator[YieldType]``::" msgstr "" -#: ../../library/typing.rst:3477 +#: ../../library/typing.rst:3492 msgid "" ":class:`collections.abc.AsyncGenerator` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3484 +#: ../../library/typing.rst:3499 msgid "Deprecated alias to :class:`collections.abc.AsyncIterable`." msgstr "棄用 :class:`collections.abc.AsyncIterable` 的別名。" -#: ../../library/typing.rst:3488 +#: ../../library/typing.rst:3503 msgid "" ":class:`collections.abc.AsyncIterable` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3494 +#: ../../library/typing.rst:3509 msgid "Deprecated alias to :class:`collections.abc.AsyncIterator`." msgstr "棄用 :class:`collections.abc.AsyncIterator` 的別名。" -#: ../../library/typing.rst:3498 +#: ../../library/typing.rst:3513 msgid "" ":class:`collections.abc.AsyncIterator` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3504 +#: ../../library/typing.rst:3519 msgid "Deprecated alias to :class:`collections.abc.Awaitable`." msgstr "棄用 :class:`collections.abc.Awaitable` 的別名。" -#: ../../library/typing.rst:3508 +#: ../../library/typing.rst:3523 msgid "" ":class:`collections.abc.Awaitable` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3515 +#: ../../library/typing.rst:3530 msgid "Aliases to other ABCs in :mod:`collections.abc`" msgstr "" -#: ../../library/typing.rst:3519 +#: ../../library/typing.rst:3534 msgid "Deprecated alias to :class:`collections.abc.Iterable`." msgstr "棄用 :class:`collections.abc.Iterable` 的別名。" -#: ../../library/typing.rst:3521 +#: ../../library/typing.rst:3536 msgid "" ":class:`collections.abc.Iterable` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3527 +#: ../../library/typing.rst:3542 msgid "Deprecated alias to :class:`collections.abc.Iterator`." msgstr "棄用 :class:`collections.abc.Iterator` 的別名。" -#: ../../library/typing.rst:3529 +#: ../../library/typing.rst:3544 msgid "" ":class:`collections.abc.Iterator` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3535 +#: ../../library/typing.rst:3550 msgid "Deprecated alias to :class:`collections.abc.Callable`." msgstr "棄用 :class:`collections.abc.Callable` 的別名。" -#: ../../library/typing.rst:3537 +#: ../../library/typing.rst:3552 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:3540 +#: ../../library/typing.rst:3555 msgid "" ":class:`collections.abc.Callable` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3550 +#: ../../library/typing.rst:3565 msgid "Deprecated alias to :class:`collections.abc.Generator`." msgstr "棄用 :class:`collections.abc.Generator` 的別名。" -#: ../../library/typing.rst:3552 +#: ../../library/typing.rst:3567 msgid "" "A generator can be annotated by the generic type ``Generator[YieldType, " "SendType, ReturnType]``. For example::" msgstr "" -#: ../../library/typing.rst:3561 +#: ../../library/typing.rst:3576 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:3565 +#: ../../library/typing.rst:3580 msgid "" "If your generator will only yield values, set the ``SendType`` and " "``ReturnType`` to ``None``::" msgstr "" -#: ../../library/typing.rst:3573 +#: ../../library/typing.rst:3588 msgid "" "Alternatively, annotate your generator as having a return type of either " "``Iterable[YieldType]`` or ``Iterator[YieldType]``::" msgstr "" -#: ../../library/typing.rst:3581 +#: ../../library/typing.rst:3596 msgid "" ":class:`collections.abc.Generator` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3587 +#: ../../library/typing.rst:3602 msgid "Deprecated alias to :class:`collections.abc.Hashable`." msgstr "棄用 :class:`collections.abc.Hashable` 的別名。" -#: ../../library/typing.rst:3589 +#: ../../library/typing.rst:3604 msgid "Use :class:`collections.abc.Hashable` directly instead." msgstr "改為直接使用 :class:`collections.abc.Hashable`。" -#: ../../library/typing.rst:3594 +#: ../../library/typing.rst:3609 msgid "Deprecated alias to :class:`collections.abc.Reversible`." msgstr "棄用 :class:`collections.abc.Reversible` 的別名。" -#: ../../library/typing.rst:3596 +#: ../../library/typing.rst:3611 msgid "" ":class:`collections.abc.Reversible` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3602 +#: ../../library/typing.rst:3617 msgid "Deprecated alias to :class:`collections.abc.Sized`." msgstr "棄用 :class:`collections.abc.Sized` 的別名。" -#: ../../library/typing.rst:3604 +#: ../../library/typing.rst:3619 msgid "Use :class:`collections.abc.Sized` directly instead." msgstr "改為直接使用 :class:`collections.abc.Sized`。" -#: ../../library/typing.rst:3610 +#: ../../library/typing.rst:3625 msgid "Aliases to :mod:`contextlib` ABCs" msgstr ":mod:`contextlib` ABC 的別名" -#: ../../library/typing.rst:3614 +#: ../../library/typing.rst:3629 msgid "Deprecated alias to :class:`contextlib.AbstractContextManager`." msgstr "" -#: ../../library/typing.rst:3619 +#: ../../library/typing.rst:3634 msgid "" ":class:`contextlib.AbstractContextManager` now supports subscripting " "(``[]``). See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3626 +#: ../../library/typing.rst:3641 msgid "Deprecated alias to :class:`contextlib.AbstractAsyncContextManager`." msgstr "" -#: ../../library/typing.rst:3631 +#: ../../library/typing.rst:3646 msgid "" ":class:`contextlib.AbstractAsyncContextManager` now supports subscripting " "(``[]``). See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3637 +#: ../../library/typing.rst:3652 msgid "Deprecation Timeline of Major Features" msgstr "" -#: ../../library/typing.rst:3639 +#: ../../library/typing.rst:3654 msgid "" "Certain features in ``typing`` are deprecated and may be removed in a future " "version of Python. The following table summarizes major deprecations for " @@ -3451,99 +3471,99 @@ msgid "" "listed." msgstr "" -#: ../../library/typing.rst:3646 +#: ../../library/typing.rst:3661 msgid "Feature" msgstr "" -#: ../../library/typing.rst:3647 +#: ../../library/typing.rst:3662 msgid "Deprecated in" msgstr "棄用於" -#: ../../library/typing.rst:3648 +#: ../../library/typing.rst:3663 msgid "Projected removal" msgstr "" -#: ../../library/typing.rst:3649 +#: ../../library/typing.rst:3664 msgid "PEP/issue" msgstr "" -#: ../../library/typing.rst:3650 +#: ../../library/typing.rst:3665 msgid "``typing.io`` and ``typing.re`` submodules" msgstr "``typing.io`` 和 ``typing.re`` 子模組" -#: ../../library/typing.rst:3651 +#: ../../library/typing.rst:3666 msgid "3.8" msgstr "3.8" -#: ../../library/typing.rst:3652 +#: ../../library/typing.rst:3667 msgid "3.13" msgstr "3.13" -#: ../../library/typing.rst:3653 +#: ../../library/typing.rst:3668 msgid ":issue:`38291`" msgstr ":issue:`38291`" -#: ../../library/typing.rst:3654 +#: ../../library/typing.rst:3669 msgid "``typing`` versions of standard collections" msgstr "" -#: ../../library/typing.rst:3655 ../../library/typing.rst:3659 +#: ../../library/typing.rst:3670 ../../library/typing.rst:3674 msgid "3.9" msgstr "3.9" -#: ../../library/typing.rst:3656 +#: ../../library/typing.rst:3671 msgid "Undecided (see :ref:`deprecated-aliases` for more information)" msgstr "" -#: ../../library/typing.rst:3657 +#: ../../library/typing.rst:3672 msgid ":pep:`585`" msgstr ":pep:`585`" -#: ../../library/typing.rst:3658 +#: ../../library/typing.rst:3673 msgid ":class:`typing.ByteString`" msgstr ":class:`typing.ByteString`" -#: ../../library/typing.rst:3660 +#: ../../library/typing.rst:3675 msgid "3.14" msgstr "3.14" -#: ../../library/typing.rst:3661 +#: ../../library/typing.rst:3676 msgid ":gh:`91896`" msgstr ":gh:`91896`" -#: ../../library/typing.rst:3662 +#: ../../library/typing.rst:3677 msgid ":data:`typing.Text`" msgstr ":data:`typing.Text`" -#: ../../library/typing.rst:3663 +#: ../../library/typing.rst:3678 msgid "3.11" msgstr "3.11" -#: ../../library/typing.rst:3664 ../../library/typing.rst:3668 -#: ../../library/typing.rst:3672 +#: ../../library/typing.rst:3679 ../../library/typing.rst:3683 +#: ../../library/typing.rst:3687 msgid "Undecided" msgstr "" -#: ../../library/typing.rst:3665 +#: ../../library/typing.rst:3680 msgid ":gh:`92332`" msgstr ":gh:`92332`" -#: ../../library/typing.rst:3666 +#: ../../library/typing.rst:3681 msgid ":class:`typing.Hashable` and :class:`typing.Sized`" msgstr ":class:`typing.Hashable` 和 :class:`typing.Sized`。" -#: ../../library/typing.rst:3667 ../../library/typing.rst:3671 +#: ../../library/typing.rst:3682 ../../library/typing.rst:3686 msgid "3.12" msgstr "" -#: ../../library/typing.rst:3669 +#: ../../library/typing.rst:3684 msgid ":gh:`94309`" msgstr ":gh:`94309`" -#: ../../library/typing.rst:3670 +#: ../../library/typing.rst:3685 msgid ":data:`typing.TypeAlias`" msgstr ":data:`typing.TypeAlias`" -#: ../../library/typing.rst:3673 +#: ../../library/typing.rst:3688 msgid ":pep:`695`" msgstr ":pep:`695`" diff --git a/library/urllib.error.po b/library/urllib.error.po index 5f9fa4e6df..6a7e30dd7a 100644 --- a/library/urllib.error.po +++ b/library/urllib.error.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-10-11 17:13+0000\n" "PO-Revision-Date: 2022-06-11 15:34+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -60,10 +60,11 @@ msgstr "此錯誤的原因。它可以是一個訊息字串或另一個例外實 #: ../../library/urllib.error.rst:29 msgid "" -":exc:`URLError` has been made a subclass of :exc:`OSError` instead of :exc:" -"`IOError`." +":exc:`URLError` used to be a subtype of :exc:`IOError`, which is now an " +"alias of :exc:`OSError`." msgstr "" -":exc:`URLError` 已被設為 :exc:`OSError` 而不是 :exc:`IOError` 的子類別。" +":exc:`URLError` 過去是 :exc:`OSError` 的子類別,但現在為 :exc:`OSError` 的別" +"名。" #: ../../library/urllib.error.rst:36 msgid "" @@ -78,7 +79,7 @@ msgstr "" #: ../../library/urllib.error.rst:44 msgid "Contains the request URL. An alias for *filename* attribute." -msgstr "" +msgstr "包含請求 URL。*filename* 屬性的別名。" #: ../../library/urllib.error.rst:49 msgid "" @@ -105,7 +106,7 @@ msgstr "" #: ../../library/urllib.error.rst:68 msgid "A file-like object where the HTTP error body can be read from." -msgstr "" +msgstr "一個類檔案物件,可以從中讀取 HTTP 錯誤主體 (body)。" #: ../../library/urllib.error.rst:72 msgid "" diff --git a/library/urllib.parse.po b/library/urllib.parse.po index 83389d4993..633427da03 100644 --- a/library/urllib.parse.po +++ b/library/urllib.parse.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-06 00:19+0000\n" +"POT-Creation-Date: 2023-10-11 17:13+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-" @@ -705,11 +705,11 @@ msgstr "" #: ../../library/urllib.parse.rst:601 msgid "" -"Replace special characters in *string* using the ``%xx`` escape. Letters, " -"digits, and the characters ``'_.-~'`` are never quoted. By default, this " -"function is intended for quoting the path section of a URL. The optional " -"*safe* parameter specifies additional ASCII characters that should not be " -"quoted --- its default value is ``'/'``." +"Replace special characters in *string* using the :samp:`%{xx}` escape. " +"Letters, digits, and the characters ``'_.-~'`` are never quoted. By default, " +"this function is intended for quoting the path section of a URL. The " +"optional *safe* parameter specifies additional ASCII characters that should " +"not be quoted --- its default value is ``'/'``." msgstr "" #: ../../library/urllib.parse.rst:607 ../../library/urllib.parse.rst:653 @@ -767,10 +767,10 @@ msgstr "" #: ../../library/urllib.parse.rst:648 msgid "" -"Replace ``%xx`` escapes with their single-character equivalent. The optional " -"*encoding* and *errors* parameters specify how to decode percent-encoded " -"sequences into Unicode characters, as accepted by the :meth:`bytes.decode` " -"method." +"Replace :samp:`%{xx}` escapes with their single-character equivalent. The " +"optional *encoding* and *errors* parameters specify how to decode percent-" +"encoded sequences into Unicode characters, as accepted by the :meth:`bytes." +"decode` method." msgstr "" #: ../../library/urllib.parse.rst:655 @@ -804,8 +804,8 @@ msgstr "" #: ../../library/urllib.parse.rst:679 msgid "" -"Replace ``%xx`` escapes with their single-octet equivalent, and return a :" -"class:`bytes` object." +"Replace :samp:`%{xx}` escapes with their single-octet equivalent, and return " +"a :class:`bytes` object." msgstr "" #: ../../library/urllib.parse.rst:684 diff --git a/library/venv.po b/library/venv.po index 9b857481d1..65b4bad59c 100644 --- a/library/venv.po +++ b/library/venv.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-24 00:03+0000\n" +"POT-Creation-Date: 2023-10-11 17:13+0000\n" "PO-Revision-Date: 2023-07-09 15:09+0800\n" "Last-Translator: Po-Chuan Chen \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -46,10 +46,45 @@ msgid "" msgstr "" #: ../../library/venv.rst:33 +msgid "A virtual environment is (amongst other things):" +msgstr "" + +#: ../../library/venv.rst:35 +msgid "" +"Used to contain a specific Python interpreter and software libraries and " +"binaries which are needed to support a project (library or application). " +"These are by default isolated from software in other virtual environments " +"and Python interpreters and libraries installed in the operating system." +msgstr "" + +#: ../../library/venv.rst:40 +msgid "" +"Contained in a directory, conventionally either named ``venv`` or ``.venv`` " +"in the project directory, or under a container directory for lots of virtual " +"environments, such as ``~/.virtualenvs``." +msgstr "" + +#: ../../library/venv.rst:44 +msgid "Not checked into source control systems such as Git." +msgstr "" + +#: ../../library/venv.rst:46 +msgid "" +"Considered as disposable -- it should be simple to delete and recreate it " +"from scratch. You don't place any project code in the environment" +msgstr "" + +#: ../../library/venv.rst:49 +msgid "" +"Not considered as movable or copyable -- you just recreate the same " +"environment in the target location." +msgstr "" + +#: ../../library/venv.rst:52 msgid "See :pep:`405` for more background on Python virtual environments." msgstr "更多關於 Python 虛擬環境的背景資訊請見 :pep:`405`\\ 。" -#: ../../library/venv.rst:37 +#: ../../library/venv.rst:56 msgid "" "`Python Packaging User Guide: Creating and using virtual environments " "}` 需要替換成包含虛擬環" "境的目錄路徑)" -#: ../../library/venv.rst:71 +#: ../../library/venv.rst:90 msgid "Platform" msgstr "平台" -#: ../../library/venv.rst:71 +#: ../../library/venv.rst:90 msgid "Shell" msgstr "Shell" -#: ../../library/venv.rst:71 +#: ../../library/venv.rst:90 msgid "Command to activate virtual environment" msgstr "啟動虛擬環境的指令" -#: ../../library/venv.rst:73 +#: ../../library/venv.rst:92 msgid "POSIX" msgstr "POSIX" -#: ../../library/venv.rst:73 +#: ../../library/venv.rst:92 msgid "bash/zsh" msgstr "bash/zsh" -#: ../../library/venv.rst:73 +#: ../../library/venv.rst:92 msgid ":samp:`$ source {}/bin/activate`" msgstr ":samp:`$ source {}/bin/activate`" -#: ../../library/venv.rst:75 +#: ../../library/venv.rst:94 msgid "fish" msgstr "fish" -#: ../../library/venv.rst:75 +#: ../../library/venv.rst:94 msgid ":samp:`$ source {}/bin/activate.fish`" msgstr ":samp:`$ source {}/bin/activate.fish`" -#: ../../library/venv.rst:77 +#: ../../library/venv.rst:96 msgid "csh/tcsh" msgstr "csh/tcsh" -#: ../../library/venv.rst:77 +#: ../../library/venv.rst:96 msgid ":samp:`$ source {}/bin/activate.csh`" msgstr ":samp:`$ source {}/bin/activate.csh`" -#: ../../library/venv.rst:79 ../../library/venv.rst:83 +#: ../../library/venv.rst:98 ../../library/venv.rst:102 msgid "PowerShell" msgstr "PowerShell" -#: ../../library/venv.rst:79 +#: ../../library/venv.rst:98 msgid ":samp:`$ {}/bin/Activate.ps1`" msgstr ":samp:`$ {}/bin/Activate.ps1`" -#: ../../library/venv.rst:81 +#: ../../library/venv.rst:100 msgid "Windows" msgstr "Windows" -#: ../../library/venv.rst:81 +#: ../../library/venv.rst:100 msgid "cmd.exe" msgstr "cmd.exe" -#: ../../library/venv.rst:81 +#: ../../library/venv.rst:100 msgid ":samp:`C:\\\\> {}\\\\Scripts\\\\activate.bat`" msgstr ":samp:`C:\\\\> {}\\\\Scripts\\\\activate.bat`" -#: ../../library/venv.rst:83 +#: ../../library/venv.rst:102 msgid ":samp:`PS C:\\\\> {}\\\\Scripts\\\\Activate.ps1`" msgstr ":samp:`PS C:\\\\> {}\\\\Scripts\\\\Activate.ps1`" -#: ../../library/venv.rst:86 +#: ../../library/venv.rst:105 msgid ":program:`fish` and :program:`csh` activation scripts." msgstr ":program:`fish` 和 :program:`csh` 啟動腳本。" -#: ../../library/venv.rst:89 +#: ../../library/venv.rst:108 msgid "" "PowerShell activation scripts installed under POSIX for PowerShell Core " "support." msgstr "PowerShell 的啟動腳本安裝在 POSIX 上支援 PowerShell Core。" -#: ../../library/venv.rst:93 +#: ../../library/venv.rst:112 msgid "" "You don't specifically *need* to activate a virtual environment, as you can " "just specify the full path to that environment's Python interpreter when " @@ -331,7 +366,7 @@ msgstr "" "整路徑。此外,所有安裝在環境裡的腳本都應該都可以在未啟用虛擬環境的情況下運" "行。" -#: ../../library/venv.rst:99 +#: ../../library/venv.rst:118 msgid "" "In order to achieve this, scripts installed into virtual environments have a " "\"shebang\" line which points to the environment's Python interpreter, i.e. :" @@ -349,7 +384,7 @@ msgstr "" "(Windows Explorer)中雙擊已安裝的腳本,應該可以在沒有啟用環境或將其加入 :" "envvar:`PATH` 的情況下正確地運行。" -#: ../../library/venv.rst:108 +#: ../../library/venv.rst:127 msgid "" "When a virtual environment has been activated, the :envvar:`!VIRTUAL_ENV` " "environment variable is set to the path of the environment. Since explicitly " @@ -361,7 +396,7 @@ msgstr "" "於不需要明確啟用虛擬環境才能使用它。因此,無法依賴 :envvar:`!VIRTUAL_ENV` 來" "判斷是否正在使用虛擬環境。" -#: ../../library/venv.rst:114 +#: ../../library/venv.rst:133 msgid "" "Because scripts installed in environments should not expect the environment " "to be activated, their shebang lines contain the absolute paths to their " @@ -378,13 +413,13 @@ msgid "" msgstr "" "因為安裝在環境中的腳本不應該預期該環境已經被啟動,所以它們的 shebang 列會包含" "環境直譯器的絕對路徑。因此,在一般情況下,環境本質上是不可攜帶的。你應該使用" -"一個簡單的方法來重新建立一個環境(例如:如果你有一個名為 ``requirements.txt`` " -"的需求檔案,你可以使用環境的 ``pip install -r requirements.txt`` 來安裝環境所" -"需的所有套件)。如果出於某種原因,你需要將環境移至新位置,你應該在所需位置重" -"新建立它,並刪除舊位置的環境。如果你移動環境是因為移動了其父目錄,你應該在新" -"位置重新建立環境。否則,安裝在該環境中的軟體可能無法正常運作。" +"一個簡單的方法來重新建立一個環境(例如:如果你有一個名為 ``requirements." +"txt`` 的需求檔案,你可以使用環境的 ``pip install -r requirements.txt`` 來安裝" +"環境所需的所有套件)。如果出於某種原因,你需要將環境移至新位置,你應該在所需" +"位置重新建立它,並刪除舊位置的環境。如果你移動環境是因為移動了其父目錄,你應" +"該在新位置重新建立環境。否則,安裝在該環境中的軟體可能無法正常運作。" -#: ../../library/venv.rst:128 +#: ../../library/venv.rst:147 msgid "" "You can deactivate a virtual environment by typing ``deactivate`` in your " "shell. The exact mechanism is platform-specific and is an internal " @@ -393,11 +428,11 @@ msgstr "" "你可以在 shell 輸入 ``deactivate`` 來關閉虛擬環境。具體的使用方式因平台而異," "是內部實作的細節(通常會使用腳本或是 shell 函式)" -#: ../../library/venv.rst:136 +#: ../../library/venv.rst:155 msgid "API" msgstr "API" -#: ../../library/venv.rst:140 +#: ../../library/venv.rst:159 msgid "" "The high-level method described above makes use of a simple API which " "provides mechanisms for third-party virtual environment creators to " @@ -407,13 +442,13 @@ msgstr "" "上述提到的高階 method(方法)透過簡單的 API 使用, 為第三方虛擬環境建立者提供" "可以依據他們需求來建立環境的客製化機制: :class:`EnvBuilder` class。" -#: ../../library/venv.rst:148 +#: ../../library/venv.rst:167 msgid "" "The :class:`EnvBuilder` class accepts the following keyword arguments on " "instantiation:" msgstr "進行實例化時,class :class:`EnvBuilder` 接受下列的關鍵字引數:" -#: ../../library/venv.rst:151 +#: ../../library/venv.rst:170 msgid "" "``system_site_packages`` -- a Boolean value indicating that the system " "Python site-packages should be available to the environment (defaults to " @@ -422,7 +457,7 @@ msgstr "" "``system_site_packages`` -- 為一個 Boolean (布林值),並表明系統的 Python " "site-packages 是否可以在環境中可用(預設為 ``False`` )。" -#: ../../library/venv.rst:154 +#: ../../library/venv.rst:173 msgid "" "``clear`` -- a Boolean value which, if true, will delete the contents of any " "existing target directory, before creating the environment." @@ -430,7 +465,7 @@ msgstr "" "``clear`` -- 為一個 Boolean,如果為 true,則在建立環境之前,刪除目標目錄內所" "有存在的內容。" -#: ../../library/venv.rst:157 +#: ../../library/venv.rst:176 msgid "" "``symlinks`` -- a Boolean value indicating whether to attempt to symlink the " "Python binary rather than copying." @@ -438,7 +473,7 @@ msgstr "" "``symlinks`` -- 為一個 Boolean,並表明是否嘗試與 Python 二進位檔案建立符號連" "結而不是複製該檔案。" -#: ../../library/venv.rst:160 +#: ../../library/venv.rst:179 msgid "" "``upgrade`` -- a Boolean value which, if true, will upgrade an existing " "environment with the running Python - for use when that Python has been " @@ -447,7 +482,7 @@ msgstr "" "``upgrade`` -- 為一個 Boolean,若為 true,則會在執行 Python 時為現有的環境進" "行升級。目的是讓 Python 可以升級到位(預設為 ``False``)。" -#: ../../library/venv.rst:164 +#: ../../library/venv.rst:183 msgid "" "``with_pip`` -- a Boolean value which, if true, ensures pip is installed in " "the virtual environment. This uses :mod:`ensurepip` with the ``--default-" @@ -456,7 +491,7 @@ msgstr "" "``with_pip`` -- 為一個 Boolean,若為 true,則確保 pip 有安裝至虛擬環境之中。" "當有 ``--default-pip`` 的選項時,會使用 :mod:`ensurepip`。" -#: ../../library/venv.rst:168 +#: ../../library/venv.rst:187 msgid "" "``prompt`` -- a String to be used after virtual environment is activated " "(defaults to ``None`` which means directory name of the environment would be " @@ -467,23 +502,23 @@ msgstr "" "為 ``None``,代表該環境的目錄名稱會被使用)倘若出現特殊字串 ``\".\"`` ,則當" "前目錄的 basename 會做為提示路徑使用。" -#: ../../library/venv.rst:173 +#: ../../library/venv.rst:192 msgid "``upgrade_deps`` -- Update the base venv modules to the latest on PyPI" msgstr "``upgrade_deps`` -- 更新基礎 venv 模組至 PyPI 的最新版本" -#: ../../library/venv.rst:175 ../../library/venv.rst:353 +#: ../../library/venv.rst:194 ../../library/venv.rst:372 msgid "Added the ``with_pip`` parameter" msgstr "新增 ``with_pip`` 參數" -#: ../../library/venv.rst:178 ../../library/venv.rst:356 +#: ../../library/venv.rst:197 ../../library/venv.rst:375 msgid "Added the ``prompt`` parameter" msgstr "新增 ``prompt`` 參數" -#: ../../library/venv.rst:181 ../../library/venv.rst:359 +#: ../../library/venv.rst:200 ../../library/venv.rst:378 msgid "Added the ``upgrade_deps`` parameter" msgstr "新增 ``upgrade_deps`` 參數" -#: ../../library/venv.rst:184 +#: ../../library/venv.rst:203 msgid "" "Creators of third-party virtual environment tools will be free to use the " "provided :class:`EnvBuilder` class as a base class." @@ -491,11 +526,11 @@ msgstr "" "第三方虛擬環境工具的建立者可以自由地使用 :class:`EnvBuilder` class 作為 base " "class(基底類別)使用." -#: ../../library/venv.rst:187 +#: ../../library/venv.rst:206 msgid "The returned env-builder is an object which has a method, ``create``:" msgstr "回傳的 env-builder 為一個物件,且帶有一個 method ``create``:" -#: ../../library/venv.rst:191 +#: ../../library/venv.rst:210 msgid "" "Create a virtual environment by specifying the target directory (absolute or " "relative to the current directory) which is to contain the virtual " @@ -506,7 +541,7 @@ msgstr "" "目錄),也就是在該目錄中容納虛擬環境。``create`` method 將會在指定的目錄下建" "立環境,或是觸發適當的例外。" -#: ../../library/venv.rst:197 +#: ../../library/venv.rst:216 msgid "" "The ``create`` method of the :class:`EnvBuilder` class illustrates the hooks " "available for subclass customization::" @@ -514,7 +549,7 @@ msgstr "" ":class:`EnvBuilder` class 的 ``create`` method 會闡述可用的 Hooks 以客製化 " "subclass (子類別)::" -#: ../../library/venv.rst:212 +#: ../../library/venv.rst:231 msgid "" "Each of the methods :meth:`ensure_directories`, :meth:" "`create_configuration`, :meth:`setup_python`, :meth:`setup_scripts` and :" @@ -523,7 +558,7 @@ msgstr "" "每個 methods :meth:`ensure_directories`、:meth:`create_configuration`、:meth:" "`setup_python`、:meth:`setup_scripts` 及 :meth:`post_setup` 都可以被覆寫。" -#: ../../library/venv.rst:218 +#: ../../library/venv.rst:237 msgid "" "Creates the environment directory and all necessary subdirectories that " "don't already exist, and returns a context object. This context object is " @@ -537,7 +572,7 @@ msgstr "" "class:`EnvBuilder` 已被建立且帶有 ``clear=True`` 的引數,該環境目錄下的內容將" "被清空,以及所有必要的子目錄將被重新建立。" -#: ../../library/venv.rst:225 +#: ../../library/venv.rst:244 msgid "" "The returned context object is a :class:`types.SimpleNamespace` with the " "following attributes:" @@ -545,81 +580,81 @@ msgstr "" "回傳的情境物件(context object)其型別會是 :class:`types.SimpleNamespace`,並" "包含以下屬性:" -#: ../../library/venv.rst:228 +#: ../../library/venv.rst:247 msgid "" "``env_dir`` - The location of the virtual environment. Used for " "``__VENV_DIR__`` in activation scripts (see :meth:`install_scripts`)." msgstr "" -#: ../../library/venv.rst:231 +#: ../../library/venv.rst:250 msgid "" "``env_name`` - The name of the virtual environment. Used for " "``__VENV_NAME__`` in activation scripts (see :meth:`install_scripts`)." msgstr "" -#: ../../library/venv.rst:234 +#: ../../library/venv.rst:253 msgid "" "``prompt`` - The prompt to be used by the activation scripts. Used for " "``__VENV_PROMPT__`` in activation scripts (see :meth:`install_scripts`)." msgstr "" -#: ../../library/venv.rst:237 +#: ../../library/venv.rst:256 msgid "" "``executable`` - The underlying Python executable used by the virtual " "environment. This takes into account the case where a virtual environment is " "created from another virtual environment." msgstr "" -#: ../../library/venv.rst:241 +#: ../../library/venv.rst:260 msgid "``inc_path`` - The include path for the virtual environment." msgstr "" -#: ../../library/venv.rst:243 +#: ../../library/venv.rst:262 msgid "``lib_path`` - The purelib path for the virtual environment." msgstr "" -#: ../../library/venv.rst:245 +#: ../../library/venv.rst:264 msgid "``bin_path`` - The script path for the virtual environment." msgstr "" -#: ../../library/venv.rst:247 +#: ../../library/venv.rst:266 msgid "" "``bin_name`` - The name of the script path relative to the virtual " "environment location. Used for ``__VENV_BIN_NAME__`` in activation scripts " "(see :meth:`install_scripts`)." msgstr "" -#: ../../library/venv.rst:251 +#: ../../library/venv.rst:270 msgid "" "``env_exe`` - The name of the Python interpreter in the virtual environment. " "Used for ``__VENV_PYTHON__`` in activation scripts (see :meth:" "`install_scripts`)." msgstr "" -#: ../../library/venv.rst:255 +#: ../../library/venv.rst:274 msgid "" "``env_exec_cmd`` - The name of the Python interpreter, taking into account " "filesystem redirections. This can be used to run Python in the virtual " "environment." msgstr "" -#: ../../library/venv.rst:260 +#: ../../library/venv.rst:279 msgid "" "The attribute ``lib_path`` was added to the context, and the context object " "was documented." msgstr "" -#: ../../library/venv.rst:264 +#: ../../library/venv.rst:283 msgid "" "The *venv* :ref:`sysconfig installation scheme ` is used " "to construct the paths of the created directories." msgstr "" -#: ../../library/venv.rst:271 +#: ../../library/venv.rst:290 msgid "Creates the ``pyvenv.cfg`` configuration file in the environment." msgstr "" -#: ../../library/venv.rst:275 +#: ../../library/venv.rst:294 msgid "" "Creates a copy or symlink to the Python executable in the environment. On " "POSIX systems, if a specific executable ``python3.x`` was used, symlinks to " @@ -627,48 +662,48 @@ msgid "" "unless files with those names already exist." msgstr "" -#: ../../library/venv.rst:282 +#: ../../library/venv.rst:301 msgid "" "Installs activation scripts appropriate to the platform into the virtual " "environment." msgstr "" -#: ../../library/venv.rst:287 +#: ../../library/venv.rst:306 msgid "" "Upgrades the core venv dependency packages (currently ``pip``) in the " "environment. This is done by shelling out to the ``pip`` executable in the " "environment." msgstr "" -#: ../../library/venv.rst:298 +#: ../../library/venv.rst:317 msgid "" "A placeholder method which can be overridden in third party implementations " "to pre-install packages in the virtual environment or perform other post-" "creation steps." msgstr "" -#: ../../library/venv.rst:302 +#: ../../library/venv.rst:321 msgid "" "Windows now uses redirector scripts for ``python[w].exe`` instead of copying " "the actual binaries. In 3.7.2 only :meth:`setup_python` does nothing unless " "running from a build in the source tree." msgstr "" -#: ../../library/venv.rst:307 +#: ../../library/venv.rst:326 msgid "" "Windows copies the redirector scripts as part of :meth:`setup_python` " "instead of :meth:`setup_scripts`. This was not the case in 3.7.2. When using " "symlinks, the original executables will be linked." msgstr "" -#: ../../library/venv.rst:312 +#: ../../library/venv.rst:331 msgid "" "In addition, :class:`EnvBuilder` provides this utility method that can be " "called from :meth:`setup_scripts` or :meth:`post_setup` in subclasses to " "assist in installing custom scripts into the virtual environment." msgstr "" -#: ../../library/venv.rst:318 +#: ../../library/venv.rst:337 msgid "" "*path* is the path to a directory that should contain subdirectories " "\"common\", \"posix\", \"nt\", each containing scripts destined for the bin " @@ -677,64 +712,64 @@ msgid "" "placeholders:" msgstr "" -#: ../../library/venv.rst:324 +#: ../../library/venv.rst:343 msgid "" "``__VENV_DIR__`` is replaced with the absolute path of the environment " "directory." msgstr "" -#: ../../library/venv.rst:327 +#: ../../library/venv.rst:346 msgid "" "``__VENV_NAME__`` is replaced with the environment name (final path segment " "of environment directory)." msgstr "" -#: ../../library/venv.rst:330 +#: ../../library/venv.rst:349 msgid "" "``__VENV_PROMPT__`` is replaced with the prompt (the environment name " "surrounded by parentheses and with a following space)" msgstr "" -#: ../../library/venv.rst:333 +#: ../../library/venv.rst:352 msgid "" "``__VENV_BIN_NAME__`` is replaced with the name of the bin directory (either " "``bin`` or ``Scripts``)." msgstr "" -#: ../../library/venv.rst:336 +#: ../../library/venv.rst:355 msgid "" "``__VENV_PYTHON__`` is replaced with the absolute path of the environment's " "executable." msgstr "" -#: ../../library/venv.rst:339 +#: ../../library/venv.rst:358 msgid "" "The directories are allowed to exist (for when an existing environment is " "being upgraded)." msgstr "" -#: ../../library/venv.rst:342 +#: ../../library/venv.rst:361 msgid "There is also a module-level convenience function:" msgstr "" -#: ../../library/venv.rst:348 +#: ../../library/venv.rst:367 msgid "" "Create an :class:`EnvBuilder` with the given keyword arguments, and call " "its :meth:`~EnvBuilder.create` method with the *env_dir* argument." msgstr "" -#: ../../library/venv.rst:363 +#: ../../library/venv.rst:382 msgid "An example of extending ``EnvBuilder``" msgstr "" -#: ../../library/venv.rst:365 +#: ../../library/venv.rst:384 msgid "" "The following script shows how to extend :class:`EnvBuilder` by implementing " "a subclass which installs setuptools and pip into a created virtual " "environment::" msgstr "" -#: ../../library/venv.rst:576 +#: ../../library/venv.rst:595 msgid "" "This script is also available for download `online `_." diff --git a/library/weakref.po b/library/weakref.po index dcb2927e50..7dc80648fd 100644 --- a/library/weakref.po +++ b/library/weakref.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-12-22 00:15+0000\n" +"POT-Creation-Date: 2023-10-11 17:13+0000\n" "PO-Revision-Date: 2018-05-23 16:15+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -160,7 +160,7 @@ msgstr "" msgid "" "Exceptions raised by the callback will be noted on the standard error " "output, but cannot be propagated; they are handled in exactly the same way " -"as exceptions raised from an object's :meth:`__del__` method." +"as exceptions raised from an object's :meth:`~object.__del__` method." msgstr "" #: ../../library/weakref.rst:116 @@ -284,21 +284,20 @@ msgstr "" #: ../../library/weakref.rst:223 msgid "" ":class:`WeakValueDictionary` objects have an additional method that has the " -"same issues as the :meth:`keyrefs` method of :class:`WeakKeyDictionary` " -"objects." +"same issues as the :meth:`WeakKeyDictionary.keyrefs` method." msgstr "" -#: ../../library/weakref.rst:230 +#: ../../library/weakref.rst:229 msgid "Return an iterable of the weak references to the values." msgstr "" -#: ../../library/weakref.rst:235 +#: ../../library/weakref.rst:234 msgid "" "Set class that keeps weak references to its elements. An element will be " "discarded when no strong reference to it exists any more." msgstr "" -#: ../../library/weakref.rst:241 +#: ../../library/weakref.rst:240 msgid "" "A custom :class:`ref` subclass which simulates a weak reference to a bound " "method (i.e., a method defined on a class and looked up on an instance). " @@ -307,13 +306,13 @@ msgid "" "method until either the object or the original function dies::" msgstr "" -#: ../../library/weakref.rst:265 +#: ../../library/weakref.rst:264 msgid "" "*callback* is the same as the parameter of the same name to the :func:`ref` " "function." msgstr "" -#: ../../library/weakref.rst:271 +#: ../../library/weakref.rst:270 msgid "" "Return a callable finalizer object which will be called when *obj* is " "garbage collected. Unlike an ordinary weak reference, a finalizer will " @@ -321,7 +320,7 @@ msgid "" "lifecycle management." msgstr "" -#: ../../library/weakref.rst:276 +#: ../../library/weakref.rst:275 msgid "" "A finalizer is considered *alive* until it is called (either explicitly or " "at garbage collection), and after that it is *dead*. Calling a live " @@ -329,58 +328,58 @@ msgid "" "calling a dead finalizer returns :const:`None`." msgstr "" -#: ../../library/weakref.rst:281 +#: ../../library/weakref.rst:280 msgid "" "Exceptions raised by finalizer callbacks during garbage collection will be " "shown on the standard error output, but cannot be propagated. They are " -"handled in the same way as exceptions raised from an object's :meth:" -"`__del__` method or a weak reference's callback." +"handled in the same way as exceptions raised from an object's :meth:`~object." +"__del__` method or a weak reference's callback." msgstr "" -#: ../../library/weakref.rst:287 +#: ../../library/weakref.rst:286 msgid "" "When the program exits, each remaining live finalizer is called unless its :" "attr:`atexit` attribute has been set to false. They are called in reverse " "order of creation." msgstr "" -#: ../../library/weakref.rst:291 +#: ../../library/weakref.rst:290 msgid "" "A finalizer will never invoke its callback during the later part of the :" "term:`interpreter shutdown` when module globals are liable to have been " "replaced by :const:`None`." msgstr "" -#: ../../library/weakref.rst:297 +#: ../../library/weakref.rst:296 msgid "" "If *self* is alive then mark it as dead and return the result of calling " "``func(*args, **kwargs)``. If *self* is dead then return :const:`None`." msgstr "" -#: ../../library/weakref.rst:303 +#: ../../library/weakref.rst:302 msgid "" "If *self* is alive then mark it as dead and return the tuple ``(obj, func, " "args, kwargs)``. If *self* is dead then return :const:`None`." msgstr "" -#: ../../library/weakref.rst:309 +#: ../../library/weakref.rst:308 msgid "" "If *self* is alive then return the tuple ``(obj, func, args, kwargs)``. If " "*self* is dead then return :const:`None`." msgstr "" -#: ../../library/weakref.rst:314 +#: ../../library/weakref.rst:313 msgid "Property which is true if the finalizer is alive, false otherwise." msgstr "" -#: ../../library/weakref.rst:318 +#: ../../library/weakref.rst:317 msgid "" "A writable boolean property which by default is true. When the program " "exits, it calls all remaining live finalizers for which :attr:`.atexit` is " "true. They are called in reverse order of creation." msgstr "" -#: ../../library/weakref.rst:325 +#: ../../library/weakref.rst:324 msgid "" "It is important to ensure that *func*, *args* and *kwargs* do not own any " "references to *obj*, either directly or indirectly, since otherwise *obj* " @@ -388,60 +387,60 @@ msgid "" "bound method of *obj*." msgstr "" -#: ../../library/weakref.rst:335 +#: ../../library/weakref.rst:334 msgid "The type object for weak references objects." msgstr "" -#: ../../library/weakref.rst:340 +#: ../../library/weakref.rst:339 msgid "The type object for proxies of objects which are not callable." msgstr "" -#: ../../library/weakref.rst:345 +#: ../../library/weakref.rst:344 msgid "The type object for proxies of callable objects." msgstr "" -#: ../../library/weakref.rst:350 +#: ../../library/weakref.rst:349 msgid "" "Sequence containing all the type objects for proxies. This can make it " "simpler to test if an object is a proxy without being dependent on naming " "both proxy types." msgstr "" -#: ../../library/weakref.rst:358 +#: ../../library/weakref.rst:357 msgid ":pep:`205` - Weak References" msgstr "" -#: ../../library/weakref.rst:358 +#: ../../library/weakref.rst:357 msgid "" "The proposal and rationale for this feature, including links to earlier " "implementations and information about similar features in other languages." msgstr "" -#: ../../library/weakref.rst:365 +#: ../../library/weakref.rst:364 msgid "Weak Reference Objects" msgstr "" -#: ../../library/weakref.rst:367 +#: ../../library/weakref.rst:366 msgid "" "Weak reference objects have no methods and no attributes besides :attr:`ref." "__callback__`. A weak reference object allows the referent to be obtained, " "if it still exists, by calling it:" msgstr "" -#: ../../library/weakref.rst:381 +#: ../../library/weakref.rst:380 msgid "" "If the referent no longer exists, calling the reference object returns :" "const:`None`:" msgstr "" -#: ../../library/weakref.rst:388 +#: ../../library/weakref.rst:387 msgid "" "Testing that a weak reference object is still live should be done using the " "expression ``ref() is not None``. Normally, application code that needs to " "use a reference object should follow this pattern::" msgstr "" -#: ../../library/weakref.rst:401 +#: ../../library/weakref.rst:400 msgid "" "Using a separate test for \"liveness\" creates race conditions in threaded " "applications; another thread can cause a weak reference to become " @@ -449,7 +448,7 @@ msgid "" "safe in threaded applications as well as single-threaded applications." msgstr "" -#: ../../library/weakref.rst:406 +#: ../../library/weakref.rst:405 msgid "" "Specialized versions of :class:`ref` objects can be created through " "subclassing. This is used in the implementation of the :class:" @@ -459,18 +458,18 @@ msgid "" "to retrieve the referent." msgstr "" -#: ../../library/weakref.rst:412 +#: ../../library/weakref.rst:411 msgid "" "This example shows how a subclass of :class:`ref` can be used to store " "additional information about an object and affect the value that's returned " "when the referent is accessed::" msgstr "" -#: ../../library/weakref.rst:439 +#: ../../library/weakref.rst:438 msgid "Example" msgstr "範例" -#: ../../library/weakref.rst:441 +#: ../../library/weakref.rst:440 msgid "" "This simple example shows how an application can use object IDs to retrieve " "objects that it has seen before. The IDs of the objects can then be used in " @@ -478,103 +477,103 @@ msgid "" "objects can still be retrieved by ID if they do." msgstr "" -#: ../../library/weakref.rst:466 +#: ../../library/weakref.rst:465 msgid "Finalizer Objects" msgstr "" -#: ../../library/weakref.rst:468 +#: ../../library/weakref.rst:467 msgid "" "The main benefit of using :class:`finalize` is that it makes it simple to " "register a callback without needing to preserve the returned finalizer " "object. For instance" msgstr "" -#: ../../library/weakref.rst:482 +#: ../../library/weakref.rst:481 msgid "" "The finalizer can be called directly as well. However the finalizer will " "invoke the callback at most once." msgstr "" -#: ../../library/weakref.rst:498 +#: ../../library/weakref.rst:497 msgid "" "You can unregister a finalizer using its :meth:`~finalize.detach` method. " "This kills the finalizer and returns the arguments passed to the constructor " "when it was created." msgstr "" -#: ../../library/weakref.rst:512 +#: ../../library/weakref.rst:511 msgid "" "Unless you set the :attr:`~finalize.atexit` attribute to :const:`False`, a " "finalizer will be called when the program exits if it is still alive. For " "instance" msgstr "" -#: ../../library/weakref.rst:527 -msgid "Comparing finalizers with :meth:`__del__` methods" +#: ../../library/weakref.rst:526 +msgid "Comparing finalizers with :meth:`~object.__del__` methods" msgstr "" -#: ../../library/weakref.rst:529 +#: ../../library/weakref.rst:528 msgid "" "Suppose we want to create a class whose instances represent temporary " "directories. The directories should be deleted with their contents when the " "first of the following events occurs:" msgstr "" -#: ../../library/weakref.rst:533 +#: ../../library/weakref.rst:532 msgid "the object is garbage collected," msgstr "" -#: ../../library/weakref.rst:534 -msgid "the object's :meth:`remove` method is called, or" +#: ../../library/weakref.rst:533 +msgid "the object's :meth:`!remove` method is called, or" msgstr "" -#: ../../library/weakref.rst:535 +#: ../../library/weakref.rst:534 msgid "the program exits." msgstr "" -#: ../../library/weakref.rst:537 +#: ../../library/weakref.rst:536 msgid "" -"We might try to implement the class using a :meth:`__del__` method as " -"follows::" +"We might try to implement the class using a :meth:`~object.__del__` method " +"as follows::" msgstr "" -#: ../../library/weakref.rst:556 +#: ../../library/weakref.rst:555 msgid "" -"Starting with Python 3.4, :meth:`__del__` methods no longer prevent " +"Starting with Python 3.4, :meth:`~object.__del__` methods no longer prevent " "reference cycles from being garbage collected, and module globals are no " "longer forced to :const:`None` during :term:`interpreter shutdown`. So this " "code should work without any issues on CPython." msgstr "" -#: ../../library/weakref.rst:561 +#: ../../library/weakref.rst:560 msgid "" -"However, handling of :meth:`__del__` methods is notoriously implementation " -"specific, since it depends on internal details of the interpreter's garbage " -"collector implementation." +"However, handling of :meth:`~object.__del__` methods is notoriously " +"implementation specific, since it depends on internal details of the " +"interpreter's garbage collector implementation." msgstr "" -#: ../../library/weakref.rst:565 +#: ../../library/weakref.rst:564 msgid "" "A more robust alternative can be to define a finalizer which only references " "the specific functions and objects that it needs, rather than having access " "to the full state of the object::" msgstr "" -#: ../../library/weakref.rst:581 +#: ../../library/weakref.rst:580 msgid "" "Defined like this, our finalizer only receives a reference to the details it " "needs to clean up the directory appropriately. If the object never gets " "garbage collected the finalizer will still be called at exit." msgstr "" -#: ../../library/weakref.rst:585 +#: ../../library/weakref.rst:584 msgid "" "The other advantage of weakref based finalizers is that they can be used to " "register finalizers for classes where the definition is controlled by a " "third party, such as running code when a module is unloaded::" msgstr "" -#: ../../library/weakref.rst:597 +#: ../../library/weakref.rst:596 msgid "" "If you create a finalizer object in a daemonic thread just as the program " "exits then there is the possibility that the finalizer does not get called " diff --git a/library/wsgiref.po b/library/wsgiref.po index 4a32e3dffa..ff281215b8 100644 --- a/library/wsgiref.po +++ b/library/wsgiref.po @@ -33,8 +33,9 @@ msgid "" "interface makes it easy to use an application that supports WSGI with a " "number of different web servers." msgstr "" -"網頁伺服器閘道介面 (WSGI) 是一個標準介面,用於連接網頁伺服器軟體與使用 Python 撰寫的網頁應用程式,擁" -"有一個標準介面使得支援 WSGI 的應用程式可以與多個不同的網頁伺服器運行。" +"網頁伺服器閘道介面 (WSGI) 是一個標準介面,用於連接網頁伺服器軟體與使用 " +"Python 撰寫的網頁應用程式,擁有一個標準介面使得支援 WSGI 的應用程式可以與多個" +"不同的網頁伺服器運行。" #: ../../library/wsgiref.rst:19 msgid "" @@ -43,8 +44,9 @@ msgid "" "every detail of WSGI just to install a WSGI application or to write a web " "application using an existing framework." msgstr "" -"只有網頁伺服器與程式框架的作者需要瞭解 WSGI 設計的每個細節與邊角案例,你並不需要為了安裝 WSGI 應用程" -"式或是使用現有框架撰寫網頁應用程式而必須理解每個細節。" +"只有網頁伺服器與程式框架的作者需要瞭解 WSGI 設計的每個細節與邊角案例,你並不" +"需要為了安裝 WSGI 應用程式或是使用現有框架撰寫網頁應用程式而必須理解每個細" +"節。" #: ../../library/wsgiref.rst:24 msgid "" @@ -56,17 +58,18 @@ msgid "" "that checks WSGI servers and applications for conformance to the WSGI " "specification (:pep:`3333`)." msgstr "" -":mod:`wsgiref` 是 WSGI 規格的參考實作,可用於新增 WSGI 來支援網頁伺服器或框架,它提供操作 WSGI " -"環境變數以及回應標頭的工具,用於實作 WSGI 伺服器的基本類別,提供用於示範 HTTP 伺服器的 WSGI 應用程" -"式、靜態型別檢查、以及驗證 WSGI 伺服器與應用程式是否符合 WSGI 規格的驗證工具 (:pep:`3333`)。" +":mod:`wsgiref` 是 WSGI 規格的參考實作,可用於新增 WSGI 來支援網頁伺服器或框" +"架,它提供操作 WSGI 環境變數以及回應標頭的工具,用於實作 WSGI 伺服器的基本類" +"別,提供用於示範 HTTP 伺服器的 WSGI 應用程式、靜態型別檢查、以及驗證 WSGI 伺" +"服器與應用程式是否符合 WSGI 規格的驗證工具 (:pep:`3333`)。" #: ../../library/wsgiref.rst:32 msgid "" "See `wsgi.readthedocs.io `_ for more " "information about WSGI, and links to tutorials and other resources." msgstr "" -"參閱 `wsgi.readthedocs.io ` 更多 WSGI 相關資訊,以及教學連結" -"與其他資源。" +"參閱 `wsgi.readthedocs.io `_ 更多 WSGI 相關資" +"訊,以及教學連結與其他資源。" #: ../../library/wsgiref.rst:39 msgid ":mod:`wsgiref.util` -- WSGI environment utilities" @@ -81,9 +84,10 @@ msgid "" "please see :pep:`3333` for a detailed specification and :data:`~wsgiref." "types.WSGIEnvironment` for a type alias that can be used in type annotations." msgstr "" -"這個模組提供許多用於處理 WSGI 環境運作的功能。WSGU 環境是一個包含 HTTP 請求變數的字典,如 :pep:`3333` 所述。" -"所有接受 *environ* 的參數的函式都需要提供符合 WSGI 標準的字典;請參閱 :pep:`3333` 獲取詳細規格,以及 :data:" -"`~wsgiref.types.WSGIEnvironment` 獲取可用於使用型別註釋的型別別名。 +"這個模組提供許多用於處理 WSGI 環境運作的功能。WSGU 環境是一個包含 HTTP 請求變" +"數的字典,如 :pep:`3333` 所述。所有接受 *environ* 的參數的函式都需要提供符合 " +"WSGI 標準的字典;請參閱 :pep:`3333` 獲取詳細規格,以及 :data:`~wsgiref.types." +"WSGIEnvironment` 獲取可用於使用型別註釋的型別別名。" #: ../../library/wsgiref.rst:56 msgid "" @@ -91,8 +95,8 @@ msgid "" "\"https\", by checking for a ``HTTPS`` environment variable in the *environ* " "dictionary. The return value is a string." msgstr "" -"透過檢查 *environ* 字典中的 ``HTTPS`` 環境變數,回傳 ``wsgi.url_scheme`` 應該是 \"http\" 或 \"https\"" -" 的猜測。回傳值為一個字串。" +"透過檢查 *environ* 字典中的 ``HTTPS`` 環境變數,回傳 ``wsgi.url_scheme`` 應該" +"是 \"http\" 或 \"https\" 的猜測。回傳值為一個字串。" #: ../../library/wsgiref.rst:60 msgid "" @@ -102,9 +106,10 @@ msgid "" "a request is received via SSL. So, this function returns \"https\" if such " "a value is found, and \"http\" otherwise." msgstr "" -"當建立一個包裝 CGI 或類似 FastCGI 的 CGI-like 協議閘道時,此函式非常有用。例如 FastCGI,通常提供這類協議的" -"伺服器在通過 SSL 接收到請求時會包含 \"1\",\"yes\",或 \"on\" 的``HTTPS`` 變數,因此,如果找到這樣的值,此函" -"式回傳 \"https\",否則回傳 \"http\"。 +"當建立一個包裝 CGI 或類似 FastCGI 的 CGI-like 協議閘道時,此函式非常有用。例" +"如 FastCGI,通常提供這類協議的伺服器在通過 SSL 接收到請求時會包含 " +"\"1\",\"yes\",或 \"on\" 的 ``HTTPS`` 變數,因此,如果找到這樣的值,此函式回" +"傳 \"https\",否則回傳 \"http\"。" #: ../../library/wsgiref.rst:69 msgid "" @@ -113,8 +118,9 @@ msgid "" "If *include_query* is false, the query string is not included in the " "resulting URI." msgstr "" -"根據 :pep:`3333` 中 \"URL Reconstruction\" 章節所找到的演算法,回傳完整的請求 URI,可選擇性的包含查詢字串," -"如果 *include_query* 設為 false,查詢字串不會被包含在結果的 URI 中。" +"根據 :pep:`3333` 中 \"URL Reconstruction\" 章節所找到的演算法,回傳完整的請" +"求 URI,可選擇性的包含查詢字串,如果 *include_query* 設為 false,查詢字串不會" +"被包含在結果的 URI 中。" #: ../../library/wsgiref.rst:76 msgid "" @@ -122,8 +128,8 @@ msgid "" "``QUERY_STRING`` variables are ignored. The result is the base URI of the " "application object addressed by the request." msgstr "" -"類似於 :func:`request_uri`,但忽略 ``PATH_INFO`` 和 ``QUERY_STRING`` 變數。結果是請求地址的應用程式物件的" -"的基本 URI。" +"類似於 :func:`request_uri`,但忽略 ``PATH_INFO`` 和 ``QUERY_STRING`` 變數。結" +"果是請求地址的應用程式物件的的基本 URI。" #: ../../library/wsgiref.rst:83 msgid "" @@ -131,15 +137,15 @@ msgid "" "name. The *environ* dictionary is *modified* in-place; use a copy if you " "need to keep the original ``PATH_INFO`` or ``SCRIPT_NAME`` intact." msgstr "" -"將單一名稱從 ``PATH_INFO`` 移到 ``SCRIPT_NAME`` 並回傳該名稱。*environ* 字典會在適當時機被 *modified*;如" -"果你需要保留原始完好無損的 ``PATH_INFO`` 或 ``SCRIPT_NAME`` 請使用副本。" +"將單一名稱從 ``PATH_INFO`` 移到 ``SCRIPT_NAME`` 並回傳該名稱。*environ* 字典" +"會在適當時機被 *modified*;如果你需要保留原始完好無損的 ``PATH_INFO`` 或 " +"``SCRIPT_NAME`` 請使用副本。" #: ../../library/wsgiref.rst:87 msgid "" "If there are no remaining path segments in ``PATH_INFO``, ``None`` is " "returned." -msgstr "" -"如果在 ``PATH_INFO`` 中沒有剩餘的路徑片段,則回傳 ``None``。" +msgstr "如果在 ``PATH_INFO`` 中沒有剩餘的路徑片段,則回傳 ``None``。" #: ../../library/wsgiref.rst:89 msgid "" @@ -154,11 +160,13 @@ msgid "" "bar``. That is, ``SCRIPT_NAME`` will change from ``/foo`` to ``/foo/bar``, " "and ``PATH_INFO`` will change from ``/bar/baz`` to ``/baz``." msgstr "" -"通常,此程式用於處理請求 URI 的每一部分路徑,例如將路徑視為一系列的字典鍵此程式會修改傳入的環境,使其適用於調用位於" -"目標 URI 的 WSGI 應用程式。例如,如果在 ``/foo`` 上有一個 WSGI 應用程式且請求 URI 路徑為 ``/foo/bar/baz``," -"並且位於 ``/foo`` 的 WSGI 應用程式呼叫 :func:`shift_path_info`,它將接收字串 \"bar\",而環境將被更新為適用" -"於傳遞給位於 ``/foo/bar`` 的 WSGI 應用程式。換句話說,``SCRIPT_NAME`` 將從 ``/foo`` 變更為 ``/foo/bar``," -"而 ``PATH_INFO`` 將從 ``/bar/baz`` 變更為 ``/baz``。" +"通常,此程式用於處理請求 URI 的每一部分路徑,例如將路徑視為一系列的字典鍵此程" +"式會修改傳入的環境,使其適用於調用位於目標 URI 的 WSGI 應用程式。例如,如果" +"在 ``/foo`` 上有一個 WSGI 應用程式且請求 URI 路徑為 ``/foo/bar/baz``,並且位" +"於 ``/foo`` 的 WSGI 應用程式呼叫 :func:`shift_path_info`,它將接收字串 " +"\"bar\",而環境將被更新為適用於傳遞給位於 ``/foo/bar`` 的 WSGI 應用程式。換句" +"話說,``SCRIPT_NAME`` 將從 ``/foo`` 變更為 ``/foo/bar``,而 ``PATH_INFO`` 將" +"從 ``/bar/baz`` 變更為 ``/baz``。" #: ../../library/wsgiref.rst:100 msgid "" @@ -169,9 +177,10 @@ msgid "" "difference between URIs ending in ``/x`` from ones ending in ``/x/`` when " "using this routine to do object traversal." msgstr "" -"當 ``PATH_INFO`` 只是一個 \"/\" 時, 此程式會回傳一個空字串,並在 ``SCRIPT_NAME`` 後添加尾部斜號,即使空路徑片" -"段通常是被忽略的,而且 ``SCRIPT_NAME`` 通常不會以斜號結尾。這是刻意行為,以確保應用程式在使用這個程式進行物件遍歷時可" -"以區分結尾為 ``/x`` 和結尾為 ``/x/`` 的 URIs。" +"當 ``PATH_INFO`` 只是一個 \"/\" 時, 此程式會回傳一個空字串,並在 " +"``SCRIPT_NAME`` 後添加尾部斜號,即使空路徑片段通常是被忽略的,而且 " +"``SCRIPT_NAME`` 通常不會以斜號結尾。這是刻意行為,以確保應用程式在使用這個程" +"式進行物件遍歷時可以區分結尾為 ``/x`` 和結尾為 ``/x/`` 的 URIs。" #: ../../library/wsgiref.rst:110 msgid "Update *environ* with trivial defaults for testing purposes." @@ -185,9 +194,10 @@ msgid "" "*`` variables. It only supplies default values, and does not replace any " "existing settings for these variables." msgstr "" -"這個程式新增 WSGI 所需的各種參數,包括 ``HTTP_HOST``、``SERVER_NAME``、``SERVER_PORT``、``REQUEST_METHOD``" -"、``SCRIPT_NAME``、``PATH_INFO``,以及所有 :pep:`3333` 定義的 ``wsgi.*`` 變數,它只提供預設值,並且不會取代" -"現有的這些變數設定。" +"這個程式新增 WSGI 所需的各種參數,包括 ``HTTP_HOST``、``SERVER_NAME``、" +"``SERVER_PORT``、``REQUEST_METHOD``、``SCRIPT_NAME``、``PATH_INFO``,以及所" +"有 :pep:`3333` 定義的 ``wsgi.*`` 變數,它只提供預設值,並且不會取代現有的這些" +"變數設定。" #: ../../library/wsgiref.rst:118 msgid "" @@ -195,9 +205,8 @@ msgid "" "and applications to set up dummy environments. It should NOT be used by " "actual WSGI servers or applications, since the data is fake!" msgstr "" -"這個程式目的為了讓 WSGI 伺服器和應用程式的單元測試更容易建置虛擬環境。實際的 WSGI 伺服器或應用程式不應該使用它,因為" -"所產生的數據是假的!" - +"這個程式目的為了讓 WSGI 伺服器和應用程式的單元測試更容易建置虛擬環境。實際的 " +"WSGI 伺服器或應用程式不應該使用它,因為所產生的數據是假的!" #: ../../library/wsgiref.rst:122 ../../library/wsgiref.rst:170 #: ../../library/wsgiref.rst:292 ../../library/wsgiref.rst:425 diff --git a/library/xml.etree.elementtree.po b/library/xml.etree.elementtree.po index fbdf345c98..99998e7c40 100644 --- a/library/xml.etree.elementtree.po +++ b/library/xml.etree.elementtree.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-10-11 17:13+0000\n" "PO-Revision-Date: 2018-05-23 16:16+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -37,7 +37,7 @@ msgid "This module will use a fast implementation whenever available." msgstr "" #: ../../library/xml.etree.elementtree.rst:19 -msgid "The :mod:`xml.etree.cElementTree` module is deprecated." +msgid "The :mod:`!xml.etree.cElementTree` module is deprecated." msgstr "" #: ../../library/xml.etree.elementtree.rst:25 @@ -668,7 +668,7 @@ msgid "" msgstr "" #: ../../library/xml.etree.elementtree.rst:639 -#: ../../library/xml.etree.elementtree.rst:1473 +#: ../../library/xml.etree.elementtree.rst:1478 msgid "If you need a fully populated element, look for \"end\" events instead." msgstr "" @@ -677,7 +677,7 @@ msgid "The *parser* argument." msgstr "*parser* 引數。" #: ../../library/xml.etree.elementtree.rst:644 -#: ../../library/xml.etree.elementtree.rst:1477 +#: ../../library/xml.etree.elementtree.rst:1482 msgid "The ``comment`` and ``pi`` events were added." msgstr "新增 *context* 與 *check_hostname* 事件。" @@ -743,7 +743,7 @@ msgstr "" #: ../../library/xml.etree.elementtree.rst:705 #: ../../library/xml.etree.elementtree.rst:732 -#: ../../library/xml.etree.elementtree.rst:1184 +#: ../../library/xml.etree.elementtree.rst:1189 msgid "The *short_empty_elements* parameter." msgstr "*short_empty_elements* 參數。" @@ -851,7 +851,7 @@ msgstr "" msgid "The result might look something like:" msgstr "" -#: ../../library/xml.etree.elementtree.rst:831 +#: ../../library/xml.etree.elementtree.rst:833 msgid "" "Default loader. This default loader reads an included resource from disk. " "*href* is a URL. *parse* is for parse mode either \"xml\" or \"text\". " @@ -862,7 +862,7 @@ msgid "" "or raise an exception." msgstr "" -#: ../../library/xml.etree.elementtree.rst:843 +#: ../../library/xml.etree.elementtree.rst:845 msgid "" "This function expands XInclude directives. *elem* is the root element. " "*loader* is an optional resource loader. If omitted, it defaults to :func:" @@ -873,28 +873,28 @@ msgid "" "malicious content explosion. Pass a negative value to disable the limitation." msgstr "" -#: ../../library/xml.etree.elementtree.rst:851 +#: ../../library/xml.etree.elementtree.rst:853 msgid "" "Returns the expanded resource. If the parse mode is ``\"xml\"``, this is an " "ElementTree instance. If the parse mode is \"text\", this is a Unicode " "string. If the loader fails, it can return None or raise an exception." msgstr "" -#: ../../library/xml.etree.elementtree.rst:856 +#: ../../library/xml.etree.elementtree.rst:858 msgid "The *base_url* and *max_depth* parameters." msgstr "" -#: ../../library/xml.etree.elementtree.rst:863 +#: ../../library/xml.etree.elementtree.rst:865 msgid "Element Objects" msgstr "" -#: ../../library/xml.etree.elementtree.rst:867 +#: ../../library/xml.etree.elementtree.rst:872 msgid "" "Element class. This class defines the Element interface, and provides a " "reference implementation of this interface." msgstr "" -#: ../../library/xml.etree.elementtree.rst:870 +#: ../../library/xml.etree.elementtree.rst:875 msgid "" "The element name, attribute names, and attribute values can be either " "bytestrings or Unicode strings. *tag* is the element name. *attrib* is an " @@ -902,13 +902,13 @@ msgid "" "additional attributes, given as keyword arguments." msgstr "" -#: ../../library/xml.etree.elementtree.rst:878 +#: ../../library/xml.etree.elementtree.rst:883 msgid "" "A string identifying what kind of data this element represents (the element " "type, in other words)." msgstr "" -#: ../../library/xml.etree.elementtree.rst:885 +#: ../../library/xml.etree.elementtree.rst:890 msgid "" "These attributes can be used to hold additional data associated with the " "element. Their values are usually strings but may be any application-" @@ -919,7 +919,7 @@ msgid "" "the XML data" msgstr "" -#: ../../library/xml.etree.elementtree.rst:897 +#: ../../library/xml.etree.elementtree.rst:902 msgid "" "the *a* element has ``None`` for both *text* and *tail* attributes, the *b* " "element has *text* ``\"1\"`` and *tail* ``\"4\"``, the *c* element has " @@ -927,17 +927,17 @@ msgid "" "``None`` and *tail* ``\"3\"``." msgstr "" -#: ../../library/xml.etree.elementtree.rst:902 +#: ../../library/xml.etree.elementtree.rst:907 msgid "" "To collect the inner text of an element, see :meth:`itertext`, for example " "``\"\".join(element.itertext())``." msgstr "" -#: ../../library/xml.etree.elementtree.rst:905 +#: ../../library/xml.etree.elementtree.rst:910 msgid "Applications may store arbitrary objects in these attributes." msgstr "" -#: ../../library/xml.etree.elementtree.rst:910 +#: ../../library/xml.etree.elementtree.rst:915 msgid "" "A dictionary containing the element's attributes. Note that while the " "*attrib* value is always a real mutable Python dictionary, an ElementTree " @@ -946,59 +946,59 @@ msgid "" "implementations, use the dictionary methods below whenever possible." msgstr "" -#: ../../library/xml.etree.elementtree.rst:916 +#: ../../library/xml.etree.elementtree.rst:921 msgid "The following dictionary-like methods work on the element attributes." msgstr "" -#: ../../library/xml.etree.elementtree.rst:921 +#: ../../library/xml.etree.elementtree.rst:926 msgid "" "Resets an element. This function removes all subelements, clears all " "attributes, and sets the text and tail attributes to ``None``." msgstr "" -#: ../../library/xml.etree.elementtree.rst:927 +#: ../../library/xml.etree.elementtree.rst:932 msgid "Gets the element attribute named *key*." msgstr "" -#: ../../library/xml.etree.elementtree.rst:929 +#: ../../library/xml.etree.elementtree.rst:934 msgid "" "Returns the attribute value, or *default* if the attribute was not found." msgstr "" -#: ../../library/xml.etree.elementtree.rst:934 +#: ../../library/xml.etree.elementtree.rst:939 msgid "" "Returns the element attributes as a sequence of (name, value) pairs. The " "attributes are returned in an arbitrary order." msgstr "" -#: ../../library/xml.etree.elementtree.rst:940 +#: ../../library/xml.etree.elementtree.rst:945 msgid "" "Returns the elements attribute names as a list. The names are returned in " "an arbitrary order." msgstr "" -#: ../../library/xml.etree.elementtree.rst:946 +#: ../../library/xml.etree.elementtree.rst:951 msgid "Set the attribute *key* on the element to *value*." msgstr "" -#: ../../library/xml.etree.elementtree.rst:948 +#: ../../library/xml.etree.elementtree.rst:953 msgid "The following methods work on the element's children (subelements)." msgstr "" -#: ../../library/xml.etree.elementtree.rst:953 +#: ../../library/xml.etree.elementtree.rst:958 msgid "" "Adds the element *subelement* to the end of this element's internal list of " "subelements. Raises :exc:`TypeError` if *subelement* is not an :class:" "`Element`." msgstr "" -#: ../../library/xml.etree.elementtree.rst:960 +#: ../../library/xml.etree.elementtree.rst:965 msgid "" "Appends *subelements* from a sequence object with zero or more elements. " "Raises :exc:`TypeError` if a subelement is not an :class:`Element`." msgstr "" -#: ../../library/xml.etree.elementtree.rst:968 +#: ../../library/xml.etree.elementtree.rst:973 msgid "" "Finds the first subelement matching *match*. *match* may be a tag name or " "a :ref:`path `. Returns an element instance or " @@ -1007,7 +1007,7 @@ msgid "" "expression into the given namespace." msgstr "" -#: ../../library/xml.etree.elementtree.rst:977 +#: ../../library/xml.etree.elementtree.rst:982 msgid "" "Finds all matching subelements, by tag name or :ref:`path `. Returns a list containing all matching elements in document " @@ -1016,7 +1016,7 @@ msgid "" "expression into the given namespace." msgstr "" -#: ../../library/xml.etree.elementtree.rst:986 +#: ../../library/xml.etree.elementtree.rst:991 msgid "" "Finds text for the first subelement matching *match*. *match* may be a tag " "name or a :ref:`path `. Returns the text content of the " @@ -1027,13 +1027,13 @@ msgid "" "into the given namespace." msgstr "" -#: ../../library/xml.etree.elementtree.rst:997 +#: ../../library/xml.etree.elementtree.rst:1002 msgid "" "Inserts *subelement* at the given position in this element. Raises :exc:" "`TypeError` if *subelement* is not an :class:`Element`." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1003 +#: ../../library/xml.etree.elementtree.rst:1008 msgid "" "Creates a tree :term:`iterator` with the current element as the root. The " "iterator iterates over this element and all elements below it, in document " @@ -1042,7 +1042,7 @@ msgid "" "structure is modified during iteration, the result is undefined." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1014 +#: ../../library/xml.etree.elementtree.rst:1019 msgid "" "Finds all matching subelements, by tag name or :ref:`path `. Returns an iterable yielding all matching elements in document " @@ -1050,44 +1050,44 @@ msgid "" "name." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1025 +#: ../../library/xml.etree.elementtree.rst:1030 msgid "" "Creates a text iterator. The iterator loops over this element and all " "subelements, in document order, and returns all inner text." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1033 +#: ../../library/xml.etree.elementtree.rst:1038 msgid "" "Creates a new element object of the same type as this element. Do not call " "this method, use the :func:`SubElement` factory function instead." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1039 +#: ../../library/xml.etree.elementtree.rst:1044 msgid "" "Removes *subelement* from the element. Unlike the find\\* methods this " "method compares elements based on the instance identity, not on tag value or " "contents." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1043 +#: ../../library/xml.etree.elementtree.rst:1048 msgid "" ":class:`Element` objects also support the following sequence type methods " "for working with subelements: :meth:`~object.__delitem__`, :meth:`~object." "__getitem__`, :meth:`~object.__setitem__`, :meth:`~object.__len__`." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1048 +#: ../../library/xml.etree.elementtree.rst:1053 msgid "" "Caution: Elements with no subelements will test as ``False``. Testing the " "truth value of an Element is deprecated and will raise an exception in " "Python 3.14. Use specific ``len(elem)`` or ``elem is None`` test instead.::" msgstr "" -#: ../../library/xml.etree.elementtree.rst:1060 +#: ../../library/xml.etree.elementtree.rst:1065 msgid "Testing the truth value of an Element emits :exc:`DeprecationWarning`." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1063 +#: ../../library/xml.etree.elementtree.rst:1068 msgid "" "Prior to Python 3.8, the serialisation order of the XML attributes of " "elements was artificially made predictable by sorting the attributes by " @@ -1096,7 +1096,7 @@ msgid "" "attributes were originally parsed or created by user code." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1069 +#: ../../library/xml.etree.elementtree.rst:1074 msgid "" "In general, user code should try not to depend on a specific ordering of " "attributes, given that the `XML Information Set `_ writer. Arguments are the " "same as for the :func:`canonicalize` function. This class does not build a " @@ -1332,11 +1332,11 @@ msgid "" "using the *write* function." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1348 +#: ../../library/xml.etree.elementtree.rst:1353 msgid "XMLParser Objects" msgstr "XMLParser 物件" -#: ../../library/xml.etree.elementtree.rst:1353 +#: ../../library/xml.etree.elementtree.rst:1358 msgid "" "This class is the low-level building block of the module. It uses :mod:`xml." "parsers.expat` for efficient, event-based parsing of XML. It can be fed XML " @@ -1347,24 +1347,24 @@ msgid "" "XML file." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1361 +#: ../../library/xml.etree.elementtree.rst:1366 msgid "" "Parameters are now :ref:`keyword-only `. The *html* " "argument no longer supported." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1368 +#: ../../library/xml.etree.elementtree.rst:1373 msgid "" "Finishes feeding data to the parser. Returns the result of calling the " "``close()`` method of the *target* passed during construction; by default, " "this is the toplevel document element." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1375 +#: ../../library/xml.etree.elementtree.rst:1380 msgid "Feeds data to the parser. *data* is encoded data." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1377 +#: ../../library/xml.etree.elementtree.rst:1382 msgid "" ":meth:`XMLParser.feed` calls *target*\\'s ``start(tag, attrs_dict)`` method " "for each opening tag, its ``end(tag)`` method for each closing tag, and data " @@ -1375,11 +1375,11 @@ msgid "" "of an XML file::" msgstr "" -#: ../../library/xml.etree.elementtree.rst:1421 +#: ../../library/xml.etree.elementtree.rst:1426 msgid "XMLPullParser Objects" msgstr "XMLPullParser 物件" -#: ../../library/xml.etree.elementtree.rst:1425 +#: ../../library/xml.etree.elementtree.rst:1430 msgid "" "A pull parser suitable for non-blocking applications. Its input-side API is " "similar to that of :class:`XMLParser`, but instead of pushing calls to a " @@ -1391,11 +1391,11 @@ msgid "" "If *events* is omitted, only ``\"end\"`` events are reported." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1436 +#: ../../library/xml.etree.elementtree.rst:1441 msgid "Feed the given bytes data to the parser." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1440 +#: ../../library/xml.etree.elementtree.rst:1445 msgid "" "Signal the parser that the data stream is terminated. Unlike :meth:" "`XMLParser.close`, this method always returns :const:`None`. Any events not " @@ -1403,7 +1403,7 @@ msgid "" "`read_events`." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1447 +#: ../../library/xml.etree.elementtree.rst:1452 msgid "" "Return an iterator over the events which have been encountered in the data " "fed to the parser. The iterator yields ``(event, elem)`` pairs, where " @@ -1412,25 +1412,25 @@ msgid "" "follows." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1453 +#: ../../library/xml.etree.elementtree.rst:1458 msgid "``start``, ``end``: the current Element." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1454 +#: ../../library/xml.etree.elementtree.rst:1459 msgid "``comment``, ``pi``: the current comment / processing instruction" msgstr "" -#: ../../library/xml.etree.elementtree.rst:1455 +#: ../../library/xml.etree.elementtree.rst:1460 msgid "" "``start-ns``: a tuple ``(prefix, uri)`` naming the declared namespace " "mapping." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1457 +#: ../../library/xml.etree.elementtree.rst:1462 msgid "``end-ns``: :const:`None` (this may change in a future version)" msgstr "" -#: ../../library/xml.etree.elementtree.rst:1459 +#: ../../library/xml.etree.elementtree.rst:1464 msgid "" "Events provided in a previous call to :meth:`read_events` will not be " "yielded again. Events are consumed from the internal queue only when they " @@ -1439,7 +1439,7 @@ msgid "" "results." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1467 +#: ../../library/xml.etree.elementtree.rst:1472 msgid "" ":class:`XMLPullParser` only guarantees that it has seen the \">\" character " "of a starting tag when it emits a \"start\" event, so the attributes are " @@ -1448,11 +1448,11 @@ msgid "" "be present." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1482 +#: ../../library/xml.etree.elementtree.rst:1487 msgid "Exceptions" msgstr "例外" -#: ../../library/xml.etree.elementtree.rst:1486 +#: ../../library/xml.etree.elementtree.rst:1491 msgid "" "XML parse error, raised by the various parsing methods in this module when " "parsing fails. The string representation of an instance of this exception " @@ -1460,22 +1460,22 @@ msgid "" "following attributes available:" msgstr "" -#: ../../library/xml.etree.elementtree.rst:1493 +#: ../../library/xml.etree.elementtree.rst:1498 msgid "" "A numeric error code from the expat parser. See the documentation of :mod:" "`xml.parsers.expat` for the list of error codes and their meanings." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1498 +#: ../../library/xml.etree.elementtree.rst:1503 msgid "" "A tuple of *line*, *column* numbers, specifying where the error occurred." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1501 +#: ../../library/xml.etree.elementtree.rst:1506 msgid "Footnotes" msgstr "註解" -#: ../../library/xml.etree.elementtree.rst:1502 +#: ../../library/xml.etree.elementtree.rst:1507 msgid "" "The encoding string included in XML output should conform to the appropriate " "standards. For example, \"UTF-8\" is valid, but \"UTF8\" is not. See " diff --git a/library/zipimport.po b/library/zipimport.po index 69cf62e1ff..cc7909b20e 100644 --- a/library/zipimport.po +++ b/library/zipimport.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-10-11 17:13+0000\n" "PO-Revision-Date: 2018-05-23 16:17+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -159,7 +159,7 @@ msgid "" msgstr "" #: ../../library/zipimport.rst:115 -msgid ":exc:`IOError` used to be raised instead of :exc:`OSError`." +msgid ":exc:`IOError` used to be raised, it is now an alias of :exc:`OSError`." msgstr "" #: ../../library/zipimport.rst:121 diff --git a/reference/compound_stmts.po b/reference/compound_stmts.po index ceedd48bd8..2978dd7513 100644 --- a/reference/compound_stmts.po +++ b/reference/compound_stmts.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-22 00:04+0000\n" +"POT-Creation-Date: 2023-10-12 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-" @@ -449,14 +449,14 @@ msgid "" msgstr "" #: ../../reference/compound_stmts.rst:525 -#: ../../reference/compound_stmts.rst:1534 -#: ../../reference/compound_stmts.rst:1575 +#: ../../reference/compound_stmts.rst:1536 +#: ../../reference/compound_stmts.rst:1577 msgid "The following code::" msgstr "" #: ../../reference/compound_stmts.rst:530 #: ../../reference/compound_stmts.rst:555 -#: ../../reference/compound_stmts.rst:1580 +#: ../../reference/compound_stmts.rst:1582 msgid "is semantically equivalent to::" msgstr "" @@ -529,12 +529,12 @@ msgid "" msgstr "" #: ../../reference/compound_stmts.rst:624 -#: ../../reference/compound_stmts.rst:1179 +#: ../../reference/compound_stmts.rst:1181 msgid ":pep:`634` -- Structural Pattern Matching: Specification" msgstr "" #: ../../reference/compound_stmts.rst:625 -#: ../../reference/compound_stmts.rst:1180 +#: ../../reference/compound_stmts.rst:1182 msgid ":pep:`636` -- Structural Pattern Matching: Tutorial" msgstr "" @@ -1290,7 +1290,7 @@ msgid ":class:`int`" msgstr ":class:`int`" #: ../../reference/compound_stmts.rst:1159 -#: ../../reference/compound_stmts.rst:1850 +#: ../../reference/compound_stmts.rst:1852 msgid ":class:`list`" msgstr ":class:`list`" @@ -1303,7 +1303,7 @@ msgid ":class:`str`" msgstr ":class:`str`" #: ../../reference/compound_stmts.rst:1162 -#: ../../reference/compound_stmts.rst:1853 +#: ../../reference/compound_stmts.rst:1855 msgid ":class:`tuple`" msgstr ":class:`tuple`" @@ -1327,33 +1327,33 @@ msgstr "``isinstance(, CLS)``" msgid "convert ``P1`` to a keyword pattern using ``CLS.__match_args__``" msgstr "" -#: ../../reference/compound_stmts.rst:1173 +#: ../../reference/compound_stmts.rst:1172 msgid "For each keyword argument ``attr=P2``:" msgstr "" -#: ../../reference/compound_stmts.rst:1173 +#: ../../reference/compound_stmts.rst:1174 msgid "``hasattr(, \"attr\")``" msgstr "``hasattr(, \"attr\")``" -#: ../../reference/compound_stmts.rst:1174 +#: ../../reference/compound_stmts.rst:1175 msgid "``P2`` matches ``.attr``" msgstr "" -#: ../../reference/compound_stmts.rst:1175 +#: ../../reference/compound_stmts.rst:1177 msgid "... and so on for the corresponding keyword argument/pattern pair." msgstr "" -#: ../../reference/compound_stmts.rst:1190 +#: ../../reference/compound_stmts.rst:1192 msgid "Function definitions" msgstr "函式定義" -#: ../../reference/compound_stmts.rst:1205 +#: ../../reference/compound_stmts.rst:1207 msgid "" "A function definition defines a user-defined function object (see section :" "ref:`types`):" msgstr "" -#: ../../reference/compound_stmts.rst:1224 +#: ../../reference/compound_stmts.rst:1226 msgid "" "A function definition is an executable statement. Its execution binds the " "function name in the current local namespace to a function object (a wrapper " @@ -1362,13 +1362,13 @@ msgid "" "used when the function is called." msgstr "" -#: ../../reference/compound_stmts.rst:1230 +#: ../../reference/compound_stmts.rst:1232 msgid "" "The function definition does not execute the function body; this gets " "executed only when the function is called. [#]_" msgstr "" -#: ../../reference/compound_stmts.rst:1236 +#: ../../reference/compound_stmts.rst:1238 msgid "" "A function definition may be wrapped by one or more :term:`decorator` " "expressions. Decorator expressions are evaluated when the function is " @@ -1379,28 +1379,28 @@ msgid "" "example, the following code ::" msgstr "" -#: ../../reference/compound_stmts.rst:1247 -#: ../../reference/compound_stmts.rst:1433 +#: ../../reference/compound_stmts.rst:1249 +#: ../../reference/compound_stmts.rst:1435 msgid "is roughly equivalent to ::" msgstr "" "大致等價於:\n" "\n" "::" -#: ../../reference/compound_stmts.rst:1252 +#: ../../reference/compound_stmts.rst:1254 msgid "" "except that the original function is not temporarily bound to the name " "``func``." msgstr "" -#: ../../reference/compound_stmts.rst:1254 +#: ../../reference/compound_stmts.rst:1256 msgid "" "Functions may be decorated with any valid :token:`~python-grammar:" "assignment_expression`. Previously, the grammar was much more restrictive; " "see :pep:`614` for details." msgstr "" -#: ../../reference/compound_stmts.rst:1259 +#: ../../reference/compound_stmts.rst:1261 msgid "" "A list of :ref:`type parameters ` may be given in square " "brackets between the function's name and the opening parenthesis for its " @@ -1410,12 +1410,12 @@ msgid "" "more." msgstr "" -#: ../../reference/compound_stmts.rst:1265 -#: ../../reference/compound_stmts.rst:1452 +#: ../../reference/compound_stmts.rst:1267 +#: ../../reference/compound_stmts.rst:1454 msgid "Type parameter lists are new in Python 3.12." msgstr "" -#: ../../reference/compound_stmts.rst:1273 +#: ../../reference/compound_stmts.rst:1275 msgid "" "When one or more :term:`parameters ` have the form *parameter* " "``=`` *expression*, the function is said to have \"default parameter values." @@ -1426,7 +1426,7 @@ msgid "" "syntactic restriction that is not expressed by the grammar." msgstr "" -#: ../../reference/compound_stmts.rst:1281 +#: ../../reference/compound_stmts.rst:1283 msgid "" "**Default parameter values are evaluated from left to right when the " "function definition is executed.** This means that the expression is " @@ -1439,7 +1439,7 @@ msgid "" "the default, and explicitly test for it in the body of the function, e.g.::" msgstr "" -#: ../../reference/compound_stmts.rst:1302 +#: ../../reference/compound_stmts.rst:1304 msgid "" "Function call semantics are described in more detail in section :ref:" "`calls`. A function call always assigns values to all parameters mentioned " @@ -1455,13 +1455,13 @@ msgid "" "positional arguments." msgstr "" -#: ../../reference/compound_stmts.rst:1314 +#: ../../reference/compound_stmts.rst:1316 msgid "" "The ``/`` function parameter syntax may be used to indicate positional-only " "parameters. See :pep:`570` for details." msgstr "" -#: ../../reference/compound_stmts.rst:1323 +#: ../../reference/compound_stmts.rst:1325 msgid "" "Parameters may have an :term:`annotation ` of the form " "\"``: expression``\" following the parameter name. Any parameter may have " @@ -1478,7 +1478,7 @@ msgid "" "different order than they appear in the source code." msgstr "" -#: ../../reference/compound_stmts.rst:1338 +#: ../../reference/compound_stmts.rst:1340 msgid "" "It is also possible to create anonymous functions (functions not bound to a " "name), for immediate use in expressions. This uses lambda expressions, " @@ -1490,7 +1490,7 @@ msgid "" "execution of multiple statements and annotations." msgstr "" -#: ../../reference/compound_stmts.rst:1346 +#: ../../reference/compound_stmts.rst:1348 msgid "" "**Programmer's note:** Functions are first-class objects. A \"``def``\" " "statement executed inside a function definition defines a local function " @@ -1499,51 +1499,51 @@ msgid "" "See section :ref:`naming` for details." msgstr "" -#: ../../reference/compound_stmts.rst:1355 +#: ../../reference/compound_stmts.rst:1357 msgid ":pep:`3107` - Function Annotations" msgstr "" -#: ../../reference/compound_stmts.rst:1355 +#: ../../reference/compound_stmts.rst:1357 msgid "The original specification for function annotations." msgstr "" -#: ../../reference/compound_stmts.rst:1358 +#: ../../reference/compound_stmts.rst:1360 msgid ":pep:`484` - Type Hints" msgstr "" -#: ../../reference/compound_stmts.rst:1358 +#: ../../reference/compound_stmts.rst:1360 msgid "Definition of a standard meaning for annotations: type hints." msgstr "" -#: ../../reference/compound_stmts.rst:1362 +#: ../../reference/compound_stmts.rst:1364 msgid ":pep:`526` - Syntax for Variable Annotations" msgstr "" -#: ../../reference/compound_stmts.rst:1361 +#: ../../reference/compound_stmts.rst:1363 msgid "" "Ability to type hint variable declarations, including class variables and " "instance variables" msgstr "" -#: ../../reference/compound_stmts.rst:1365 +#: ../../reference/compound_stmts.rst:1367 msgid ":pep:`563` - Postponed Evaluation of Annotations" msgstr "" -#: ../../reference/compound_stmts.rst:1365 +#: ../../reference/compound_stmts.rst:1367 msgid "" "Support for forward references within annotations by preserving annotations " "in a string form at runtime instead of eager evaluation." msgstr "" -#: ../../reference/compound_stmts.rst:1372 +#: ../../reference/compound_stmts.rst:1374 msgid "Class definitions" msgstr "" -#: ../../reference/compound_stmts.rst:1387 +#: ../../reference/compound_stmts.rst:1389 msgid "A class definition defines a class object (see section :ref:`types`):" msgstr "" -#: ../../reference/compound_stmts.rst:1394 +#: ../../reference/compound_stmts.rst:1396 msgid "" "A class definition is an executable statement. The inheritance list usually " "gives a list of base classes (see :ref:`metaclasses` for more advanced " @@ -1552,11 +1552,11 @@ msgid "" "default, from the base class :class:`object`; hence, ::" msgstr "" -#: ../../reference/compound_stmts.rst:1403 +#: ../../reference/compound_stmts.rst:1405 msgid "is equivalent to ::" msgstr "" -#: ../../reference/compound_stmts.rst:1408 +#: ../../reference/compound_stmts.rst:1410 msgid "" "The class's suite is then executed in a new execution frame (see :ref:" "`naming`), using a newly created local namespace and the original global " @@ -1568,7 +1568,7 @@ msgid "" "original local namespace." msgstr "" -#: ../../reference/compound_stmts.rst:1417 +#: ../../reference/compound_stmts.rst:1419 msgid "" "The order in which attributes are defined in the class body is preserved in " "the new class's ``__dict__``. Note that this is reliable only right after " @@ -1576,30 +1576,30 @@ msgid "" "definition syntax." msgstr "" -#: ../../reference/compound_stmts.rst:1422 +#: ../../reference/compound_stmts.rst:1424 msgid "" "Class creation can be customized heavily using :ref:`metaclasses " "`." msgstr "" -#: ../../reference/compound_stmts.rst:1427 +#: ../../reference/compound_stmts.rst:1429 msgid "Classes can also be decorated: just like when decorating functions, ::" msgstr "" -#: ../../reference/compound_stmts.rst:1438 +#: ../../reference/compound_stmts.rst:1440 msgid "" "The evaluation rules for the decorator expressions are the same as for " "function decorators. The result is then bound to the class name." msgstr "" -#: ../../reference/compound_stmts.rst:1441 +#: ../../reference/compound_stmts.rst:1443 msgid "" "Classes may be decorated with any valid :token:`~python-grammar:" "assignment_expression`. Previously, the grammar was much more restrictive; " "see :pep:`614` for details." msgstr "" -#: ../../reference/compound_stmts.rst:1446 +#: ../../reference/compound_stmts.rst:1448 msgid "" "A list of :ref:`type parameters ` may be given in square " "brackets immediately after the class's name. This indicates to static type " @@ -1608,7 +1608,7 @@ msgid "" "classes` for more." msgstr "" -#: ../../reference/compound_stmts.rst:1455 +#: ../../reference/compound_stmts.rst:1457 msgid "" "**Programmer's note:** Variables defined in the class definition are class " "attributes; they are shared by instances. Instance attributes can be set in " @@ -1621,35 +1621,35 @@ msgid "" "implementation details." msgstr "" -#: ../../reference/compound_stmts.rst:1470 +#: ../../reference/compound_stmts.rst:1472 msgid ":pep:`3115` - Metaclasses in Python 3000" msgstr "" -#: ../../reference/compound_stmts.rst:1468 +#: ../../reference/compound_stmts.rst:1470 msgid "" "The proposal that changed the declaration of metaclasses to the current " "syntax, and the semantics for how classes with metaclasses are constructed." msgstr "" -#: ../../reference/compound_stmts.rst:1473 +#: ../../reference/compound_stmts.rst:1475 msgid ":pep:`3129` - Class Decorators" msgstr "" -#: ../../reference/compound_stmts.rst:1473 +#: ../../reference/compound_stmts.rst:1475 msgid "" "The proposal that added class decorators. Function and method decorators " "were introduced in :pep:`318`." msgstr "" -#: ../../reference/compound_stmts.rst:1480 +#: ../../reference/compound_stmts.rst:1482 msgid "Coroutines" msgstr "協程" -#: ../../reference/compound_stmts.rst:1488 +#: ../../reference/compound_stmts.rst:1490 msgid "Coroutine function definition" msgstr "" -#: ../../reference/compound_stmts.rst:1498 +#: ../../reference/compound_stmts.rst:1500 msgid "" "Execution of Python coroutines can be suspended and resumed at many points " "(see :term:`coroutine`). :keyword:`await` expressions, :keyword:`async for` " @@ -1657,109 +1657,109 @@ msgid "" "function." msgstr "" -#: ../../reference/compound_stmts.rst:1502 +#: ../../reference/compound_stmts.rst:1504 msgid "" "Functions defined with ``async def`` syntax are always coroutine functions, " "even if they do not contain ``await`` or ``async`` keywords." msgstr "" -#: ../../reference/compound_stmts.rst:1505 +#: ../../reference/compound_stmts.rst:1507 msgid "" "It is a :exc:`SyntaxError` to use a ``yield from`` expression inside the " "body of a coroutine function." msgstr "" -#: ../../reference/compound_stmts.rst:1508 +#: ../../reference/compound_stmts.rst:1510 msgid "An example of a coroutine function::" msgstr "" "一個協程韓式函式範例:\n" "\n" "::" -#: ../../reference/compound_stmts.rst:1514 +#: ../../reference/compound_stmts.rst:1516 msgid "" "``await`` and ``async`` are now keywords; previously they were only treated " "as such inside the body of a coroutine function." msgstr "" -#: ../../reference/compound_stmts.rst:1522 +#: ../../reference/compound_stmts.rst:1524 msgid "The :keyword:`!async for` statement" msgstr "" -#: ../../reference/compound_stmts.rst:1527 +#: ../../reference/compound_stmts.rst:1529 msgid "" "An :term:`asynchronous iterable` provides an ``__aiter__`` method that " "directly returns an :term:`asynchronous iterator`, which can call " "asynchronous code in its ``__anext__`` method." msgstr "" -#: ../../reference/compound_stmts.rst:1531 +#: ../../reference/compound_stmts.rst:1533 msgid "" "The ``async for`` statement allows convenient iteration over asynchronous " "iterables." msgstr "" -#: ../../reference/compound_stmts.rst:1541 +#: ../../reference/compound_stmts.rst:1543 msgid "Is semantically equivalent to::" msgstr "" -#: ../../reference/compound_stmts.rst:1557 +#: ../../reference/compound_stmts.rst:1559 msgid "" "See also :meth:`~object.__aiter__` and :meth:`~object.__anext__` for details." msgstr "" "更多細節請見 :meth:`~object.__aiter__` 與 :meth:`~object.__anext__`\\ 。" -#: ../../reference/compound_stmts.rst:1559 +#: ../../reference/compound_stmts.rst:1561 msgid "" "It is a :exc:`SyntaxError` to use an ``async for`` statement outside the " "body of a coroutine function." msgstr "" -#: ../../reference/compound_stmts.rst:1567 +#: ../../reference/compound_stmts.rst:1569 msgid "The :keyword:`!async with` statement" msgstr "" -#: ../../reference/compound_stmts.rst:1572 +#: ../../reference/compound_stmts.rst:1574 msgid "" "An :term:`asynchronous context manager` is a :term:`context manager` that is " "able to suspend execution in its *enter* and *exit* methods." msgstr "" -#: ../../reference/compound_stmts.rst:1599 +#: ../../reference/compound_stmts.rst:1601 msgid "" "See also :meth:`~object.__aenter__` and :meth:`~object.__aexit__` for " "details." msgstr "" "更多細節請見 :meth:`~object.__aenter__` 與 :meth:`~object.__aexit__`\\ 。" -#: ../../reference/compound_stmts.rst:1601 +#: ../../reference/compound_stmts.rst:1603 msgid "" "It is a :exc:`SyntaxError` to use an ``async with`` statement outside the " "body of a coroutine function." msgstr "" -#: ../../reference/compound_stmts.rst:1607 +#: ../../reference/compound_stmts.rst:1609 msgid ":pep:`492` - Coroutines with async and await syntax" msgstr "" -#: ../../reference/compound_stmts.rst:1607 +#: ../../reference/compound_stmts.rst:1609 msgid "" "The proposal that made coroutines a proper standalone concept in Python, and " "added supporting syntax." msgstr "" -#: ../../reference/compound_stmts.rst:1613 +#: ../../reference/compound_stmts.rst:1615 msgid "Type parameter lists" msgstr "" -#: ../../reference/compound_stmts.rst:1627 +#: ../../reference/compound_stmts.rst:1629 msgid "" ":ref:`Functions ` (including :ref:`coroutines `), :ref:" "`classes ` and :ref:`type aliases ` may contain a type " "parameter list::" msgstr "" -#: ../../reference/compound_stmts.rst:1646 +#: ../../reference/compound_stmts.rst:1648 msgid "" "Semantically, this indicates that the function, class, or type alias is " "generic over a type variable. This information is primarily used by static " @@ -1767,7 +1767,7 @@ msgid "" "generic counterparts." msgstr "" -#: ../../reference/compound_stmts.rst:1651 +#: ../../reference/compound_stmts.rst:1653 msgid "" "Type parameters are declared in square brackets (``[]``) immediately after " "the name of the function, class, or type alias. The type parameters are " @@ -1779,36 +1779,36 @@ msgid "" "wraps the creation of the generic object." msgstr "" -#: ../../reference/compound_stmts.rst:1660 +#: ../../reference/compound_stmts.rst:1662 msgid "" "Generic functions, classes, and type aliases have a :attr:`!__type_params__` " "attribute listing their type parameters." msgstr "" -#: ../../reference/compound_stmts.rst:1663 +#: ../../reference/compound_stmts.rst:1665 msgid "Type parameters come in three kinds:" msgstr "" -#: ../../reference/compound_stmts.rst:1665 +#: ../../reference/compound_stmts.rst:1667 msgid "" ":data:`typing.TypeVar`, introduced by a plain name (e.g., ``T``). " "Semantically, this represents a single type to a type checker." msgstr "" -#: ../../reference/compound_stmts.rst:1667 +#: ../../reference/compound_stmts.rst:1669 msgid "" ":data:`typing.TypeVarTuple`, introduced by a name prefixed with a single " "asterisk (e.g., ``*Ts``). Semantically, this stands for a tuple of any " "number of types." msgstr "" -#: ../../reference/compound_stmts.rst:1670 +#: ../../reference/compound_stmts.rst:1672 msgid "" ":data:`typing.ParamSpec`, introduced by a name prefixed with two asterisks " "(e.g., ``**P``). Semantically, this stands for the parameters of a callable." msgstr "" -#: ../../reference/compound_stmts.rst:1673 +#: ../../reference/compound_stmts.rst:1675 msgid "" ":data:`typing.TypeVar` declarations can define *bounds* and *constraints* " "with a colon (``:``) followed by an expression. A single expression after " @@ -1820,7 +1820,7 @@ msgid "" "variables can only take on one of the types in the list of constraints." msgstr "" -#: ../../reference/compound_stmts.rst:1682 +#: ../../reference/compound_stmts.rst:1684 msgid "" "For :data:`!typing.TypeVar`\\ s declared using the type parameter list " "syntax, the bound and constraints are not evaluated when the generic object " @@ -1830,35 +1830,35 @@ msgid "" "`." msgstr "" -#: ../../reference/compound_stmts.rst:1688 +#: ../../reference/compound_stmts.rst:1690 msgid "" ":data:`typing.TypeVarTuple`\\ s and :data:`typing.ParamSpec`\\ s cannot have " "bounds or constraints." msgstr "" -#: ../../reference/compound_stmts.rst:1691 +#: ../../reference/compound_stmts.rst:1693 msgid "" "The following example indicates the full set of allowed type parameter " "declarations::" msgstr "" -#: ../../reference/compound_stmts.rst:1709 +#: ../../reference/compound_stmts.rst:1711 msgid "Generic functions" msgstr "" -#: ../../reference/compound_stmts.rst:1711 +#: ../../reference/compound_stmts.rst:1713 msgid "Generic functions are declared as follows::" msgstr "" -#: ../../reference/compound_stmts.rst:1715 -#: ../../reference/compound_stmts.rst:1775 +#: ../../reference/compound_stmts.rst:1717 +#: ../../reference/compound_stmts.rst:1777 msgid "This syntax is equivalent to::" msgstr "" "語法大致等價於:\n" "\n" "::" -#: ../../reference/compound_stmts.rst:1724 +#: ../../reference/compound_stmts.rst:1726 msgid "" "Here ``annotation-def`` indicates an :ref:`annotation scope `, which is not actually bound to any name at runtime. (One other " @@ -1867,47 +1867,47 @@ msgid "" "data:`typing.TypeVar` directly.)" msgstr "" -#: ../../reference/compound_stmts.rst:1730 +#: ../../reference/compound_stmts.rst:1732 msgid "" "The annotations of generic functions are evaluated within the annotation " "scope used for declaring the type parameters, but the function's defaults " "and decorators are not." msgstr "" -#: ../../reference/compound_stmts.rst:1734 +#: ../../reference/compound_stmts.rst:1736 msgid "" "The following example illustrates the scoping rules for these cases, as well " "as for additional flavors of type parameters::" msgstr "" -#: ../../reference/compound_stmts.rst:1741 +#: ../../reference/compound_stmts.rst:1743 msgid "" "Except for the :ref:`lazy evaluation ` of the :class:" "`~typing.TypeVar` bound, this is equivalent to::" msgstr "" -#: ../../reference/compound_stmts.rst:1763 +#: ../../reference/compound_stmts.rst:1765 msgid "" "The capitalized names like ``DEFAULT_OF_arg`` are not actually bound at " "runtime." msgstr "" -#: ../../reference/compound_stmts.rst:1769 +#: ../../reference/compound_stmts.rst:1771 msgid "Generic classes" msgstr "" -#: ../../reference/compound_stmts.rst:1771 +#: ../../reference/compound_stmts.rst:1773 msgid "Generic classes are declared as follows::" msgstr "" -#: ../../reference/compound_stmts.rst:1785 +#: ../../reference/compound_stmts.rst:1787 msgid "" "Here again ``annotation-def`` (not a real keyword) indicates an :ref:" "`annotation scope `, and the name ``TYPE_PARAMS_OF_Bag`` " "is not actually bound at runtime." msgstr "" -#: ../../reference/compound_stmts.rst:1789 +#: ../../reference/compound_stmts.rst:1791 msgid "" "Generic classes implicitly inherit from :data:`typing.Generic`. The base " "classes and keyword arguments of generic classes are evaluated within the " @@ -1915,128 +1915,128 @@ msgid "" "that scope. This is illustrated by this example::" msgstr "" -#: ../../reference/compound_stmts.rst:1798 +#: ../../reference/compound_stmts.rst:1800 msgid "This is equivalent to::" msgstr "" "這等價於:\n" "\n" "::" -#: ../../reference/compound_stmts.rst:1811 +#: ../../reference/compound_stmts.rst:1813 msgid "Generic type aliases" msgstr "" -#: ../../reference/compound_stmts.rst:1813 +#: ../../reference/compound_stmts.rst:1815 msgid "" "The :keyword:`type` statement can also be used to create a generic type " "alias::" msgstr "" -#: ../../reference/compound_stmts.rst:1817 +#: ../../reference/compound_stmts.rst:1819 msgid "" "Except for the :ref:`lazy evaluation ` of the value, this " "is equivalent to::" msgstr "" -#: ../../reference/compound_stmts.rst:1829 +#: ../../reference/compound_stmts.rst:1831 msgid "" "Here, ``annotation-def`` (not a real keyword) indicates an :ref:`annotation " "scope `. The capitalized names like " "``TYPE_PARAMS_OF_ListOrSet`` are not actually bound at runtime." msgstr "" -#: ../../reference/compound_stmts.rst:1834 +#: ../../reference/compound_stmts.rst:1836 msgid "Footnotes" msgstr "註解" -#: ../../reference/compound_stmts.rst:1835 +#: ../../reference/compound_stmts.rst:1837 msgid "" "The exception is propagated to the invocation stack unless there is a :" "keyword:`finally` clause which happens to raise another exception. That new " "exception causes the old one to be lost." msgstr "" -#: ../../reference/compound_stmts.rst:1839 +#: ../../reference/compound_stmts.rst:1841 msgid "In pattern matching, a sequence is defined as one of the following:" msgstr "" -#: ../../reference/compound_stmts.rst:1841 +#: ../../reference/compound_stmts.rst:1843 msgid "a class that inherits from :class:`collections.abc.Sequence`" msgstr "" -#: ../../reference/compound_stmts.rst:1842 +#: ../../reference/compound_stmts.rst:1844 msgid "" "a Python class that has been registered as :class:`collections.abc.Sequence`" msgstr "" -#: ../../reference/compound_stmts.rst:1843 +#: ../../reference/compound_stmts.rst:1845 msgid "" "a builtin class that has its (CPython) :c:macro:`Py_TPFLAGS_SEQUENCE` bit set" msgstr "" -#: ../../reference/compound_stmts.rst:1844 -#: ../../reference/compound_stmts.rst:1863 +#: ../../reference/compound_stmts.rst:1846 +#: ../../reference/compound_stmts.rst:1865 msgid "a class that inherits from any of the above" msgstr "" -#: ../../reference/compound_stmts.rst:1846 +#: ../../reference/compound_stmts.rst:1848 msgid "The following standard library classes are sequences:" msgstr "" -#: ../../reference/compound_stmts.rst:1848 +#: ../../reference/compound_stmts.rst:1850 msgid ":class:`array.array`" msgstr ":class:`array.array`" -#: ../../reference/compound_stmts.rst:1849 +#: ../../reference/compound_stmts.rst:1851 msgid ":class:`collections.deque`" msgstr ":class:`collections.deque`" -#: ../../reference/compound_stmts.rst:1851 +#: ../../reference/compound_stmts.rst:1853 msgid ":class:`memoryview`" msgstr ":class:`memoryview`" -#: ../../reference/compound_stmts.rst:1852 +#: ../../reference/compound_stmts.rst:1854 msgid ":class:`range`" msgstr ":class:`range`" -#: ../../reference/compound_stmts.rst:1855 +#: ../../reference/compound_stmts.rst:1857 msgid "" "Subject values of type ``str``, ``bytes``, and ``bytearray`` do not match " "sequence patterns." msgstr "" -#: ../../reference/compound_stmts.rst:1858 +#: ../../reference/compound_stmts.rst:1860 msgid "In pattern matching, a mapping is defined as one of the following:" msgstr "" -#: ../../reference/compound_stmts.rst:1860 +#: ../../reference/compound_stmts.rst:1862 msgid "a class that inherits from :class:`collections.abc.Mapping`" msgstr "" -#: ../../reference/compound_stmts.rst:1861 +#: ../../reference/compound_stmts.rst:1863 msgid "" "a Python class that has been registered as :class:`collections.abc.Mapping`" msgstr "" -#: ../../reference/compound_stmts.rst:1862 +#: ../../reference/compound_stmts.rst:1864 msgid "" "a builtin class that has its (CPython) :c:macro:`Py_TPFLAGS_MAPPING` bit set" msgstr "" -#: ../../reference/compound_stmts.rst:1865 +#: ../../reference/compound_stmts.rst:1867 msgid "" "The standard library classes :class:`dict` and :class:`types." "MappingProxyType` are mappings." msgstr "" -#: ../../reference/compound_stmts.rst:1868 +#: ../../reference/compound_stmts.rst:1870 msgid "" "A string literal appearing as the first statement in the function body is " "transformed into the function's ``__doc__`` attribute and therefore the " "function's :term:`docstring`." msgstr "" -#: ../../reference/compound_stmts.rst:1872 +#: ../../reference/compound_stmts.rst:1874 msgid "" "A string literal appearing as the first statement in the class body is " "transformed into the namespace's ``__doc__`` item and therefore the class's :" @@ -2057,11 +2057,11 @@ msgstr "compound(複合)" #: ../../reference/compound_stmts.rst:436 #: ../../reference/compound_stmts.rst:470 #: ../../reference/compound_stmts.rst:587 -#: ../../reference/compound_stmts.rst:1192 -#: ../../reference/compound_stmts.rst:1374 -#: ../../reference/compound_stmts.rst:1484 -#: ../../reference/compound_stmts.rst:1518 -#: ../../reference/compound_stmts.rst:1563 +#: ../../reference/compound_stmts.rst:1194 +#: ../../reference/compound_stmts.rst:1376 +#: ../../reference/compound_stmts.rst:1486 +#: ../../reference/compound_stmts.rst:1520 +#: ../../reference/compound_stmts.rst:1565 msgid "statement" msgstr "statement(陳述式)" @@ -2109,7 +2109,7 @@ msgstr "if" #: ../../reference/compound_stmts.rst:407 #: ../../reference/compound_stmts.rst:470 #: ../../reference/compound_stmts.rst:587 -#: ../../reference/compound_stmts.rst:1494 +#: ../../reference/compound_stmts.rst:1496 msgid "keyword" msgstr "keyword(關鍵字)" @@ -2122,9 +2122,9 @@ msgstr "elif" #: ../../reference/compound_stmts.rst:207 #: ../../reference/compound_stmts.rst:470 #: ../../reference/compound_stmts.rst:587 -#: ../../reference/compound_stmts.rst:1192 -#: ../../reference/compound_stmts.rst:1318 -#: ../../reference/compound_stmts.rst:1374 +#: ../../reference/compound_stmts.rst:1194 +#: ../../reference/compound_stmts.rst:1320 +#: ../../reference/compound_stmts.rst:1376 msgid ": (colon)" msgstr ": (冒號)" @@ -2133,8 +2133,8 @@ msgstr ": (冒號)" #: ../../reference/compound_stmts.rst:207 #: ../../reference/compound_stmts.rst:470 #: ../../reference/compound_stmts.rst:587 -#: ../../reference/compound_stmts.rst:1192 -#: ../../reference/compound_stmts.rst:1374 +#: ../../reference/compound_stmts.rst:1194 +#: ../../reference/compound_stmts.rst:1376 msgid "compound statement" msgstr "compound statement(複合陳述式)" @@ -2179,8 +2179,8 @@ msgstr "list(串列)" #: ../../reference/compound_stmts.rst:144 #: ../../reference/compound_stmts.rst:299 -#: ../../reference/compound_stmts.rst:1192 -#: ../../reference/compound_stmts.rst:1374 +#: ../../reference/compound_stmts.rst:1194 +#: ../../reference/compound_stmts.rst:1376 msgid "object" msgstr "object(物件)" @@ -2250,8 +2250,8 @@ msgid "with statement" msgstr "with statement(with 陳述式)" #: ../../reference/compound_stmts.rst:470 -#: ../../reference/compound_stmts.rst:1192 -#: ../../reference/compound_stmts.rst:1374 +#: ../../reference/compound_stmts.rst:1194 +#: ../../reference/compound_stmts.rst:1376 msgid ", (comma)" msgstr ", (逗號)" @@ -2291,158 +2291,158 @@ msgstr "" msgid "AS pattern, OR pattern, capture pattern, wildcard pattern" msgstr "" -#: ../../reference/compound_stmts.rst:1183 -#: ../../reference/compound_stmts.rst:1268 +#: ../../reference/compound_stmts.rst:1185 +#: ../../reference/compound_stmts.rst:1270 msgid "parameter" msgstr "parameter(參數)" -#: ../../reference/compound_stmts.rst:1183 -#: ../../reference/compound_stmts.rst:1192 -#: ../../reference/compound_stmts.rst:1233 -#: ../../reference/compound_stmts.rst:1268 -#: ../../reference/compound_stmts.rst:1297 +#: ../../reference/compound_stmts.rst:1185 +#: ../../reference/compound_stmts.rst:1194 +#: ../../reference/compound_stmts.rst:1235 +#: ../../reference/compound_stmts.rst:1270 +#: ../../reference/compound_stmts.rst:1299 msgid "function definition" msgstr "function definition(函式定義)" -#: ../../reference/compound_stmts.rst:1192 +#: ../../reference/compound_stmts.rst:1194 msgid "def" msgstr "def" -#: ../../reference/compound_stmts.rst:1192 -#: ../../reference/compound_stmts.rst:1318 +#: ../../reference/compound_stmts.rst:1194 +#: ../../reference/compound_stmts.rst:1320 msgid "function" msgstr "function (函式)" -#: ../../reference/compound_stmts.rst:1192 -#: ../../reference/compound_stmts.rst:1374 +#: ../../reference/compound_stmts.rst:1194 +#: ../../reference/compound_stmts.rst:1376 msgid "definition" msgstr "definition(定義)" -#: ../../reference/compound_stmts.rst:1192 -#: ../../reference/compound_stmts.rst:1374 +#: ../../reference/compound_stmts.rst:1194 +#: ../../reference/compound_stmts.rst:1376 msgid "name" msgstr "name(名稱)" -#: ../../reference/compound_stmts.rst:1192 -#: ../../reference/compound_stmts.rst:1374 +#: ../../reference/compound_stmts.rst:1194 +#: ../../reference/compound_stmts.rst:1376 msgid "binding" msgstr "binding(綁定)" -#: ../../reference/compound_stmts.rst:1192 +#: ../../reference/compound_stmts.rst:1194 msgid "user-defined function" msgstr "user-defined function(使用者定義函式)" -#: ../../reference/compound_stmts.rst:1192 -#: ../../reference/compound_stmts.rst:1374 +#: ../../reference/compound_stmts.rst:1194 +#: ../../reference/compound_stmts.rst:1376 msgid "() (parentheses)" msgstr "() (圓括號)" -#: ../../reference/compound_stmts.rst:1192 +#: ../../reference/compound_stmts.rst:1194 msgid "parameter list" msgstr "parameter list(參數列表)" -#: ../../reference/compound_stmts.rst:1233 -#: ../../reference/compound_stmts.rst:1424 +#: ../../reference/compound_stmts.rst:1235 +#: ../../reference/compound_stmts.rst:1426 msgid "@ (at)" msgstr "@ (在)" -#: ../../reference/compound_stmts.rst:1268 +#: ../../reference/compound_stmts.rst:1270 msgid "default" msgstr "default(預設)" -#: ../../reference/compound_stmts.rst:1268 +#: ../../reference/compound_stmts.rst:1270 msgid "value" msgstr "value(值)" -#: ../../reference/compound_stmts.rst:1268 +#: ../../reference/compound_stmts.rst:1270 msgid "argument" msgstr "argument(引數)" -#: ../../reference/compound_stmts.rst:1268 +#: ../../reference/compound_stmts.rst:1270 msgid "= (equals)" msgstr "= (等於)" -#: ../../reference/compound_stmts.rst:1297 +#: ../../reference/compound_stmts.rst:1299 msgid "/ (slash)" msgstr "/ (斜線)" -#: ../../reference/compound_stmts.rst:1297 +#: ../../reference/compound_stmts.rst:1299 msgid "* (asterisk)" msgstr "* (星號)" -#: ../../reference/compound_stmts.rst:1297 +#: ../../reference/compound_stmts.rst:1299 msgid "**" msgstr "**" -#: ../../reference/compound_stmts.rst:1318 +#: ../../reference/compound_stmts.rst:1320 msgid "annotations" msgstr "annotations(註釋)" -#: ../../reference/compound_stmts.rst:1318 +#: ../../reference/compound_stmts.rst:1320 msgid "->" msgstr "->" -#: ../../reference/compound_stmts.rst:1318 +#: ../../reference/compound_stmts.rst:1320 msgid "function annotations" msgstr "function annotations(函式註釋)" -#: ../../reference/compound_stmts.rst:1336 +#: ../../reference/compound_stmts.rst:1338 msgid "lambda" msgstr "lambda" -#: ../../reference/compound_stmts.rst:1336 +#: ../../reference/compound_stmts.rst:1338 msgid "expression" msgstr "expression(運算式)" -#: ../../reference/compound_stmts.rst:1374 +#: ../../reference/compound_stmts.rst:1376 msgid "class" msgstr "class(類別)" -#: ../../reference/compound_stmts.rst:1374 +#: ../../reference/compound_stmts.rst:1376 msgid "execution" msgstr "execution(執行)" -#: ../../reference/compound_stmts.rst:1374 +#: ../../reference/compound_stmts.rst:1376 msgid "frame" msgstr "frame" -#: ../../reference/compound_stmts.rst:1374 +#: ../../reference/compound_stmts.rst:1376 msgid "inheritance" msgstr "inheritance(繼承)" -#: ../../reference/compound_stmts.rst:1374 +#: ../../reference/compound_stmts.rst:1376 msgid "docstring" msgstr "docstring(說明字串)" -#: ../../reference/compound_stmts.rst:1374 -#: ../../reference/compound_stmts.rst:1424 +#: ../../reference/compound_stmts.rst:1376 +#: ../../reference/compound_stmts.rst:1426 msgid "class definition" msgstr "class definition(類別定義)" -#: ../../reference/compound_stmts.rst:1374 +#: ../../reference/compound_stmts.rst:1376 msgid "expression list" msgstr "expression list(表達式列表)" -#: ../../reference/compound_stmts.rst:1484 +#: ../../reference/compound_stmts.rst:1486 msgid "async def" msgstr "async def" -#: ../../reference/compound_stmts.rst:1494 +#: ../../reference/compound_stmts.rst:1496 msgid "async" msgstr "async" -#: ../../reference/compound_stmts.rst:1494 +#: ../../reference/compound_stmts.rst:1496 msgid "await" msgstr "await" -#: ../../reference/compound_stmts.rst:1518 +#: ../../reference/compound_stmts.rst:1520 msgid "async for" msgstr "async for" -#: ../../reference/compound_stmts.rst:1563 +#: ../../reference/compound_stmts.rst:1565 msgid "async with" msgstr "async with" -#: ../../reference/compound_stmts.rst:1617 +#: ../../reference/compound_stmts.rst:1619 msgid "type parameters" msgstr "type parameter(型別參數)" diff --git a/reference/lexical_analysis.po b/reference/lexical_analysis.po index a58e3375df..017a48a4ea 100644 --- a/reference/lexical_analysis.po +++ b/reference/lexical_analysis.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-29 10:36+0000\n" +"POT-Creation-Date: 2023-10-11 17:13+0000\n" "PO-Revision-Date: 2018-05-23 16:17+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -337,11 +337,11 @@ msgstr "" #: ../../reference/lexical_analysis.rst:307 msgid "*Lu* - uppercase letters" -msgstr "" +msgstr "*Lu* - 大寫字母" #: ../../reference/lexical_analysis.rst:308 msgid "*Ll* - lowercase letters" -msgstr "" +msgstr "*Ll* - 小寫字母" #: ../../reference/lexical_analysis.rst:309 msgid "*Lt* - titlecase letters" @@ -353,7 +353,7 @@ msgstr "" #: ../../reference/lexical_analysis.rst:311 msgid "*Lo* - other letters" -msgstr "" +msgstr "*Lo* - 其他字母" #: ../../reference/lexical_analysis.rst:312 msgid "*Nl* - letter numbers" @@ -369,7 +369,7 @@ msgstr "" #: ../../reference/lexical_analysis.rst:315 msgid "*Nd* - decimal numbers" -msgstr "" +msgstr "*Nd* - 十進位數字" #: ../../reference/lexical_analysis.rst:316 msgid "*Pc* - connector punctuations" @@ -401,7 +401,7 @@ msgstr "" #: ../../reference/lexical_analysis.rst:333 msgid "Keywords" -msgstr "" +msgstr "關鍵字" #: ../../reference/lexical_analysis.rst:339 msgid "" @@ -412,7 +412,7 @@ msgstr "" #: ../../reference/lexical_analysis.rst:357 msgid "Soft Keywords" -msgstr "" +msgstr "軟關鍵字" #: ../../reference/lexical_analysis.rst:363 msgid "" @@ -437,7 +437,7 @@ msgstr "" #: ../../reference/lexical_analysis.rst:375 msgid "``type`` is now a soft keyword." -msgstr "" +msgstr "``type`` 現在是軟關鍵字。" #: ../../reference/lexical_analysis.rst:384 msgid "Reserved classes of identifiers" @@ -657,7 +657,7 @@ msgstr "``\\'``" #: ../../reference/lexical_analysis.rst:567 msgid "Single quote (``'``)" -msgstr "" +msgstr "單引號 (``'``)" #: ../../reference/lexical_analysis.rst:569 msgid "``\\\"``" @@ -665,7 +665,7 @@ msgstr "``\\\"``" #: ../../reference/lexical_analysis.rst:569 msgid "Double quote (``\"``)" -msgstr "" +msgstr "雙引號 (``\"``)" #: ../../reference/lexical_analysis.rst:571 msgid "``\\a``" @@ -724,8 +724,8 @@ msgid "ASCII Vertical Tab (VT)" msgstr "" #: ../../reference/lexical_analysis.rst:585 -msgid "``\\ooo``" -msgstr "``\\ooo``" +msgid ":samp:`\\\\\\\\{ooo}`" +msgstr "" #: ../../reference/lexical_analysis.rst:585 msgid "Character with octal value *ooo*" @@ -736,8 +736,8 @@ msgid "(2,4)" msgstr "(2,4)" #: ../../reference/lexical_analysis.rst:588 -msgid "``\\xhh``" -msgstr "``\\xhh``" +msgid ":samp:`\\\\x{hh}`" +msgstr ":samp:`\\\\x{hh}`" #: ../../reference/lexical_analysis.rst:588 msgid "Character with hex value *hh*" @@ -752,8 +752,8 @@ msgid "Escape sequences only recognized in string literals are:" msgstr "" #: ../../reference/lexical_analysis.rst:596 -msgid "``\\N{name}``" -msgstr "``\\N{name}``" +msgid ":samp:`\\\\N\\\\{{name}\\\\}`" +msgstr ":samp:`\\\\N\\\\{{name}\\\\}`" #: ../../reference/lexical_analysis.rst:596 msgid "Character named *name* in the Unicode database" @@ -764,8 +764,8 @@ msgid "\\(5)" msgstr "\\(5)" #: ../../reference/lexical_analysis.rst:599 -msgid "``\\uxxxx``" -msgstr "``\\uxxxx``" +msgid ":samp:`\\\\u{xxxx}`" +msgstr ":samp:`\\\\u{xxxx}`" #: ../../reference/lexical_analysis.rst:599 msgid "Character with 16-bit hex value *xxxx*" @@ -776,8 +776,8 @@ msgid "\\(6)" msgstr "\\(6)" #: ../../reference/lexical_analysis.rst:602 -msgid "``\\Uxxxxxxxx``" -msgstr "``\\Uxxxxxxxx``" +msgid ":samp:`\\\\U{xxxxxxxx}`" +msgstr ":samp:`\\\\U{xxxxxxxx}`" #: ../../reference/lexical_analysis.rst:602 msgid "Character with 32-bit hex value *xxxxxxxx*" @@ -974,7 +974,7 @@ msgstr "" #: ../../reference/lexical_analysis.rst:782 msgid "The equal sign ``'='``." -msgstr "" +msgstr "等號 ``'='``。" #: ../../reference/lexical_analysis.rst:785 msgid "" @@ -1608,3 +1608,15 @@ msgstr "operators(運算子)" #: ../../reference/lexical_analysis.rst:1015 msgid "delimiters" msgstr "delimiters(分隔符號)" + +#~ msgid "``\\ooo``" +#~ msgstr "``\\ooo``" + +#~ msgid "``\\xhh``" +#~ msgstr "``\\xhh``" + +#~ msgid "``\\N{name}``" +#~ msgstr "``\\N{name}``" + +#~ msgid "``\\uxxxx``" +#~ msgstr "``\\uxxxx``" diff --git a/tutorial/controlflow.po b/tutorial/controlflow.po index 70a87a9db4..bd3440f671 100644 --- a/tutorial/controlflow.po +++ b/tutorial/controlflow.po @@ -11,7 +11,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-10-11 17:13+0000\n" "PO-Revision-Date: 2022-07-24 14:52+0800\n" "Last-Translator: Steven Hsu \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -648,7 +648,7 @@ msgid "" "the object's type. Different types define different methods. Methods of " "different types may have the same name without causing ambiguity. (It is " "possible to define your own object types and methods, using *classes*, see :" -"ref:`tut-classes`) The method :meth:`~list.append` shown in the example is " +"ref:`tut-classes`) The method :meth:`!append` shown in the example is " "defined for list objects; it adds a new element at the end of the list. In " "this example it is equivalent to ``result = result + [a]``, but more " "efficient." @@ -658,9 +658,9 @@ msgstr "" "``obj`` 為某個物件(亦可為一運算式),而 ``methodname`` 為該 method 的名稱," "並由該物件的型別所定義。不同的型別定義不同的 method。不同型別的 method 可以擁" "有一樣的名稱而不會讓 Python 混淆。(你可以使用 *class*\\ (類別)定義自己的物" -"件型別和 method,見 :ref:`tut-classes`\\ )範例中的 :meth:`~list.append` " -"method 定義在 list 物件中;它會在該 list 的末端加入一個新的元素。這個例子等同" -"於 ``result = result + [a]``,但更有效率。" +"件型別和 method,見 :ref:`tut-classes`\\ )範例中的 :meth:`!append` method 定" +"義在 list 物件中;它會在該 list 的末端加入一個新的元素。這個例子等同於 " +"``result = result + [a]``,但更有效率。" #: ../../tutorial/controlflow.rst:545 msgid "More on Defining Functions" @@ -1227,8 +1227,8 @@ msgstr "" #: ../../tutorial/controlflow.rst:1049 msgid "" -":term:`Annotations ` are stored in the :attr:" -"`__annotations__` attribute of the function as a dictionary and have no " +":term:`Annotations ` are stored in the :attr:`!" +"__annotations__` attribute of the function as a dictionary and have no " "effect on any other part of the function. Parameter annotations are defined " "by a colon after the parameter name, followed by an expression evaluating to " "the value of the annotation. Return annotations are defined by a literal ``-" @@ -1237,10 +1237,10 @@ msgid "" "a required argument, an optional argument, and the return value annotated::" msgstr "" ":term:`註釋 `\\ 以 dictionary(字典)的形式存放在函式" -"的 :attr:`__annotations__` 屬性中,且不會影響函式的任何其他部分。參數註釋的定" -"義方式是在參數名稱後加一個冒號,冒號後面跟著一個對註釋求值的運算式。回傳註釋" -"的定義方式是在參數列表和 :keyword:`def` 陳述式結尾的冒號中間,用一個 ``->`` " -"文字接著一個運算式。以下範例註釋了一個必要引數、一個選擇性引數,以及回傳" +"的 :attr:`!__annotations__` 屬性中,且不會影響函式的任何其他部分。參數註釋的" +"定義方式是在參數名稱後加一個冒號,冒號後面跟著一個對註釋求值的運算式。回傳註" +"釋的定義方式是在參數列表和 :keyword:`def` 陳述式結尾的冒號中間,用一個 ``-" +">`` 文字接著一個運算式。以下範例註釋了一個必要引數、一個選擇性引數,以及回傳" "值:\n" "\n" "::" diff --git a/tutorial/floatingpoint.po b/tutorial/floatingpoint.po index fdd9c5324d..3b9786296a 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-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-10-11 17:13+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-" @@ -220,8 +220,8 @@ msgstr "" #: ../../tutorial/floatingpoint.rst:139 msgid "" "Alternatively, the :func:`round` function can be used to compare rough " -"approximations::" -msgstr "或者,可以使用 :func:`round` 函式來比較粗略的近似值: ::" +"approximations:" +msgstr "或者,可以使用 :func:`round` 函式來比較粗略的近似值:" #: ../../tutorial/floatingpoint.rst:147 msgid "" diff --git a/tutorial/introduction.po b/tutorial/introduction.po index ee580ee041..9979da11cf 100644 --- a/tutorial/introduction.po +++ b/tutorial/introduction.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-25 00:04+0000\n" +"POT-Creation-Date: 2023-10-11 17:13+0000\n" "PO-Revision-Date: 2022-10-16 03:20+0800\n" "Last-Translator: Steven Hsu \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -35,7 +35,7 @@ msgid "" "that a secondary prompt on a line by itself in an example means you must " "type a blank line; this is used to end a multi-line command." msgstr "" -"在下面的例子中,輸入與輸出的區別在於有無提示字元(prompt,\\ :term:`>>>` 和 :" +"在下面的例子中,輸入與輸出的區別在於有無提示字元(prompt,:term:`>>>` 和 :" "term:`...`\\ ):如果要重做範例,你必須在提示字元出現的時候,輸入提示字元後方" "的所有內容;那些非提示字元開始的文字行是直譯器的輸出。注意到在範例中,若出現" "單行只有次提示字元時,代表該行你必須直接換行;這被使用在多行指令結束輸入時。" @@ -264,8 +264,8 @@ msgid "" "at the end of the line. The following example::" msgstr "" "字串文本可以跨越數行。其中一方式是使用三個重覆引號:\\ ``\"\"\"...\"\"\"`` " -"或 ``'''...'''``\\ 。此時換行會被自動加入字串值中,但也可以在換行前加入 " -"``\\`` 來取消這個行為。在以下的例子中:\n" +"或 ``'''...'''``。此時換行會被自動加入字串值中,但也可以在換行前加入 ``\\`` " +"來取消這個行為。在以下的例子中:\n" "\n" "::" @@ -590,7 +590,7 @@ msgstr "初探程式設計的前幾步" msgid "" "Of course, we can use Python for more complicated tasks than adding two and " "two together. For instance, we can write an initial sub-sequence of the " -"`Fibonacci series `_ as " +"`Fibonacci series `_ as " "follows::" msgstr "" "當然,我們可以用 Python 來處理比 2 加 2 更複雜的工作。例如,我們可以印出\\ `" @@ -630,9 +630,8 @@ msgstr "" "行。在 Python 中如同 C 語言,任何非零的整數值為真 (true);零為假 (false)。條" "件可以是字串、list、甚至是任何序列型別;任何非零長度的序列為真,空的序列即為" "假。本例子使用的條件是個簡單的比較。標準的比較運算子 (comparison operators) " -"使用如同 C 語言一樣的符號:\\ ``<``\\ (小於)、\\ ``>``\\ (大於)、\\ " -"``==``\\ (等於)、\\ ``<=``\\ (小於等於)、\\ ``>=``\\ (大於等於)以及 ``!" -"=``\\ (不等於)。" +"使用如同 C 語言一樣的符號:``<``\\ (小於)、``>``\\ (大於)、``==``\\ (等" +"於)、``<=``\\ (小於等於)、``>=``\\ (大於等於)以及 ``!=``\\ (不等於)。" #: ../../tutorial/introduction.rst:518 msgid "" @@ -688,9 +687,8 @@ msgid "" "as ``-(3**2)`` and thus result in ``-9``. To avoid this and get ``9``, you " "can use ``(-3)**2``." msgstr "" -"因為 ``**`` 擁有較 ``-`` 高的優先次序,\\ ``-3**2`` 會被解釋為 ``-(3**2)`` 並" -"得到 ``-9``\\ 。如果要避免這樣的優先順序以得到 ``9``,你可以使用 " -"``(-3)**2``\\ 。" +"因為 ``**`` 擁有較 ``-`` 高的優先次序,``-3**2`` 會被解釋為 ``-(3**2)`` 並得" +"到 ``-9``。如果要避免這樣的優先順序以得到 ``9``,你可以使用 ``(-3)**2``。" #: ../../tutorial/introduction.rst:555 msgid "" diff --git a/using/cmdline.po b/using/cmdline.po index 06d0f4d366..4bc54baaa8 100644 --- a/using/cmdline.po +++ b/using/cmdline.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-18 00:03+0000\n" +"POT-Creation-Date: 2023-10-14 23:09+0800\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-" @@ -169,8 +169,7 @@ msgstr "" msgid "" ":option:`-I` option can be used to run the script in isolated mode where :" "data:`sys.path` contains neither the current directory nor the user's site-" -"packages directory. All :envvar:`PYTHON*` environment variables are ignored, " -"too." +"packages directory. All ``PYTHON*`` environment variables are ignored, too." msgstr "" #: ../../using/cmdline.rst:109 @@ -259,8 +258,7 @@ msgstr "" msgid "" ":option:`-I` option can be used to run the script in isolated mode where :" "data:`sys.path` contains neither the script's directory nor the user's site-" -"packages directory. All :envvar:`PYTHON*` environment variables are ignored, " -"too." +"packages directory. All ``PYTHON*`` environment variables are ignored, too." msgstr "" #: ../../using/cmdline.rst:167 @@ -378,8 +376,8 @@ msgstr "" #: ../../using/cmdline.rst:283 msgid "" -"Ignore all :envvar:`PYTHON*` environment variables, e.g. :envvar:" -"`PYTHONPATH` and :envvar:`PYTHONHOME`, that might be set." +"Ignore all ``PYTHON*`` environment variables, e.g. :envvar:`PYTHONPATH` and :" +"envvar:`PYTHONHOME`, that might be set." msgstr "" #: ../../using/cmdline.rst:286 @@ -409,7 +407,7 @@ msgstr "" #: ../../using/cmdline.rst:305 msgid "" "In isolated mode :data:`sys.path` contains neither the script's directory " -"nor the user's site-packages directory. All :envvar:`PYTHON*` environment " +"nor the user's site-packages directory. All ``PYTHON*`` environment " "variables are ignored, too. Further restrictions may be imposed to prevent " "the user from injecting malicious code." msgstr "" @@ -476,10 +474,10 @@ msgstr "" #: ../../using/cmdline.rst:364 msgid "" "On previous versions of Python, this option turns on hash randomization, so " -"that the :meth:`__hash__` values of str and bytes objects are \"salted\" " -"with an unpredictable random value. Although they remain constant within an " -"individual Python process, they are not predictable between repeated " -"invocations of Python." +"that the :meth:`~object.__hash__` values of str and bytes objects are " +"\"salted\" with an unpredictable random value. Although they remain " +"constant within an individual Python process, they are not predictable " +"between repeated invocations of Python." msgstr "" #: ../../using/cmdline.rst:370 @@ -1061,7 +1059,8 @@ msgstr "" msgid "" "Defines the :data:`user base directory `, which is used to " "compute the path of the :data:`user site-packages directory ` and installation paths for ``python -m pip install --user``." +"USER_SITE>` and :ref:`installation paths ` for " +"``python -m pip install --user``." msgstr "" #: ../../using/cmdline.rst:824 @@ -1081,12 +1080,12 @@ msgstr "" msgid "" "If this environment variable is set to a non-empty string, :func:" "`faulthandler.enable` is called at startup: install a handler for :const:" -"`SIGSEGV`, :const:`SIGFPE`, :const:`SIGABRT`, :const:`SIGBUS` and :const:" -"`SIGILL` signals to dump the Python traceback. This is equivalent to :" -"option:`-X` ``faulthandler`` option." +"`~signal.SIGSEGV`, :const:`~signal.SIGFPE`, :const:`~signal.SIGABRT`, :const:" +"`~signal.SIGBUS` and :const:`~signal.SIGILL` signals to dump the Python " +"traceback. This is equivalent to :option:`-X` ``faulthandler`` option." msgstr "" -#: ../../using/cmdline.rst:863 +#: ../../using/cmdline.rst:864 msgid "" "If this environment variable is set to a non-empty string, start tracing " "Python memory allocations using the :mod:`tracemalloc` module. The value of " @@ -1096,90 +1095,90 @@ msgid "" "is equivalent to setting the :option:`-X` ``tracemalloc`` option." msgstr "" -#: ../../using/cmdline.rst:876 +#: ../../using/cmdline.rst:877 msgid "" "If this environment variable is set to a non-empty string, Python will show " "how long each import takes. This is equivalent to setting the :option:`-X` " "``importtime`` option." msgstr "" -#: ../../using/cmdline.rst:885 +#: ../../using/cmdline.rst:886 msgid "" "If this environment variable is set to a non-empty string, enable the :ref:" "`debug mode ` of the :mod:`asyncio` module." msgstr "" -#: ../../using/cmdline.rst:893 +#: ../../using/cmdline.rst:894 msgid "Set the Python memory allocators and/or install debug hooks." msgstr "" -#: ../../using/cmdline.rst:895 +#: ../../using/cmdline.rst:896 msgid "Set the family of memory allocators used by Python:" msgstr "" -#: ../../using/cmdline.rst:897 +#: ../../using/cmdline.rst:898 msgid "" "``default``: use the :ref:`default memory allocators `." msgstr "" -#: ../../using/cmdline.rst:899 +#: ../../using/cmdline.rst:900 msgid "" "``malloc``: use the :c:func:`malloc` function of the C library for all " "domains (:c:macro:`PYMEM_DOMAIN_RAW`, :c:macro:`PYMEM_DOMAIN_MEM`, :c:macro:" "`PYMEM_DOMAIN_OBJ`)." msgstr "" -#: ../../using/cmdline.rst:902 +#: ../../using/cmdline.rst:903 msgid "" "``pymalloc``: use the :ref:`pymalloc allocator ` for :c:macro:" "`PYMEM_DOMAIN_MEM` and :c:macro:`PYMEM_DOMAIN_OBJ` domains and use the :c:" "func:`malloc` function for the :c:macro:`PYMEM_DOMAIN_RAW` domain." msgstr "" -#: ../../using/cmdline.rst:906 +#: ../../using/cmdline.rst:907 msgid "Install :ref:`debug hooks `:" msgstr "" -#: ../../using/cmdline.rst:908 +#: ../../using/cmdline.rst:909 msgid "" "``debug``: install debug hooks on top of the :ref:`default memory allocators " "`." msgstr "" -#: ../../using/cmdline.rst:910 +#: ../../using/cmdline.rst:911 msgid "``malloc_debug``: same as ``malloc`` but also install debug hooks." msgstr "" -#: ../../using/cmdline.rst:911 +#: ../../using/cmdline.rst:912 msgid "``pymalloc_debug``: same as ``pymalloc`` but also install debug hooks." msgstr "" -#: ../../using/cmdline.rst:913 +#: ../../using/cmdline.rst:914 msgid "Added the ``\"default\"`` allocator." msgstr "" -#: ../../using/cmdline.rst:921 +#: ../../using/cmdline.rst:922 msgid "" "If set to a non-empty string, Python will print statistics of the :ref:" "`pymalloc memory allocator ` every time a new pymalloc object " "arena is created, and on shutdown." msgstr "" -#: ../../using/cmdline.rst:925 +#: ../../using/cmdline.rst:926 msgid "" "This variable is ignored if the :envvar:`PYTHONMALLOC` environment variable " "is used to force the :c:func:`malloc` allocator of the C library, or if " "Python is configured without ``pymalloc`` support." msgstr "" -#: ../../using/cmdline.rst:929 +#: ../../using/cmdline.rst:930 msgid "" "This variable can now also be used on Python compiled in release mode. It " "now has no effect if set to an empty string." msgstr "" -#: ../../using/cmdline.rst:936 +#: ../../using/cmdline.rst:937 msgid "" "If set to a non-empty string, the default :term:`filesystem encoding and " "error handler` mode will revert to their pre-3.6 values of 'mbcs' and " @@ -1187,41 +1186,41 @@ msgid "" "'surrogatepass' are used." msgstr "" -#: ../../using/cmdline.rst:941 +#: ../../using/cmdline.rst:942 msgid "" "This may also be enabled at runtime with :func:`sys." "_enablelegacywindowsfsencoding()`." msgstr "" -#: ../../using/cmdline.rst:944 ../../using/cmdline.rst:958 +#: ../../using/cmdline.rst:945 ../../using/cmdline.rst:959 msgid ":ref:`Availability `: Windows." msgstr ":ref:`適用 `:Windows。" -#: ../../using/cmdline.rst:946 +#: ../../using/cmdline.rst:947 msgid "See :pep:`529` for more details." -msgstr "更多細節請見 :pep:`529`\\ 。" +msgstr "更多細節請見 :pep:`529`。" -#: ../../using/cmdline.rst:951 +#: ../../using/cmdline.rst:952 msgid "" "If set to a non-empty string, does not use the new console reader and " "writer. This means that Unicode characters will be encoded according to the " "active console code page, rather than using utf-8." msgstr "" -#: ../../using/cmdline.rst:955 +#: ../../using/cmdline.rst:956 msgid "" "This variable is ignored if the standard streams are redirected (to files or " "pipes) rather than referring to console buffers." msgstr "" -#: ../../using/cmdline.rst:965 +#: ../../using/cmdline.rst:966 msgid "" "If set to the value ``0``, causes the main Python command line application " "to skip coercing the legacy ASCII-based C and POSIX locales to a more " "capable UTF-8 based alternative." msgstr "" -#: ../../using/cmdline.rst:969 +#: ../../using/cmdline.rst:970 msgid "" "If this variable is *not* set (or is set to a value other than ``0``), the " "``LC_ALL`` locale override environment variable is also not set, and the " @@ -1232,19 +1231,19 @@ msgid "" "runtime:" msgstr "" -#: ../../using/cmdline.rst:977 +#: ../../using/cmdline.rst:978 msgid "``C.UTF-8``" msgstr "``C.UTF-8``" -#: ../../using/cmdline.rst:978 +#: ../../using/cmdline.rst:979 msgid "``C.utf8``" msgstr "``C.utf8``" -#: ../../using/cmdline.rst:979 +#: ../../using/cmdline.rst:980 msgid "``UTF-8``" msgstr "``UTF-8``" -#: ../../using/cmdline.rst:981 +#: ../../using/cmdline.rst:982 msgid "" "If setting one of these locale categories succeeds, then the ``LC_CTYPE`` " "environment variable will also be set accordingly in the current process " @@ -1257,7 +1256,7 @@ msgid "" "(such as Python's own :func:`locale.getdefaultlocale`)." msgstr "" -#: ../../using/cmdline.rst:991 +#: ../../using/cmdline.rst:992 msgid "" "Configuring one of these locales (either explicitly or via the above " "implicit locale coercion) automatically enables the ``surrogateescape`` :ref:" @@ -1267,7 +1266,7 @@ msgid "" "envvar:`PYTHONIOENCODING` as usual." msgstr "" -#: ../../using/cmdline.rst:998 +#: ../../using/cmdline.rst:999 msgid "" "For debugging purposes, setting ``PYTHONCOERCECLOCALE=warn`` will cause " "Python to emit warning messages on ``stderr`` if either the locale coercion " @@ -1275,7 +1274,7 @@ msgid "" "active when the Python runtime is initialized." msgstr "" -#: ../../using/cmdline.rst:1003 +#: ../../using/cmdline.rst:1004 msgid "" "Also note that even when locale coercion is disabled, or when it fails to " "find a suitable target locale, :envvar:`PYTHONUTF8` will still activate by " @@ -1284,15 +1283,15 @@ msgid "" "system interfaces." msgstr "" -#: ../../using/cmdline.rst:1009 +#: ../../using/cmdline.rst:1010 msgid ":ref:`Availability `: Unix." msgstr ":ref:`適用 `:Unix。" -#: ../../using/cmdline.rst:1011 +#: ../../using/cmdline.rst:1012 msgid "See :pep:`538` for more details." -msgstr "更多細節請見 :pep:`538`\\ 。" +msgstr "更多細節請見 :pep:`538`。" -#: ../../using/cmdline.rst:1017 +#: ../../using/cmdline.rst:1018 msgid "" "If this environment variable is set to a non-empty string, enable :ref:" "`Python Development Mode `, introducing additional runtime checks " @@ -1300,31 +1299,31 @@ msgid "" "setting the :option:`-X` ``dev`` option." msgstr "" -#: ../../using/cmdline.rst:1026 +#: ../../using/cmdline.rst:1027 msgid "If set to ``1``, enable the :ref:`Python UTF-8 Mode `." msgstr "如果設為 ``1``,則啟用 :ref:`Python UTF-8 Mode `。" -#: ../../using/cmdline.rst:1028 +#: ../../using/cmdline.rst:1029 msgid "If set to ``0``, disable the :ref:`Python UTF-8 Mode `." msgstr "如果設為 ``0``,則停用 :ref:`Python UTF-8 Mode `。" -#: ../../using/cmdline.rst:1030 +#: ../../using/cmdline.rst:1031 msgid "" "Setting any other non-empty string causes an error during interpreter " "initialisation." msgstr "" -#: ../../using/cmdline.rst:1037 +#: ../../using/cmdline.rst:1038 msgid "" "If this environment variable is set to a non-empty string, issue a :class:" "`EncodingWarning` when the locale-specific default encoding is used." msgstr "" -#: ../../using/cmdline.rst:1040 +#: ../../using/cmdline.rst:1041 msgid "See :ref:`io-encoding-warning` for details." -msgstr "細節請見 :ref:`io-encoding-warning`\\ 。" +msgstr "細節請見 :ref:`io-encoding-warning`。" -#: ../../using/cmdline.rst:1046 +#: ../../using/cmdline.rst:1047 msgid "" "If this variable is set, it disables the inclusion of the tables mapping " "extra location information (end line, start column offset and end column " @@ -1333,38 +1332,38 @@ msgid "" "visual location indicators when the interpreter displays tracebacks." msgstr "" -#: ../../using/cmdline.rst:1056 +#: ../../using/cmdline.rst:1057 msgid "" "If this variable is set to a nonzero value, it enables support for the Linux " "``perf`` profiler so Python calls can be detected by it." msgstr "" -#: ../../using/cmdline.rst:1059 +#: ../../using/cmdline.rst:1060 msgid "If set to ``0``, disable Linux ``perf`` profiler support." msgstr "" -#: ../../using/cmdline.rst:1061 +#: ../../using/cmdline.rst:1062 msgid "" "See also the :option:`-X perf <-X>` command-line option and :ref:" "`perf_profiling`." msgstr "" -#: ../../using/cmdline.rst:1068 +#: ../../using/cmdline.rst:1069 msgid "Debug-mode variables" msgstr "除錯模式變數" -#: ../../using/cmdline.rst:1072 +#: ../../using/cmdline.rst:1073 msgid "" "If set, Python will dump objects and reference counts still alive after " "shutting down the interpreter." msgstr "" -#: ../../using/cmdline.rst:1075 ../../using/cmdline.rst:1082 +#: ../../using/cmdline.rst:1076 ../../using/cmdline.rst:1083 msgid "" "Need Python configured with the :option:`--with-trace-refs` build option." msgstr "" -#: ../../using/cmdline.rst:1079 +#: ../../using/cmdline.rst:1080 msgid "" "If set, Python will dump objects and reference counts still alive after " "shutting down the interpreter into a file called *FILENAME*." diff --git a/using/configure.po b/using/configure.po index f461e35107..3ea12f723f 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-09-09 00:03+0000\n" +"POT-Creation-Date: 2023-10-11 17:13+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -20,7 +20,7 @@ msgstr "" #: ../../using/configure.rst:3 msgid "Configure Python" -msgstr "" +msgstr "配置 Python" #: ../../using/configure.rst:6 msgid "Build Requirements" @@ -46,7 +46,7 @@ msgstr "" #: ../../using/configure.rst:19 msgid "Support for threads." -msgstr "" +msgstr "thread 的支援。" #: ../../using/configure.rst:21 msgid "OpenSSL 1.1.1 or newer for the :mod:`ssl` and :mod:`hashlib` modules." @@ -54,7 +54,7 @@ msgstr "" #: ../../using/configure.rst:23 msgid "On Windows, Microsoft Visual Studio 2017 or later is required." -msgstr "" +msgstr "在 Windows 上需要 Microsoft Visual Studio 2017 或更新版本。" #: ../../using/configure.rst:25 msgid "" @@ -68,7 +68,7 @@ msgstr "OpenSSL 1.1.1 現在是必要的。" #: ../../using/configure.rst:32 msgid "Thread support and OpenSSL 1.0.2 are now required." -msgstr "" +msgstr "對執行緒與 OpenSSL 1.0.2 的支援現在是必要的。" #: ../../using/configure.rst:35 msgid "" @@ -123,7 +123,7 @@ msgstr "" msgid "" "See also the :file:`Misc/SpecialBuilds.txt` in the Python source " "distribution." -msgstr "" +msgstr "請見 Python 原始碼發行版中的 :file:`Misc/SpecialBuilds.txt`。" #: ../../using/configure.rst:81 msgid "General Options" @@ -131,8 +131,8 @@ msgstr "一般選項" #: ../../using/configure.rst:85 msgid "" -"Support loadable extensions in the :mod:`_sqlite` extension module (default " -"is no)." +"Support loadable extensions in the :mod:`!_sqlite` extension module (default " +"is no) of the :mod:`sqlite3` module." msgstr "" #: ../../using/configure.rst:88 @@ -140,12 +140,14 @@ msgid "" "See the :meth:`sqlite3.Connection.enable_load_extension` method of the :mod:" "`sqlite3` module." msgstr "" +"請見 :mod:`sqlite3` 模組的 :meth:`sqlite3.Connection.enable_load_extension` " +"方法。" #: ../../using/configure.rst:95 msgid "" "Disable IPv6 support (enabled by default if supported), see the :mod:" "`socket` module." -msgstr "" +msgstr "停用 IPv6 支援(如果支援的話預設是啟用的),請見 :mod:`socket` 模組。" #: ../../using/configure.rst:100 msgid "Define the size in bits of Python :class:`int` digits: 15 or 30 bits." @@ -157,15 +159,15 @@ msgstr "" #: ../../using/configure.rst:104 msgid "Define the ``PYLONG_BITS_IN_DIGIT`` to ``15`` or ``30``." -msgstr "將 ``PYLONG_BITS_IN_DIGIT`` 定義為 ``15`` 或 ``30``\\ 。" +msgstr "將 ``PYLONG_BITS_IN_DIGIT`` 定義為 ``15`` 或 ``30``。" #: ../../using/configure.rst:106 msgid "See :data:`sys.int_info.bits_per_digit `." -msgstr "參閱 :data:`sys.int_info.bits_per_digit `\\ 。" +msgstr "參閱 :data:`sys.int_info.bits_per_digit `。" #: ../../using/configure.rst:110 msgid "Set the Python executable suffix to *SUFFIX*." -msgstr "" +msgstr "將 Python 執行檔的後綴設定為 *SUFFIX*。" #: ../../using/configure.rst:112 msgid "" @@ -174,12 +176,15 @@ msgid "" "wasm`` on WASI, and an empty string on other platforms (``python`` " "executable)." msgstr "" +"在 Windows 和 macOS 上預設的後綴是 ``.exe`` (``python.exe`` 執行檔)、在 " +"Emscripten node 上為 ``.js``、在 Emscripten 瀏覽器為 ``.html``、在 WASI 上為 " +"``.wasm``,以及在其他平台為空字串(``python`` 執行檔)。" #: ../../using/configure.rst:117 msgid "" "The default suffix on WASM platform is one of ``.js``, ``.html`` or ``." "wasm``." -msgstr "" +msgstr "在 WASM 平台上預設的後綴是 ``.js``、``.html`` 或 ``.wasm`` 中的一個。" #: ../../using/configure.rst:123 msgid "" @@ -193,10 +198,12 @@ msgid "" "Default: ``/usr/share/zoneinfo:/usr/lib/zoneinfo:/usr/share/lib/zoneinfo:/" "etc/zoneinfo``." msgstr "" +"預設值:``/usr/share/zoneinfo:/usr/lib/zoneinfo:/usr/share/lib/zoneinfo:/etc/" +"zoneinfo``。" #: ../../using/configure.rst:129 msgid "See :data:`os.pathsep` path separator." -msgstr "" +msgstr "請見 :data:`os.pathsep` 路徑分隔符號。" #: ../../using/configure.rst:135 msgid "" @@ -206,7 +213,7 @@ msgstr "" #: ../../using/configure.rst:138 msgid "See :const:`decimal.HAVE_CONTEXTVAR` and the :mod:`contextvars` module." -msgstr "" +msgstr "請見 :const:`decimal.HAVE_CONTEXTVAR` 與 :mod:`contextvars` 模組。" #: ../../using/configure.rst:144 msgid "Override order to check db backends for the :mod:`dbm` module" @@ -247,7 +254,7 @@ msgstr "" #: ../../using/configure.rst:168 msgid "Python library directory name (default is ``lib``)." -msgstr "" +msgstr "Python 函式庫目錄名稱(預設為 ``lib`` )。" #: ../../using/configure.rst:170 msgid "Fedora and SuSE use ``lib64`` on 64-bit platforms." @@ -255,7 +262,7 @@ msgstr "Fedora 和 SuSE 在 64 位元平台上使用 ``lib64``。" #: ../../using/configure.rst:172 msgid "See :data:`sys.platlibdir`." -msgstr "參閱 :data:`sys.platlibdir`\\ 。" +msgstr "參閱 :data:`sys.platlibdir`。" #: ../../using/configure.rst:178 msgid "" @@ -267,7 +274,7 @@ msgstr "" msgid "" "Some Linux distribution packaging policies recommend against bundling " "dependencies. For example, Fedora installs wheel packages in the ``/usr/" -"share/python-wheels/`` directory and don't install the :mod:`ensurepip." +"share/python-wheels/`` directory and don't install the :mod:`!ensurepip." "_bundled` package." msgstr "" @@ -279,15 +286,15 @@ msgstr "" #: ../../using/configure.rst:193 msgid "``check`` (default): :program:`pkg-config` is optional" -msgstr "" +msgstr "``check`` (預設)::program:`pkg-config` 是可選的" #: ../../using/configure.rst:194 msgid "``yes``: :program:`pkg-config` is mandatory" -msgstr "" +msgstr "``yes``::program:`pkg-config` 是必要的" #: ../../using/configure.rst:195 msgid "``no``: configure does not use :program:`pkg-config` even when present" -msgstr "" +msgstr "``no``:即使存在也不使用 :program:`pkg-config` 來配置" #: ../../using/configure.rst:201 msgid "Turn on internal statistics gathering." @@ -318,7 +325,7 @@ msgstr "" #: ../../using/configure.rst:219 msgid "``node``: NODERAWFS and pthread support." -msgstr "" +msgstr "``node``:對 NODERAWFS 和 pthread 支援。" #: ../../using/configure.rst:225 msgid "Turn on dynamic linking support for WASM." @@ -346,7 +353,7 @@ msgstr "" #: ../../using/configure.rst:247 msgid "This value can be retrieved at runtime using :data:`sys.prefix`." -msgstr "" +msgstr "這個值可以在 runtime 使用 :data:`sys.prefix` 取得。" #: ../../using/configure.rst:249 msgid "" @@ -362,31 +369,33 @@ msgstr "" #: ../../using/configure.rst:256 msgid "This value can be retrieved at runtime using :data:`sys.exec_prefix`." -msgstr "" +msgstr "這個值可以在 runtime 使用 :data:`sys.exec_prefix` 取得" #: ../../using/configure.rst:260 msgid "" "Don't build nor install test modules, like the :mod:`test` package or the :" -"mod:`_testcapi` extension module (built and installed by default)." +"mod:`!_testcapi` extension module (built and installed by default)." msgstr "" #: ../../using/configure.rst:267 msgid "Select the :mod:`ensurepip` command run on Python installation:" -msgstr "" +msgstr "選擇在 Python 安裝時執行的 :mod:`ensurepip` 命令:" #: ../../using/configure.rst:269 msgid "" "``upgrade`` (default): run ``python -m ensurepip --altinstall --upgrade`` " "command." msgstr "" +"``upgrade`` (預設):執行 ``python -m ensurepip --altinstall --upgrade`` 命" +"令。" #: ../../using/configure.rst:271 msgid "``install``: run ``python -m ensurepip --altinstall`` command;" -msgstr "" +msgstr "``install``:執行 ``python -m ensurepip --altinstall`` 命令;" #: ../../using/configure.rst:272 msgid "``no``: don't run ensurepip;" -msgstr "" +msgstr "``no``:不要執行 ensurepip;" #: ../../using/configure.rst:278 msgid "Performance options" @@ -420,7 +429,7 @@ msgstr "" #: ../../using/configure.rst:298 msgid "Use ``-fno-semantic-interposition`` on GCC." -msgstr "" +msgstr "在 GCC 上使用 ``-fno-semantic-interposition``。" #: ../../using/configure.rst:303 msgid "" @@ -430,7 +439,7 @@ msgstr "" #: ../../using/configure.rst:306 msgid "Default: ``-m test --pgo --timeout=$(TESTTIMEOUT)``." -msgstr "" +msgstr "預設值:``-m test --pgo --timeout=$(TESTTIMEOUT)``。" #: ../../using/configure.rst:312 msgid "Enable Link Time Optimization (LTO) in any build (disabled by default)." @@ -508,11 +517,11 @@ msgstr "" #: ../../using/configure.rst:367 msgid "Don't define the ``WITH_DOC_STRINGS`` macro." -msgstr "" +msgstr "不要定義 ``WITH_DOC_STRINGS`` 巨集。" #: ../../using/configure.rst:369 msgid "See the ``PyDoc_STRVAR()`` macro." -msgstr "" +msgstr "請見 ``PyDoc_STRVAR()`` 巨集。" #: ../../using/configure.rst:373 msgid "Enable C-level code profiling with ``gprof`` (disabled by default)." @@ -546,11 +555,11 @@ msgstr "" #: ../../using/configure.rst:393 msgid "Add ``d`` to :data:`sys.abiflags`." -msgstr "" +msgstr "新增 ``d`` 到 :data:`sys.abiflags`。" #: ../../using/configure.rst:394 -msgid "Add :func:`sys.gettotalrefcount` function." -msgstr "新增 :func:`sys.gettotalrefcount` 函式。" +msgid "Add :func:`!sys.gettotalrefcount` function." +msgstr "新增 :func:`!sys.gettotalrefcount` 函式。" #: ../../using/configure.rst:395 msgid "Add :option:`-X showrefcount <-X>` command line option." @@ -614,7 +623,7 @@ msgstr "" #: ../../using/configure.rst:416 msgid "" -"The :c:macro:`Py_SAFE_DOWNCAST()` macro checks for integer underflow and " +"The :c:macro:`!Py_SAFE_DOWNCAST()` macro checks for integer underflow and " "overflow when downcasting from wide types to narrow types." msgstr "" @@ -655,8 +664,8 @@ msgid "Define the ``Py_TRACE_REFS`` macro." msgstr "定義 ``Py_TRACE_REFS`` 巨集。" #: ../../using/configure.rst:444 -msgid "Add :func:`sys.getobjects` function." -msgstr "新增 :func:`sys.getobjects` 函式。" +msgid "Add :func:`!sys.getobjects` function." +msgstr "新增 :func:`!sys.getobjects` 函式。" #: ../../using/configure.rst:445 msgid "Add :envvar:`PYTHONDUMPREFS` environment variable." @@ -739,7 +748,7 @@ msgstr "" #: ../../using/configure.rst:522 msgid "" -"Build the :mod:`pyexpat` module using an installed ``expat`` library " +"Build the :mod:`!pyexpat` module using an installed ``expat`` library " "(default is no)." msgstr "" @@ -1105,8 +1114,8 @@ msgstr "" #: ../../using/configure.rst:772 msgid "" -"The :c:macro:`PyAPI_FUNC()`, :c:macro:`PyAPI_DATA()` and :c:macro:" -"`PyMODINIT_FUNC` macros of :file:`Include/pyport.h` are defined differently " +"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 "" @@ -1121,8 +1130,8 @@ msgstr "否則使用 ``Py_IMPORTED_SYMBOL``。" #: ../../using/configure.rst:779 msgid "" "If the ``Py_BUILD_CORE_BUILTIN`` macro is used by mistake on a C extension " -"built as a shared library, its ``PyInit_xxx()`` function is not exported, " -"causing an :exc:`ImportError` on import." +"built as a shared library, its :samp:`PyInit_{xxx}()` function is not " +"exported, causing an :exc:`ImportError` on import." msgstr "" #: ../../using/configure.rst:785 @@ -1146,8 +1155,8 @@ msgstr "" #: ../../using/configure.rst:801 msgid "" -"(Objective) C/C++ preprocessor flags, e.g. ``-I`` if you have " -"headers in a nonstandard directory ````." +"(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 @@ -1362,8 +1371,8 @@ msgstr "" #: ../../using/configure.rst:991 msgid "" -"Linker flags, e.g. ``-L`` if you have libraries in a nonstandard " -"directory ````." +"Linker flags, e.g. :samp:`-L{lib_dir}` if you have libraries in a " +"nonstandard directory *lib_dir*." msgstr "" #: ../../using/configure.rst:1000 diff --git a/using/unix.po b/using/unix.po index e52c5fd184..c60e6b9d4a 100644 --- a/using/unix.po +++ b/using/unix.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-10-11 17:13+0000\n" "PO-Revision-Date: 2023-03-27 12:40+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -69,19 +69,19 @@ msgstr "對於 OpenSuse 用戶" #: ../../using/unix.rst:33 msgid "" -"https://docs-old.fedoraproject.org/en-US/Fedora_Draft_Documentation/0.1/html/" -"RPM_Guide/ch-creating-rpms.html" +"https://docs.fedoraproject.org/en-US/package-maintainers/" +"Packaging_Tutorial_GNU_Hello/" msgstr "" -"https://docs-old.fedoraproject.org/en-US/Fedora_Draft_Documentation/0.1/html/" -"RPM_Guide/ch-creating-rpms.html" +"https://docs.fedoraproject.org/en-US/package-maintainers/" +"Packaging_Tutorial_GNU_Hello/" #: ../../using/unix.rst:34 msgid "for Fedora users" msgstr "對於 Fedora 用戶" #: ../../using/unix.rst:35 -msgid "http://www.slackbook.org/html/package-management-making-packages.html" -msgstr "http://www.slackbook.org/html/package-management-making-packages.html" +msgid "https://slackbook.org/html/package-management-making-packages.html" +msgstr "https://slackbook.org/html/package-management-making-packages.html" #: ../../using/unix.rst:36 msgid "for Slackware users" @@ -296,14 +296,3 @@ msgid "" msgstr "" "OpenSSL 的修補釋出版 (patch releases) 具有向後相容的 ABI。你不需要重新編譯 " "Python 來更新 OpenSSL。使用一個新的版本來替代客製化 OpenSSL 安裝版就可以了。" - -#~ msgid "On OpenSolaris" -#~ msgstr "在 OpenSolaris 系統上" - -#~ msgid "" -#~ "You can get Python from `OpenCSW `_. Various " -#~ "versions of Python are available and can be installed with e.g. ``pkgutil " -#~ "-i python27``." -#~ msgstr "" -#~ "你可以從 `OpenCSW `_ 獲取、安裝及使用各種版本的 " -#~ "Python。比如 ``pkgutil -i python27``。" diff --git a/using/windows.po b/using/windows.po index a210a5b577..bd3c17e947 100644 --- a/using/windows.po +++ b/using/windows.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-17 00:04+0000\n" +"POT-Creation-Date: 2023-10-12 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-" @@ -1461,8 +1461,8 @@ msgstr "" #: ../../using/windows.rst:890 msgid "" "The \"-64\" suffix is deprecated, and now implies \"any architecture that is " -"not provably i386/32-bit\". To request a specific environment, use the new " -"``-V:`` argument with the complete tag." +"not provably i386/32-bit\". To request a specific environment, use the new :" +"samp:`-V:{TAG}` argument with the complete tag." msgstr "" #: ../../using/windows.rst:894 @@ -1957,19 +1957,19 @@ msgid "" "packages." msgstr "" -#: ../../using/windows.rst:1193 +#: ../../using/windows.rst:1192 msgid "" -"Adds ``._pth`` file support and removes ``applocal`` option from ``pyvenv." +"Add ``._pth`` file support and removes ``applocal`` option from ``pyvenv." "cfg``." msgstr "" -#: ../../using/windows.rst:1195 +#: ../../using/windows.rst:1197 msgid "" -"Adds ``pythonXX.zip`` as a potential landmark when directly adjacent to the " -"executable." +"Add :file:`python{XX}.zip` as a potential landmark when directly adjacent to " +"the executable." msgstr "" -#: ../../using/windows.rst:1201 +#: ../../using/windows.rst:1202 msgid "" "Modules specified in the registry under ``Modules`` (not ``PythonPath``) may " "be imported by :class:`importlib.machinery.WindowsRegistryFinder`. This " @@ -1977,88 +1977,88 @@ msgid "" "explicitly added to :data:`sys.meta_path` in the future." msgstr "" -#: ../../using/windows.rst:1207 +#: ../../using/windows.rst:1208 msgid "Additional modules" msgstr "" -#: ../../using/windows.rst:1209 +#: ../../using/windows.rst:1210 msgid "" "Even though Python aims to be portable among all platforms, there are " "features that are unique to Windows. A couple of modules, both in the " "standard library and external, and snippets exist to use these features." msgstr "" -#: ../../using/windows.rst:1213 +#: ../../using/windows.rst:1214 msgid "" "The Windows-specific standard modules are documented in :ref:`mswin-specific-" "services`." msgstr "" -#: ../../using/windows.rst:1217 +#: ../../using/windows.rst:1218 msgid "PyWin32" msgstr "PyWin32" -#: ../../using/windows.rst:1219 +#: ../../using/windows.rst:1220 msgid "" "The `PyWin32 `_ module by Mark Hammond is " "a collection of modules for advanced Windows-specific support. This " "includes utilities for:" msgstr "" -#: ../../using/windows.rst:1223 +#: ../../using/windows.rst:1224 msgid "" "`Component Object Model `_ (COM)" msgstr "" -#: ../../using/windows.rst:1226 +#: ../../using/windows.rst:1227 msgid "Win32 API calls" msgstr "Win32 API 呼叫" -#: ../../using/windows.rst:1227 +#: ../../using/windows.rst:1228 msgid "Registry" msgstr "登錄檔(Registry)" -#: ../../using/windows.rst:1228 +#: ../../using/windows.rst:1229 msgid "Event log" msgstr "事件日誌(Event log)" -#: ../../using/windows.rst:1229 +#: ../../using/windows.rst:1230 msgid "" "`Microsoft Foundation Classes `_ (MFC) user interfaces" msgstr "" -#: ../../using/windows.rst:1233 +#: ../../using/windows.rst:1234 msgid "" "`PythonWin `_ is a sample MFC application shipped with PyWin32. " "It is an embeddable IDE with a built-in debugger." msgstr "" -#: ../../using/windows.rst:1240 +#: ../../using/windows.rst:1241 msgid "" "`Win32 How Do I...? `_" msgstr "" "`Win32 How Do I...? `_" -#: ../../using/windows.rst:1240 +#: ../../using/windows.rst:1241 msgid "by Tim Golden" msgstr "由 Tim Golden 所著" -#: ../../using/windows.rst:1242 +#: ../../using/windows.rst:1243 msgid "`Python and COM `_" msgstr "`Python and COM `_" -#: ../../using/windows.rst:1243 +#: ../../using/windows.rst:1244 msgid "by David and Paul Boddie" msgstr "由 David 與 Paul Boddie 所著" -#: ../../using/windows.rst:1247 +#: ../../using/windows.rst:1248 msgid "cx_Freeze" msgstr "cx_Freeze" -#: ../../using/windows.rst:1249 +#: ../../using/windows.rst:1250 msgid "" "`cx_Freeze `_ wraps Python " "scripts into executable Windows programs (:file:`{*}.exe` files). When you " @@ -2066,11 +2066,11 @@ msgid "" "users to install Python." msgstr "" -#: ../../using/windows.rst:1256 +#: ../../using/windows.rst:1257 msgid "Compiling Python on Windows" msgstr "編譯 Python 在 Windows" -#: ../../using/windows.rst:1258 +#: ../../using/windows.rst:1259 msgid "" "If you want to compile CPython yourself, first thing you should do is get " "the `source `_. You can download " @@ -2078,48 +2078,48 @@ msgid "" "devguide.python.org/setup/#get-the-source-code>`_." msgstr "" -#: ../../using/windows.rst:1263 +#: ../../using/windows.rst:1264 msgid "" "The source tree contains a build solution and project files for Microsoft " "Visual Studio, which is the compiler used to build the official Python " "releases. These files are in the :file:`PCbuild` directory." msgstr "" -#: ../../using/windows.rst:1267 +#: ../../using/windows.rst:1268 msgid "" "Check :file:`PCbuild/readme.txt` for general information on the build " "process." msgstr "" -#: ../../using/windows.rst:1269 +#: ../../using/windows.rst:1270 msgid "For extension modules, consult :ref:`building-on-windows`." msgstr "" -#: ../../using/windows.rst:1273 +#: ../../using/windows.rst:1274 msgid "Other Platforms" msgstr "其他平台" -#: ../../using/windows.rst:1275 +#: ../../using/windows.rst:1276 msgid "" "With ongoing development of Python, some platforms that used to be supported " "earlier are no longer supported (due to the lack of users or developers). " "Check :pep:`11` for details on all unsupported platforms." msgstr "" -#: ../../using/windows.rst:1279 +#: ../../using/windows.rst:1280 msgid "" "`Windows CE `_ is `no longer supported " "`__ since Python 3 (if it " "ever was)." msgstr "" -#: ../../using/windows.rst:1282 +#: ../../using/windows.rst:1283 msgid "" "The `Cygwin `_ installer offers to install the `Python " "interpreter `__ as well" msgstr "" -#: ../../using/windows.rst:1286 +#: ../../using/windows.rst:1287 msgid "" "See `Python for Windows `_ for " "detailed information about platforms with pre-compiled installers." diff --git a/whatsnew/2.0.po b/whatsnew/2.0.po index 32d093ef5d..b0fba98274 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-07-29 10:36+0000\n" +"POT-Creation-Date: 2023-10-11 17:13+0000\n" "PO-Revision-Date: 2018-05-23 16:19+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -212,11 +212,11 @@ msgstr "" #: ../../whatsnew/2.0.rst:155 msgid "" "In Python source code, Unicode strings are written as ``u\"string\"``. " -"Arbitrary Unicode characters can be written using a new escape sequence, " -"``\\uHHHH``, where *HHHH* is a 4-digit hexadecimal number from 0000 to " -"FFFF. The existing ``\\xHHHH`` escape sequence can also be used, and octal " -"escapes can be used for characters up to U+01FF, which is represented by " -"``\\777``." +"Arbitrary Unicode characters can be written using a new escape sequence, :" +"samp:`\\\\u{HHHH}`, where *HHHH* is a 4-digit hexadecimal number from 0000 " +"to FFFF. The existing :samp:`\\\\x{HH}` escape sequence can also be used, " +"and octal escapes can be used for characters up to U+01FF, which is " +"represented by ``\\777``." msgstr "" #: ../../whatsnew/2.0.rst:161 diff --git a/whatsnew/2.3.po b/whatsnew/2.3.po index ea946a8f00..f542f4b572 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-08-23 00:03+0000\n" +"POT-Creation-Date: 2023-10-11 17:13+0000\n" "PO-Revision-Date: 2018-05-23 16:19+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -2069,8 +2069,8 @@ msgid "" "The :c:macro:`!DL_EXPORT` and :c:macro:`!DL_IMPORT` macros are now " "deprecated. Initialization functions for Python extension modules should now " "be declared using the new macro :c:macro:`PyMODINIT_FUNC`, while the Python " -"core will generally use the :c:macro:`PyAPI_FUNC` and :c:macro:`PyAPI_DATA` " -"macros." +"core will generally use the :c:macro:`!PyAPI_FUNC` and :c:macro:`!" +"PyAPI_DATA` macros." msgstr "" #: ../../whatsnew/2.3.rst:1894 diff --git a/whatsnew/2.6.po b/whatsnew/2.6.po index 736ee4d980..ac6200eaa8 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-08-23 00:03+0000\n" +"POT-Creation-Date: 2023-10-11 17:13+0000\n" "PO-Revision-Date: 2018-05-23 16:20+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -130,7 +130,7 @@ msgstr "" #: ../../whatsnew/2.6.rst:128 msgid "" -"The 3xxx series of PEPs, which contains proposals for Python 3.0. :pep:" +"The 3\\ *xxx* series of PEPs, which contains proposals for Python 3.0. :pep:" "`3000` describes the development process for Python 3.0. Start with :pep:" "`3100` that describes the general goals for Python 3.0, and then explore the " "higher-numbered PEPS that propose specific features." @@ -2054,16 +2054,15 @@ msgstr "" #: ../../whatsnew/2.6.rst:1853 msgid "" -"A new data type in the :mod:`collections` module: :class:" -"`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::" +"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 msgid "" "Several places in the standard library that returned tuples have been " -"modified to return :class:`namedtuple` instances. For example, the :meth:" +"modified to return :func:`namedtuple` instances. For example, the :meth:" "`Decimal.as_tuple` method now returns a named tuple with :attr:`sign`, :attr:" "`digits`, and :attr:`exponent` fields." msgstr "" diff --git a/whatsnew/3.10.po b/whatsnew/3.10.po index e1f2db7479..1f2d4fac77 100644 --- a/whatsnew/3.10.po +++ b/whatsnew/3.10.po @@ -1,5 +1,4 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2022, Python Software Foundation +# Copyright (C) 2001-2023, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # @@ -7,7 +6,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-10-11 17:13+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-" @@ -1114,11 +1113,11 @@ msgstr "" #: ../../whatsnew/3.10.rst:880 msgid "" "A :exc:`SyntaxError` (instead of a :exc:`NameError`) will be raised when " -"deleting the :const:`__debug__` constant. (Contributed by Dong-hee Na in :" +"deleting the :const:`__debug__` constant. (Contributed by Donghee Na in :" "issue:`45000`.)" msgstr "" "刪除 :const:`__debug__` 常數時將引發 :exc:`SyntaxError` (而不是 :exc:" -"`NameError`)。(由 Dong-hee Na 在 :issue:`45000` 中貢獻。)" +"`NameError`)。(由 Donghee Na 在 :issue:`45000` 中貢獻。)" #: ../../whatsnew/3.10.rst:883 msgid "" @@ -1241,7 +1240,7 @@ msgid "" "function. (Contributed by Hai Shi in :issue:`41842`.)" msgstr "" "新增 :func:`codecs.unregister` 函式來取消註冊 (unregister) 一個編解碼器的搜索" -"功能。 (Hai Shi在 :issue:`41842` 中貢獻。)" +"功能。 (Hai Shi 在 :issue:`41842` 中貢獻。)" #: ../../whatsnew/3.10.rst:947 msgid "collections.abc" @@ -1796,12 +1795,12 @@ msgstr "" #: ../../whatsnew/3.10.rst:1256 msgid "" "Add :const:`~os.O_EVTONLY`, :const:`~os.O_FSYNC`, :const:`~os.O_SYMLINK` " -"and :const:`~os.O_NOFOLLOW_ANY` for macOS. (Contributed by Dong-hee Na in :" +"and :const:`~os.O_NOFOLLOW_ANY` for macOS. (Contributed by Donghee Na in :" "issue:`43106`.)" msgstr "" "為 macOS 新增 :const:`~os.O_EVTONLY`、:const:`~os.O_FSYNC`、:const:`~os." -"O_SYMLINK` 和 :const:`~os.O_NOFOLLOW_ANY`。(由 Dong-hee Na 在 :issue:" -"`43106` 中貢獻。)" +"O_SYMLINK` 和 :const:`~os.O_NOFOLLOW_ANY`。(由 Donghee Na 在 :issue:`43106` " +"中貢獻。)" #: ../../whatsnew/3.10.rst:1261 msgid "os.path" @@ -2447,13 +2446,13 @@ msgstr "" msgid "" "The following built-in functions now support the faster :pep:`590` " "vectorcall calling convention: :func:`map`, :func:`filter`, :func:" -"`reversed`, :func:`bool` and :func:`float`. (Contributed by Dong-hee Na and " +"`reversed`, :func:`bool` and :func:`float`. (Contributed by Donghee Na and " "Jeroen Demeyer in :issue:`43575`, :issue:`43287`, :issue:`41922`, :issue:" "`41873` and :issue:`41870`.)" msgstr "" "以下內建函式現在支援更快的 :pep:`590` vectorcall 呼叫慣例::func:`map`、:" -"func:`filter`、:func:`reversed`、:func:`bool` 和 :func:`float`。(由 Dong-" -"hee Na 和 Jeroen Demeyer 在 :issue:`43575`、:issue:`43287`、:issue:`41922`、:" +"func:`filter`、:func:`reversed`、:func:`bool` 和 :func:`float`。(由 Donghee " +"Na 和 Jeroen Demeyer 在 :issue:`43575`、:issue:`43287`、:issue:`41922`、:" "issue:`41873` 和 :issue:`41870` 中貢獻。)" #: ../../whatsnew/3.10.rst:1587 @@ -2907,13 +2906,12 @@ msgid "" "somewhat obsolete, little used, and not tested. It was originally scheduled " "to be removed in Python 3.6, but such removals were delayed until after " "Python 2.7 EOL. Existing users should copy whatever classes they use into " -"their code. (Contributed by Dong-hee Na and Terry J. Reedy in :issue:" -"`42299`.)" +"their code. (Contributed by Donghee Na and Terry J. Reedy in :issue:`42299`.)" msgstr "" "刪除了 ``formatter`` 模組,該模組在 Python 3.4 中已棄用。它有些過時、很少被使" "用,也沒有經過測試。它最初計劃在 Python 3.6 中刪除,但此類別的刪除被推遲到 " "Python 2.7 EOL 之後。現有使用者應該將他們使用的任何類別複製到他們的程式碼中。" -"(由 Dong-hee Na 和 Terry J. Reedy 在 :issue:`42299` 中貢獻。)" +"(由 Donghee Na 和 Terry J. Reedy 在 :issue:`42299` 中貢獻。)" #: ../../whatsnew/3.10.rst:1822 msgid "" @@ -3429,7 +3427,7 @@ msgid "" "slot. (Contributed by Hai Shi in :issue:`41832`.)" msgstr "" ":c:func:`PyType_FromModuleAndSpec` 函式現在接受 NULL ``tp_doc`` 槽位。(由 " -"Hai Shi在 :issue:`41832` 中貢獻。)" +"Hai Shi 在 :issue:`41832` 中貢獻。)" #: ../../whatsnew/3.10.rst:2087 msgid "" diff --git a/whatsnew/3.11.po b/whatsnew/3.11.po index 8f1f96a9a8..32a6ae6486 100644 --- a/whatsnew/3.11.po +++ b/whatsnew/3.11.po @@ -1,4 +1,3 @@ -# SOME DESCRIPTIVE TITLE. # Copyright (C) 2001-2023, Python Software Foundation # This file is distributed under the same license as the Python package. # Translators: @@ -8,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-24 00:03+0000\n" +"POT-Creation-Date: 2023-10-11 17:13+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-" @@ -33,12 +32,12 @@ msgstr "Pablo Galindo Salgado" #: ../../whatsnew/3.11.rst:47 msgid "" -"This article explains the new features in Python 3.11, compared to 3.10." -msgstr "此文章解釋了 Python 3.11 和 3.10 相比多了哪些新特性。" - -#: ../../whatsnew/3.11.rst:49 -msgid "For full details, see the :ref:`changelog `." -msgstr "若想了解完整細節,請見\\ :ref:`更動日誌 `。" +"This article explains the new features in Python 3.11, compared to 3.10. " +"Python 3.11 was released on October 24, 2022. For full details, see the :ref:" +"`changelog `." +msgstr "" +"此文章解釋了 Python 3.11 和 3.10 相比多了哪些新特性。Python 3.11 於 2022 年 " +"10 月 24 日發布。完整細節請見 :ref:`changelog`。" #: ../../whatsnew/3.11.rst:55 msgid "Summary -- Release highlights" @@ -285,14 +284,15 @@ msgstr "Windows ``py.exe`` 啟動程式 (launcher) 的改進" msgid "" "The copy of the :ref:`launcher` included with Python 3.11 has been " "significantly updated. It now supports company/tag syntax as defined in :pep:" -"`514` using the ``-V:/`` argument instead of the limited ``-" -".``. This allows launching distributions other than " -"``PythonCore``, the one hosted on `python.org `_." +"`514` using the :samp:`-V:{}/{}` argument instead of the " +"limited :samp:`-{}.{}`. This allows launching distributions " +"other than ``PythonCore``, the one hosted on `python.org `_." msgstr "" "Python 3.11 所包含的 :ref:`launcher` 複製品有了顯著的改善。它現在支援 :pep:" -"`514` 所定義的公司/標籤 (tag) 語法,可用 ``-V:/`` 引數來取代受" -"限的 ``-.``。這允許了 `python.org `_ 上" -"的 ``PythonCore`` 以外的發行版本發布。" +"`514` 所定義的公司/標籤 (tag) 語法,可用 :samp:`-V:{}/{}` 引數" +"來取代受限的 :samp:`-{}.{}`。這允許了 `python.org `_ 上的 ``PythonCore`` 以外的發行版本發布。" #: ../../whatsnew/3.11.rst:225 msgid "" @@ -307,21 +307,22 @@ msgstr "" #: ../../whatsnew/3.11.rst:230 msgid "" -"When using the legacy ``-``, ``-.``, ``--" -"`` or ``-.-`` arguments, all existing " -"behaviour should be preserved from past versions, and only releases from " -"``PythonCore`` will be selected. However, the ``-64`` suffix now implies " -"\"not 32-bit\" (not necessarily x86-64), as there are multiple supported 64-" -"bit platforms. 32-bit runtimes are detected by checking the runtime's tag " -"for a ``-32`` suffix. All releases of Python since 3.5 have included this in " -"their 32-bit builds." -msgstr "" -"當使用遺留的 ``-``、``-.``、``--`` 或 " -"``-.-`` 引數時,所有過去版本的行為都應該保留下來,且只" -"有 ``PythonCore`` 中的發布版本會被選用。然而,``-64`` 後綴現在暗示了「非 32-" -"bit」(不用一定要是 x86-64),因為現在有多個支援 64-bit 的平台。32-bit 運行程" -"式會在檢查運行程式之標籤是否帶有 ``-32`` 後綴時被偵測出來。所有 Python 3.5 以" -"後發布版本的 32-bit 建置中都有這個行為。" +"When using the legacy :samp:`-{}`, :samp:`-{}.{}`, :" +"samp:`-{}-{}` or :samp:`-{}.{}-{}` " +"arguments, all existing behaviour should be preserved from past versions, " +"and only releases from ``PythonCore`` will be selected. However, the ``-64`` " +"suffix now implies \"not 32-bit\" (not necessarily x86-64), as there are " +"multiple supported 64-bit platforms. 32-bit runtimes are detected by " +"checking the runtime's tag for a ``-32`` suffix. All releases of Python " +"since 3.5 have included this in their 32-bit builds." +msgstr "" +"當使用遺留的 :samp:`-{}`、:samp:`-{}.{}`、:samp:`-" +"{}-{}` 或 :samp:`-{}.{}-{}` 引數時,所" +"有過去版本的行為都應該保留下來,且只有 ``PythonCore`` 中的發布版本會被選用。" +"然而,``-64`` 後綴現在暗示了「非 32-bit」(不用一定要是 x86-64),因為現在有" +"多個支援 64-bit 的平台。32-bit 運行程式會在檢查運行程式之標籤是否帶有 " +"``-32`` 後綴時被偵測出來。所有 Python 3.5 以後發布版本的 32-bit 建置中都有這" +"個行為。" #: ../../whatsnew/3.11.rst:244 msgid "New Features Related to Type Hints" @@ -669,12 +670,12 @@ msgid "" "The special methods :meth:`~object.__complex__` for :class:`complex` and :" "meth:`~object.__bytes__` for :class:`bytes` are implemented to support the :" "class:`typing.SupportsComplex` and :class:`typing.SupportsBytes` protocols. " -"(Contributed by Mark Dickinson and Dong-hee Na in :issue:`24234`.)" +"(Contributed by Mark Dickinson and Donghee Na in :issue:`24234`.)" msgstr "" "為支援 :class:`typing.SupportsComplex` 與 :class:`typing.SupportsBytes` 協" "定,實作了 :class:`complex` 與 :class:`bytes` 的特殊方法 :meth:`~object." -"__complex__` 與 :meth:`~object.__bytes__`。(由 Mark Dickinson 和 Dong-hee " -"Na 於 :issue:`24234` 中所貢獻。)" +"__complex__` 與 :meth:`~object.__bytes__`。(由 Mark Dickinson 和 Donghee Na " +"於 :issue:`24234` 中所貢獻。)" #: ../../whatsnew/3.11.rst:504 msgid "" @@ -1331,11 +1332,11 @@ msgstr "os" #: ../../whatsnew/3.11.rst:898 msgid "" "On Windows, :func:`os.urandom` now uses ``BCryptGenRandom()``, instead of " -"``CryptGenRandom()`` which is deprecated. (Contributed by Dong-hee Na in :" +"``CryptGenRandom()`` which is deprecated. (Contributed by Donghee Na in :" "issue:`44611`.)" msgstr "" "在 Windows 上,:func:`os.urandom` 現在使用 ``BCryptGenRandom()`` 以取代被棄用" -"的 ``CryptGenRandom()``。(由 Dong-hee Na 於 :issue:`44611` 中所貢獻。)" +"的 ``CryptGenRandom()``。(由 Donghee Na 於 :issue:`44611` 中所貢獻。)" #: ../../whatsnew/3.11.rst:906 msgid "pathlib" @@ -1648,14 +1649,15 @@ msgid "" "on `high-resolution timers `_ which has a resolution of " "100 nanoseconds (10\\ :sup:`-7` seconds). Previously, it had a resolution of " -"1 millisecond (10\\ :sup:`-3` seconds). (Contributed by Benjamin Szőke, Dong-" -"hee Na, Eryk Sun and Victor Stinner in :issue:`21302` and :issue:`45429`.)" +"1 millisecond (10\\ :sup:`-3` seconds). (Contributed by Benjamin Szőke, " +"Donghee Na, Eryk Sun and Victor Stinner in :issue:`21302` and :issue:" +"`45429`.)" msgstr "" "在 Windows 8.1 或更新的平台上,:func:`time.sleep` 現在使用了一個基於\\ `高解" "析度計時器 `_\\ 的可等待 (waitable) 計時器,解析度為 100 奈秒" "(即 10\\ :sup:`-7` 秒)。在這之前,它只有 1 微秒(10\\ :sup:`-3` 秒) 的解析" -"度。(由 Benjamin Szőke、Dong-hee Na、Eryk Sun 和 Victor Stinner 於 :issue:" +"度。(由 Benjamin Szőke、Donghee Na、Eryk Sun 和 Victor Stinner 於 :issue:" "`21302` 與 :issue:`45429` 中貢獻。)" #: ../../whatsnew/3.11.rst:1098 @@ -2043,10 +2045,10 @@ msgstr "" #: ../../whatsnew/3.11.rst:1306 msgid "" ":func:`unicodedata.normalize` now normalizes pure-ASCII strings in constant " -"time. (Contributed by Dong-hee Na in :issue:`44987`.)" +"time. (Contributed by Donghee Na in :issue:`44987`.)" msgstr "" ":func:`unicodedata.normalize` 現在在常數時間內規範化 (normalize) 純 ASCII 字" -"串。(由 Dong-hee Na 在 :issue:`44987` 中貢獻。)" +"串。(由 Donghee Na 在 :issue:`44987` 中貢獻。)" #: ../../whatsnew/3.11.rst:1314 msgid "Faster CPython" @@ -2324,8 +2326,8 @@ msgid "10%" msgstr "10%" #: ../../whatsnew/3.11.rst:1454 -msgid "Mark Shannon, Dong-hee Na, Brandt Bucher, Dennis Sweeney" -msgstr "Mark Shannon, Dong-hee Na, Brandt Bucher, Dennis Sweeney" +msgid "Mark Shannon, Donghee Na, Brandt Bucher, Dennis Sweeney" +msgstr "Mark Shannon, Donghee Na, Brandt Bucher, Dennis Sweeney" #: ../../whatsnew/3.11.rst:1460 msgid "Subscript" @@ -2577,7 +2579,7 @@ msgid "" msgstr "" ":mod:`re` 的正則表達式比對引擎部分被重構,且現在會有支援的平台上使用 " "computed gotos(或者「執行緒程式碼 (threaded code)」),因此 Python 3.11 在執" -"行 `pyperformance正則表達式基準量測 `_\\ 的表現上比起 Python 3.10 快了 10%。(由 " "Brandt Bucher 於 :gh:`91404` 中貢獻。)" @@ -3285,10 +3287,10 @@ msgstr "" msgid "" ":class:`!webbrowser.MacOSX` is deprecated and will be removed in Python " "3.13. It is untested, undocumented, and not used by :mod:`webbrowser` " -"itself. (Contributed by Dong-hee Na in :issue:`42255`.)" +"itself. (Contributed by Donghee Na in :issue:`42255`.)" msgstr "" ":class:`!webbrowser.MacOSX` 已被棄用且將於 Python 3.13 中移除。它並沒有被測試" -"過、沒紀錄於文件、也沒有被 :mod:`webbrowser` 本身使用。(由 Dong-hee Na 於 :" +"過、沒紀錄於文件、也沒有被 :mod:`webbrowser` 本身使用。(由 Donghee Na 於 :" "issue:`42255`。)" #: ../../whatsnew/3.11.rst:1844 @@ -3727,14 +3729,14 @@ msgid "" "output_charset` and :meth:`!NullTranslations.set_output_charset` methods, " "and the *codeset* parameter of :func:`!translation` and :func:`!install`, " "since they are only used for the :func:`!l*gettext` functions. (Contributed " -"by Dong-hee Na and Serhiy Storchaka in :issue:`44235`.)" +"by Donghee Na and Serhiy Storchaka in :issue:`44235`.)" msgstr "" "刪除了已棄用的 :mod:`gettext` 函式 :func:`!lgettext`、:func:`!ldgettext`、:" "func:`!lngettext` 和 :func:`!ldngettext`,也刪除了 :func:`!" "bind_textdomain_codeset` 函式、:meth:`!NullTranslations.output_charset` 和 :" "meth:`!NullTranslations.set_output_charset` 方法,以及 :func:`!translation` " "和 :func:`!install` 的 *codeset* 參數,因為它們僅被用於 :func:`!l*gettext` 函" -"式。 (由 Dong-hee Na 和 Serhiy Storchaka 在 :issue:`44235` 中貢獻。)" +"式。 (由 Donghee Na 和 Serhiy Storchaka 在 :issue:`44235` 中貢獻。)" #: ../../whatsnew/3.11.rst:1989 msgid "Removed from the :mod:`inspect` module:" @@ -3785,10 +3787,10 @@ msgstr "" msgid "" "Removed the :class:`!MailmanProxy` class in the :mod:`smtpd` module, as it " "is unusable without the external :mod:`!mailman` package. (Contributed by " -"Dong-hee Na in :issue:`35800`.)" +"Donghee Na in :issue:`35800`.)" msgstr "" "移除 :mod:`smtpd` 模組中的 :class:`!MailmanProxy` 類別,因為它無法獨立於外部" -"套件 :mod:`!mailman` 使用。(由 Dong-hee Na 於 :issue:`35800` 貢獻。)" +"套件 :mod:`!mailman` 使用。(由 Donghee Na 於 :issue:`35800` 貢獻。)" #: ../../whatsnew/3.11.rst:2014 msgid "" @@ -4062,12 +4064,12 @@ msgstr "" msgid "" "CPython can now be built with the `ThinLTO `_ option via passing ``thin`` to :option:`--with-lto`, i.e. " -"``--with-lto=thin``. (Contributed by Dong-hee Na and Brett Holman in :issue:" +"``--with-lto=thin``. (Contributed by Donghee Na and Brett Holman in :issue:" "`44340`.)" msgstr "" "CPython 現在可以透過將 ``thin`` 傳遞給 :option:`--with-lto`\\ (也就是 ``--" "with-lto=thin``\\ )來以 `ThinLTO `_ 選項建置。(由 Dong-hee Na 與 Brett Holman 於 :issue:`44340` 中所貢" +"html>`_ 選項建置。(由 Donghee Na 與 Brett Holman 於 :issue:`44340` 中所貢" "獻。)" #: ../../whatsnew/3.11.rst:2156 @@ -5146,102 +5148,3 @@ msgid "" msgstr "" "詳情請見 :pep:`624` 與\\ :pep:`搬遷指南 <624#alternative-apis>`。(由 Inada " "Naoki 於 :issue:`44029` 中所貢獻。)" - -#~ msgid "" -#~ "Added :meth:`object.__getstate__`, which provides the default " -#~ "implementation of the :meth:`!__getstate__` method. :mod:`copy`\\ing and :" -#~ "mod:`pickle`\\ing instances of subclasses of builtin types :class:" -#~ "`bytearray`, :class:`set`, :class:`frozenset`, :class:`collections." -#~ "OrderedDict`, :class:`collections.deque`, :class:`weakref.WeakSet`, and :" -#~ "class:`datetime.tzinfo` now copies and pickles instance attributes " -#~ "implemented as :term:`slots <__slots__>`. (Contributed by Serhiy " -#~ "Storchaka in :issue:`26579`.)" -#~ msgstr "" -#~ "添加了 :meth:`object.__getstate__`,它提供 :meth:`!__getstate__` 方法的預" -#~ "設實作。內建型別 :class:`bytearray`、:class:`set`、:class:`frozenset`、:" -#~ "class:`collections.OrderedDict`、:class:`collections.deque`、:class:" -#~ "`weakref.WeakSet` 和 :class:`datetime.tzinfo` 的 :mod:`copy` 和 :mod:" -#~ "`pickle` 實例,現在會以 :term:`slots <__slots__>` 形式複製和 pickle 實例屬" -#~ "性。 (由 Serhiy Storchaka 在 :issue:`26579` 中貢獻。)" - -#~ msgid ":c:func:`PyBuffer_CopyData`" -#~ msgstr ":c:func:`PyBuffer_CopyData`" - -#~ msgid ":c:func:`PySys_AddWarnOptionUnicode`" -#~ msgstr ":c:func:`PySys_AddWarnOptionUnicode`" - -#~ msgid ":c:func:`PySys_AddWarnOption`" -#~ msgstr ":c:func:`PySys_AddWarnOption`" - -#~ msgid ":c:func:`PySys_AddXOption`" -#~ msgstr ":c:func:`PySys_AddXOption`" - -#~ msgid ":c:func:`PySys_HasWarnOptions`" -#~ msgstr ":c:func:`PySys_HasWarnOptions`" - -#~ msgid ":c:func:`PySys_SetArgvEx`" -#~ msgstr ":c:func:`PySys_SetArgvEx`" - -#~ msgid ":c:func:`PySys_SetArgv`" -#~ msgstr ":c:func:`PySys_SetArgv`" - -#~ msgid ":c:func:`PySys_SetPath`" -#~ msgstr ":c:func:`PySys_SetPath`" - -#~ msgid ":c:func:`Py_SetPath`" -#~ msgstr ":c:func:`Py_SetPath`" - -#~ msgid ":c:func:`Py_SetProgramName`" -#~ msgstr ":c:func:`Py_SetProgramName`" - -#~ msgid ":c:func:`Py_SetPythonHome`" -#~ msgstr ":c:func:`Py_SetPythonHome`" - -#~ msgid ":c:func:`Py_SetStandardStreamEncoding`" -#~ msgstr ":c:func:`Py_SetStandardStreamEncoding`" - -#~ msgid ":c:func:`_Py_SetProgramFullPath`" -#~ msgstr ":c:func:`_Py_SetProgramFullPath`" - -#~ msgid ":c:func:`PyUnicode_AS_DATA`" -#~ msgstr ":c:func:`PyUnicode_AS_DATA`" - -#~ msgid ":c:func:`PyUnicode_AS_UNICODE`" -#~ msgstr ":c:func:`PyUnicode_AS_UNICODE`" - -#~ msgid ":c:func:`PyUnicode_AsUnicodeAndSize`" -#~ msgstr ":c:func:`PyUnicode_AsUnicodeAndSize`" - -#~ msgid ":c:func:`PyUnicode_AsUnicode`" -#~ msgstr ":c:func:`PyUnicode_AsUnicode`" - -#~ msgid ":c:func:`PyUnicode_FromUnicode`" -#~ msgstr ":c:func:`PyUnicode_FromUnicode`" - -#~ msgid ":c:func:`PyUnicode_GET_DATA_SIZE`" -#~ msgstr ":c:func:`PyUnicode_GET_DATA_SIZE`" - -#~ msgid ":c:func:`PyUnicode_GET_SIZE`" -#~ msgstr ":c:func:`PyUnicode_GET_SIZE`" - -#~ msgid ":c:func:`PyUnicode_GetSize`" -#~ msgstr ":c:func:`PyUnicode_GetSize`" - -#~ msgid ":c:func:`Py_UNICODE_WSTR_LENGTH`" -#~ msgstr ":c:func:`Py_UNICODE_WSTR_LENGTH`" - -#~ msgid ":c:func:`_PyUnicode_AsUnicode`" -#~ msgstr ":c:func:`_PyUnicode_AsUnicode`" - -#~ msgid ":c:macro:`PyUnicode_WCHAR_KIND`" -#~ msgstr ":c:macro:`PyUnicode_WCHAR_KIND`" - -#~ msgid ":c:func:`PyUnicode_InternImmortal()`" -#~ msgstr ":c:func:`PyUnicode_InternImmortal()`" - -#~ msgid "" -#~ ":c:func:`PyFrame_BlockSetup` and :c:func:`PyFrame_BlockPop` have been " -#~ "removed. (Contributed by Mark Shannon in :issue:`40222`.)" -#~ msgstr "" -#~ "移除 :c:func:`PyFrame_BlockSetup` 和 :c:func:`PyFrame_BlockPop`。(由 " -#~ "Mark Shannon 於 :issue:`40222` 中所貢獻。)" diff --git a/whatsnew/3.12.po b/whatsnew/3.12.po index 0d4fc1eb05..caf6dee4a5 100644 --- a/whatsnew/3.12.po +++ b/whatsnew/3.12.po @@ -1,4 +1,3 @@ -# SOME DESCRIPTIVE TITLE. # Copyright (C) 2001-2023, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. @@ -8,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-09-13 00:03+0000\n" +"POT-Creation-Date: 2023-10-11 17:13+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -22,157 +21,339 @@ msgid "What's New In Python 3.12" msgstr "Python 3.12 有什麼新功能" #: ../../whatsnew/3.12.rst:0 -msgid "Release" -msgstr "發行版本" +msgid "Editor" +msgstr "編輯者" #: ../../whatsnew/3.12.rst:6 -msgid "|release|" -msgstr "|release|" +msgid "Adam Turner" +msgstr "Adam Turner" -#: ../../whatsnew/3.12.rst:0 -msgid "Date" -msgstr "日期" +#: ../../whatsnew/3.12.rst:48 +msgid "" +"This article explains the new features in Python 3.12, compared to 3.11. " +"Python 3.12 was released on October 2, 2023. For full details, see the :ref:" +"`changelog `." +msgstr "" -#: ../../whatsnew/3.12.rst:7 -msgid "|today|" -msgstr "|today|" +#: ../../whatsnew/3.12.rst:54 +msgid ":pep:`693` -- Python 3.12 Release Schedule" +msgstr ":pep:`693` -- Python 3.12 發佈時程" + +#: ../../whatsnew/3.12.rst:57 +msgid "Summary -- Release highlights" +msgstr "發布重點摘要" -#: ../../whatsnew/3.12.rst:49 +#: ../../whatsnew/3.12.rst:62 msgid "" -"This article explains the new features in Python 3.12, compared to 3.11." -msgstr "此文章解釋了 Python 3.12 和 3.11 相比多了哪些新特性。" +"Python 3.12 is the latest stable release of the Python programming language, " +"with a mix of changes to the language and the standard library. The library " +"changes focus on cleaning up deprecated APIs, usability, and correctness. Of " +"note, the :mod:`!distutils` package has been removed from the standard " +"library. Filesystem support in :mod:`os` and :mod:`pathlib` has seen a " +"number of improvements, and several modules have better performance." +msgstr "" -#: ../../whatsnew/3.12.rst:51 -msgid "For full details, see the :ref:`changelog `." -msgstr "若想了解完整細節,請見\\ :ref:`更動日誌 `。" +#: ../../whatsnew/3.12.rst:69 +msgid "" +"The language changes focus on usability, as :term:`f-strings ` " +"have had many limitations removed and 'Did you mean ...' suggestions " +"continue to improve. The new :ref:`type parameter syntax ` and :keyword:`type` statement improve ergonomics for using :term:" +"`generic types ` and :term:`type aliases ` with " +"static type checkers." +msgstr "" -#: ../../whatsnew/3.12.rst:55 +#: ../../whatsnew/3.12.rst:76 msgid "" -"Prerelease users should be aware that this document is currently in draft " -"form. It will be updated substantially as Python 3.12 moves towards release, " -"so it's worth checking back even after reading earlier versions." +"This article doesn't attempt to provide a complete specification of all new " +"features, but instead gives a convenient overview. For full details, you " +"should refer to the documentation, such as the :ref:`Library Reference " +"` and :ref:`Language Reference `. If you " +"want to understand the complete implementation and design rationale for a " +"change, refer to the PEP for a particular new feature; but note that PEPs " +"usually are not kept up-to-date once a feature has been fully implemented." msgstr "" -#: ../../whatsnew/3.12.rst:61 -msgid "Summary -- Release highlights" -msgstr "發布重點摘要" +#: ../../whatsnew/3.12.rst:90 +msgid "New syntax features:" +msgstr "" -#: ../../whatsnew/3.12.rst:69 +#: ../../whatsnew/3.12.rst:92 +msgid "" +":ref:`PEP 695 `, type parameter syntax and the :keyword:" +"`type` statement" +msgstr "" + +#: ../../whatsnew/3.12.rst:94 msgid "New grammar features:" msgstr "新增語法特性:" -#: ../../whatsnew/3.12.rst:71 -msgid ":ref:`whatsnew312-pep701`" -msgstr ":ref:`whatsnew312-pep701`" +#: ../../whatsnew/3.12.rst:96 +msgid "" +":ref:`PEP 701 `, :term:`f-strings ` in the " +"grammar" +msgstr "" -#: ../../whatsnew/3.12.rst:73 +#: ../../whatsnew/3.12.rst:98 msgid "Interpreter improvements:" msgstr "" -#: ../../whatsnew/3.12.rst:75 -msgid ":ref:`whatsnew312-pep684`" -msgstr ":ref:`whatsnew312-pep684`" +#: ../../whatsnew/3.12.rst:100 +msgid "" +":ref:`PEP 684 `, a unique per-interpreter :term:`GIL " +"`" +msgstr "" -#: ../../whatsnew/3.12.rst:77 -msgid ":ref:`whatsnew312-pep669`" -msgstr ":ref:`whatsnew312-pep669`" +#: ../../whatsnew/3.12.rst:102 +msgid ":ref:`PEP 669 `, low impact monitoring" +msgstr "" -#: ../../whatsnew/3.12.rst:79 -msgid "New typing features:" -msgstr "新增型別特性:" +#: ../../whatsnew/3.12.rst:103 +msgid "" +"`Improved 'Did you mean ...' suggestions `_ for :" +"exc:`NameError`, :exc:`ImportError`, and :exc:`SyntaxError` exceptions" +msgstr "" -#: ../../whatsnew/3.12.rst:81 -msgid ":ref:`whatsnew312-pep688`" -msgstr ":ref:`whatsnew312-pep688`" +#: ../../whatsnew/3.12.rst:106 +msgid "Python data model improvements:" +msgstr "" -#: ../../whatsnew/3.12.rst:83 -msgid ":ref:`whatsnew312-pep692`" -msgstr ":ref:`whatsnew312-pep692`" +#: ../../whatsnew/3.12.rst:108 +msgid "" +":ref:`PEP 688 `, using the :ref:`buffer protocol " +"` from Python" +msgstr "" -#: ../../whatsnew/3.12.rst:85 -msgid ":ref:`whatsnew312-pep695`" -msgstr ":ref:`whatsnew312-pep695`" +#: ../../whatsnew/3.12.rst:111 +msgid "Significant improvements in the standard library:" +msgstr "" -#: ../../whatsnew/3.12.rst:87 -msgid ":ref:`whatsnew312-pep698`" -msgstr ":ref:`whatsnew312-pep698`" +#: ../../whatsnew/3.12.rst:113 +msgid "The :class:`pathlib.Path` class now supports subclassing" +msgstr "" -#: ../../whatsnew/3.12.rst:89 -msgid "Important deprecations, removals or restrictions:" +#: ../../whatsnew/3.12.rst:114 +msgid "The :mod:`os` module received several improvements for Windows support" msgstr "" -#: ../../whatsnew/3.12.rst:91 -msgid ":pep:`623`: Remove wstr from Unicode" +#: ../../whatsnew/3.12.rst:115 +msgid "" +"A :ref:`command-line interface ` has been added to the :mod:" +"`sqlite3` module" msgstr "" -#: ../../whatsnew/3.12.rst:93 +#: ../../whatsnew/3.12.rst:117 msgid "" -":pep:`632`: Remove the ``distutils`` package. See `the migration guide " -"`_ for advice on its " -"replacement." +":func:`isinstance` checks against :func:`runtime-checkable protocols ` enjoy a speed up of between two and 20 times" msgstr "" -#: ../../whatsnew/3.12.rst:98 -msgid "Improved Error Messages" +#: ../../whatsnew/3.12.rst:119 +msgid "" +"The :mod:`asyncio` package has had a number of performance improvements, " +"with some benchmarks showing a 75% speed up." msgstr "" -#: ../../whatsnew/3.12.rst:100 +#: ../../whatsnew/3.12.rst:121 msgid "" -"Modules from the standard library are now potentially suggested as part of " -"the error messages displayed by the interpreter when a :exc:`NameError` is " -"raised to the top level. Contributed by Pablo Galindo in :gh:`98254`." +"A :ref:`command-line interface ` has been added to the :mod:`uuid` " +"module" msgstr "" -#: ../../whatsnew/3.12.rst:109 +#: ../../whatsnew/3.12.rst:123 msgid "" -"Improve the error suggestion for :exc:`NameError` exceptions for instances. " -"Now if a :exc:`NameError` is raised in a method and the instance has an " -"attribute that's exactly equal to the name in the exception, the suggestion " -"will include ``self.`` instead of the closest match in the method " -"scope. Contributed by Pablo Galindo in :gh:`99139`." +"Due to the changes in :ref:`PEP 701 `, producing tokens " +"via the :mod:`tokenize` module is up to 64% faster." +msgstr "" + +#: ../../whatsnew/3.12.rst:126 +msgid "Security improvements:" msgstr "" -#: ../../whatsnew/3.12.rst:130 +#: ../../whatsnew/3.12.rst:128 msgid "" -"Improve the :exc:`SyntaxError` error message when the user types ``import x " -"from y`` instead of ``from y import x``. Contributed by Pablo Galindo in :gh:" -"`98931`." +"Replace the builtin :mod:`hashlib` implementations of SHA1, SHA3, SHA2-384, " +"SHA2-512, and MD5 with formally verified code from the `HACL* `__ project. These builtin implementations " +"remain as fallbacks that are only used when OpenSSL does not provide them." +msgstr "" + +#: ../../whatsnew/3.12.rst:134 +msgid "C API improvements:" +msgstr "" + +#: ../../whatsnew/3.12.rst:136 +msgid ":ref:`PEP 697 `, unstable C API tier" +msgstr "" + +#: ../../whatsnew/3.12.rst:137 +msgid ":ref:`PEP 683 `, immortal objects" msgstr "" -#: ../../whatsnew/3.12.rst:140 +#: ../../whatsnew/3.12.rst:139 +msgid "CPython implementation improvements:" +msgstr "" + +#: ../../whatsnew/3.12.rst:141 +msgid ":ref:`PEP 709 `, comprehension inlining" +msgstr "" + +#: ../../whatsnew/3.12.rst:142 +msgid ":ref:`CPython support ` for the Linux ``perf`` profiler" +msgstr "" + +#: ../../whatsnew/3.12.rst:143 +msgid "Implement stack overflow protection on supported platforms" +msgstr "" + +#: ../../whatsnew/3.12.rst:145 +msgid "New typing features:" +msgstr "新增型別特性:" + +#: ../../whatsnew/3.12.rst:147 msgid "" -":exc:`ImportError` exceptions raised from failed ``from import " -"`` statements now include suggestions for the value of ```` " -"based on the available names in ````. Contributed by Pablo Galindo " -"in :gh:`91058`." +":ref:`PEP 692 `, using :class:`~typing.TypedDict` to " +"annotate :term:`**kwargs `" +msgstr "" + +#: ../../whatsnew/3.12.rst:149 +msgid ":ref:`PEP 698 `, :func:`typing.override` decorator" +msgstr "" + +#: ../../whatsnew/3.12.rst:151 +msgid "Important deprecations, removals or restrictions:" +msgstr "" + +#: ../../whatsnew/3.12.rst:153 +msgid "" +":pep:`623`: Remove ``wstr`` from Unicode objects in Python's C API, reducing " +"the size of every :class:`str` object by at least 8 bytes." +msgstr "" + +#: ../../whatsnew/3.12.rst:156 +msgid "" +":pep:`632`: Remove the :mod:`!distutils` package. See `the migration guide " +"`_ for advice replacing " +"the APIs it provided. The third-party `Setuptools `__ package continues to " +"provide :mod:`!distutils`, if you still require it in Python 3.12 and beyond." +msgstr "" + +#: ../../whatsnew/3.12.rst:163 +msgid "" +":gh:`95299`: Do not pre-install ``setuptools`` in virtual environments " +"created with :mod:`venv`. This means that ``distutils``, ``setuptools``, " +"``pkg_resources``, and ``easy_install`` will no longer available by default; " +"to access these run ``pip install setuptools`` in the :ref:`activated ` virtual environment." msgstr "" -#: ../../whatsnew/3.12.rst:151 ../../whatsnew/3.12.rst:1739 +#: ../../whatsnew/3.12.rst:170 +msgid "" +"The :mod:`!asynchat`, :mod:`!asyncore`, and :mod:`!imp` modules have been " +"removed, along with several :class:`unittest.TestCase` `method aliases " +"`_." +msgstr "" + +#: ../../whatsnew/3.12.rst:176 ../../whatsnew/3.12.rst:1917 msgid "New Features" msgstr "新增特性" -#: ../../whatsnew/3.12.rst:156 +#: ../../whatsnew/3.12.rst:181 +msgid "PEP 695: Type Parameter Syntax" +msgstr "" + +#: ../../whatsnew/3.12.rst:183 +msgid "" +"Generic classes and functions under :pep:`484` were declared using a verbose " +"syntax that left the scope of type parameters unclear and required explicit " +"declarations of variance." +msgstr "" + +#: ../../whatsnew/3.12.rst:187 +msgid "" +":pep:`695` introduces a new, more compact and explicit way to create :ref:" +"`generic classes ` and :ref:`functions `::" +msgstr "" + +#: ../../whatsnew/3.12.rst:200 +msgid "" +"In addition, the PEP introduces a new way to declare :ref:`type aliases " +"` using the :keyword:`type` statement, which creates an " +"instance of :class:`~typing.TypeAliasType`::" +msgstr "" + +#: ../../whatsnew/3.12.rst:206 +msgid "Type aliases can also be :ref:`generic `::" +msgstr "" + +#: ../../whatsnew/3.12.rst:210 +msgid "" +"The new syntax allows declaring :class:`~typing.TypeVarTuple` and :class:" +"`~typing.ParamSpec` parameters, as well as :class:`~typing.TypeVar` " +"parameters with bounds or constraints::" +msgstr "" + +#: ../../whatsnew/3.12.rst:219 +msgid "" +"The value of type aliases and the bound and constraints of type variables " +"created through this syntax are evaluated only on demand (see :ref:`lazy " +"evaluation `). This means type aliases are able to refer to " +"other types defined later in the file." +msgstr "" + +#: ../../whatsnew/3.12.rst:224 +msgid "" +"Type parameters declared through a type parameter list are visible within " +"the scope of the declaration and any nested scopes, but not in the outer " +"scope. For example, they can be used in the type annotations for the methods " +"of a generic class or in the class body. However, they cannot be used in the " +"module scope after the class is defined. See :ref:`type-params` for a " +"detailed description of the runtime semantics of type parameters." +msgstr "" + +#: ../../whatsnew/3.12.rst:231 +msgid "" +"In order to support these scoping semantics, a new kind of scope is " +"introduced, the :ref:`annotation scope `. Annotation " +"scopes behave for the most part like function scopes, but interact " +"differently with enclosing class scopes. In Python 3.13, :term:`annotations " +"` will also be evaluated in annotation scopes." +msgstr "" + +#: ../../whatsnew/3.12.rst:237 +msgid "See :pep:`695` for more details." +msgstr "詳情請見 :pep:`695`。" + +#: ../../whatsnew/3.12.rst:239 +msgid "" +"(PEP written by Eric Traut. Implementation by Jelle Zijlstra, Eric Traut, " +"and others in :gh:`103764`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:245 msgid "PEP 701: Syntactic formalization of f-strings" msgstr "" -#: ../../whatsnew/3.12.rst:158 +#: ../../whatsnew/3.12.rst:247 msgid "" -":pep:`701` lifts some restrictions on the usage of f-strings. Expression " -"components inside f-strings can now be any valid Python expression including " -"backslashes, unicode escaped sequences, multi-line expressions, comments and " -"strings reusing the same quote as the containing f-string. Let's cover these " -"in detail:" +":pep:`701` lifts some restrictions on the usage of :term:`f-strings `. Expression components inside f-strings can now be any valid Python " +"expression, including strings reusing the same quote as the containing f-" +"string, multi-line expressions, comments, backslashes, and unicode escape " +"sequences. Let's cover these in detail:" msgstr "" -#: ../../whatsnew/3.12.rst:163 +#: ../../whatsnew/3.12.rst:253 msgid "" -"Quote reuse: in Python 3.11, reusing the same quotes as the containing f-" +"Quote reuse: in Python 3.11, reusing the same quotes as the enclosing f-" "string raises a :exc:`SyntaxError`, forcing the user to either use other " "available quotes (like using double quotes or triple quotes if the f-string " "uses single quotes). In Python 3.12, you can now do things like this:" msgstr "" -#: ../../whatsnew/3.12.rst:172 +#: ../../whatsnew/3.12.rst:262 msgid "" "Note that before this change there was no explicit limit in how f-strings " "can be nested, but the fact that string quotes cannot be reused inside the " @@ -180,44 +361,43 @@ msgid "" "arbitrarily. In fact, this is the most nested f-string that could be written:" msgstr "" -#: ../../whatsnew/3.12.rst:180 +#: ../../whatsnew/3.12.rst:270 msgid "" "As now f-strings can contain any valid Python expression inside expression " "components, it is now possible to nest f-strings arbitrarily:" msgstr "" -#: ../../whatsnew/3.12.rst:186 +#: ../../whatsnew/3.12.rst:276 msgid "" -"Multi-line expressions and comments: In Python 3.11, f-strings expressions " -"must be defined in a single line even if outside f-strings expressions could " -"span multiple lines (like literal lists being defined over multiple lines), " -"making them harder to read. In Python 3.12 you can now define expressions " -"spanning multiple lines and include comments on them:" +"Multi-line expressions and comments: In Python 3.11, f-string expressions " +"must be defined in a single line, even if the expression within the f-string " +"could normally span multiple lines (like literal lists being defined over " +"multiple lines), making them harder to read. In Python 3.12 you can now " +"define f-strings spanning multiple lines, and add inline comments:" msgstr "" -#: ../../whatsnew/3.12.rst:199 +#: ../../whatsnew/3.12.rst:290 msgid "" "Backslashes and unicode characters: before Python 3.12 f-string expressions " -"couldn't contain any ``\\`` character. This also affected unicode escaped " -"sequences (such as ``\\N{snowman}``) as these contain the ``\\N`` part that " -"previously could not be part of expression components of f-strings. Now, you " -"can define expressions like this:" +"couldn't contain any ``\\`` character. This also affected unicode :ref:" +"`escape sequences ` (such as ``\\N{snowman}``) as these " +"contain the ``\\N`` part that previously could not be part of expression " +"components of f-strings. Now, you can define expressions like this:" msgstr "" -#: ../../whatsnew/3.12.rst:212 +#: ../../whatsnew/3.12.rst:303 msgid "See :pep:`701` for more details." msgstr "詳情請見 :pep:`701`。" -#: ../../whatsnew/3.12.rst:214 +#: ../../whatsnew/3.12.rst:305 msgid "" "As a positive side-effect of how this feature has been implemented (by " -"parsing f-strings with the PEG parser (see :pep:`617`), now error messages " -"for f-strings are more precise and include the exact location of the error. " -"For example, in Python 3.11, the following f-string raises a :exc:" -"`SyntaxError`:" +"parsing f-strings with :pep:`the PEG parser <617>`), now error messages for " +"f-strings are more precise and include the exact location of the error. For " +"example, in Python 3.11, the following f-string raises a :exc:`SyntaxError`:" msgstr "" -#: ../../whatsnew/3.12.rst:227 +#: ../../whatsnew/3.12.rst:318 msgid "" "but the error message doesn't include the exact location of the error within " "the line and also has the expression artificially surrounded by parentheses. " @@ -225,82 +405,72 @@ msgid "" "can be more precise and show the entire line:" msgstr "" -#: ../../whatsnew/3.12.rst:239 +#: ../../whatsnew/3.12.rst:330 msgid "" "(Contributed by Pablo Galindo, Batuhan Taskaya, Lysandros Nikolaou, Cristián " "Maureira-Fredes and Marta Gómez in :gh:`102856`. PEP written by Pablo " "Galindo, Batuhan Taskaya, Lysandros Nikolaou and Marta Gómez)." msgstr "" -#: ../../whatsnew/3.12.rst:246 -msgid "PEP 709: Comprehension inlining" +#: ../../whatsnew/3.12.rst:337 +msgid "PEP 684: A Per-Interpreter GIL" msgstr "" -#: ../../whatsnew/3.12.rst:248 +#: ../../whatsnew/3.12.rst:339 msgid "" -"Dictionary, list, and set comprehensions are now inlined, rather than " -"creating a new single-use function object for each execution of the " -"comprehension. This speeds up execution of a comprehension by up to 2x." +":pep:`684` introduces a per-interpreter :term:`GIL `, so that sub-interpreters may now be created with a unique GIL per " +"interpreter. This allows Python programs to take full advantage of multiple " +"CPU cores. This is currently only available through the C-API, though a " +"Python API is :pep:`anticipated for 3.13 <554>`." msgstr "" -#: ../../whatsnew/3.12.rst:252 +#: ../../whatsnew/3.12.rst:345 msgid "" -"Comprehension iteration variables remain isolated; they don't overwrite a " -"variable of the same name in the outer scope, nor are they visible after the " -"comprehension. This isolation is now maintained via stack/locals " -"manipulation, not via separate function scope." -msgstr "" - -#: ../../whatsnew/3.12.rst:257 -msgid "Inlining does result in a few visible behavior changes:" +"Use the new :c:func:`Py_NewInterpreterFromConfig` function to create an " +"interpreter with its own GIL::" msgstr "" -#: ../../whatsnew/3.12.rst:259 +#: ../../whatsnew/3.12.rst:359 msgid "" -"There is no longer a separate frame for the comprehension in tracebacks, and " -"tracing/profiling no longer shows the comprehension as a function call." +"For further examples how to use the C-API for sub-interpreters with a per-" +"interpreter GIL, see :source:`Modules/_xxsubinterpretersmodule.c`." msgstr "" -#: ../../whatsnew/3.12.rst:261 -msgid "" -"The :mod:`symtable` module will no longer produce child symbol tables for " -"each comprehension; instead, the comprehension's locals will be included in " -"the parent function's symbol table." -msgstr "" +#: ../../whatsnew/3.12.rst:362 +msgid "(Contributed by Eric Snow in :gh:`104210`, etc.)" +msgstr "(由 Eric Snow 於 :gh:`104210` 等貢獻。)" -#: ../../whatsnew/3.12.rst:264 -msgid "" -"Calling :func:`locals` inside a comprehension now includes variables from " -"outside the comprehension, and no longer includes the synthetic ``.0`` " -"variable for the comprehension \"argument\"." +#: ../../whatsnew/3.12.rst:367 +msgid "PEP 669: Low impact monitoring for CPython" msgstr "" -#: ../../whatsnew/3.12.rst:267 +#: ../../whatsnew/3.12.rst:369 msgid "" -"A comprehension iterating directly over ``locals()`` (e.g. ``[k for k in " -"locals()]``) may see \"RuntimeError: dictionary changed size during " -"iteration\" when run under tracing (e.g. code coverage measurement). This is " -"the same behavior already seen in e.g. ``for k in locals():``. To avoid the " -"error, first create a list of keys to iterate over: ``keys = list(locals()); " -"[k for k in keys]``." +":pep:`669` defines a new :mod:`API ` for profilers, " +"debuggers, and other tools to monitor events in CPython. It covers a wide " +"range of events, including calls, returns, lines, exceptions, jumps, and " +"more. This means that you only pay for what you use, providing support for " +"near-zero overhead debuggers and coverage tools. See :mod:`sys.monitoring` " +"for details." msgstr "" -#: ../../whatsnew/3.12.rst:274 -msgid "Contributed by Carl Meyer and Vladimir Matveev in :pep:`709`." +#: ../../whatsnew/3.12.rst:377 +msgid "(Contributed by Mark Shannon in :gh:`103082`.)" msgstr "" -#: ../../whatsnew/3.12.rst:279 +#: ../../whatsnew/3.12.rst:382 msgid "PEP 688: Making the buffer protocol accessible in Python" msgstr "" -#: ../../whatsnew/3.12.rst:281 +#: ../../whatsnew/3.12.rst:384 msgid "" ":pep:`688` introduces a way to use the :ref:`buffer protocol " "` from Python code. Classes that implement the :meth:`~object." "__buffer__` method are now usable as buffer types." msgstr "" -#: ../../whatsnew/3.12.rst:285 +#: ../../whatsnew/3.12.rst:388 msgid "" "The new :class:`collections.abc.Buffer` ABC provides a standard way to " "represent buffer objects, for example in type annotations. The new :class:" @@ -308,92 +478,134 @@ msgid "" "customize buffer creation. (Contributed by Jelle Zijlstra in :gh:`102500`.)" msgstr "" -#: ../../whatsnew/3.12.rst:294 -msgid "PEP 684: A Per-Interpreter GIL" +#: ../../whatsnew/3.12.rst:397 +msgid "PEP 709: Comprehension inlining" msgstr "" -#: ../../whatsnew/3.12.rst:296 +#: ../../whatsnew/3.12.rst:399 msgid "" -"Sub-interpreters may now be created with a unique GIL per interpreter. This " -"allows Python programs to take full advantage of multiple CPU cores." +"Dictionary, list, and set comprehensions are now inlined, rather than " +"creating a new single-use function object for each execution of the " +"comprehension. This speeds up execution of a comprehension by up to two " +"times. See :pep:`709` for further details." msgstr "" -#: ../../whatsnew/3.12.rst:300 +#: ../../whatsnew/3.12.rst:404 msgid "" -"Use the new :c:func:`Py_NewInterpreterFromConfig` function to create an " -"interpreter with its own GIL::" +"Comprehension iteration variables remain isolated and don't overwrite a " +"variable of the same name in the outer scope, nor are they visible after the " +"comprehension. Inlining does result in a few visible behavior changes:" msgstr "" -#: ../../whatsnew/3.12.rst:314 +#: ../../whatsnew/3.12.rst:408 msgid "" -"For further examples how to use the C-API for sub-interpreters with a per-" -"interpreter GIL, see :source:`Modules/_xxsubinterpretersmodule.c`." +"There is no longer a separate frame for the comprehension in tracebacks, and " +"tracing/profiling no longer shows the comprehension as a function call." msgstr "" -#: ../../whatsnew/3.12.rst:317 -msgid "A Python API is anticipated for 3.13. (See :pep:`554`.)" +#: ../../whatsnew/3.12.rst:410 +msgid "" +"The :mod:`symtable` module will no longer produce child symbol tables for " +"each comprehension; instead, the comprehension's locals will be included in " +"the parent function's symbol table." msgstr "" -#: ../../whatsnew/3.12.rst:319 -msgid "(Contributed by Eric Snow in :gh:`104210`, etc.)" -msgstr "(由 Eric Snow 於 :gh:`104210` 等貢獻。)" +#: ../../whatsnew/3.12.rst:413 +msgid "" +"Calling :func:`locals` inside a comprehension now includes variables from " +"outside the comprehension, and no longer includes the synthetic ``.0`` " +"variable for the comprehension \"argument\"." +msgstr "" -#: ../../whatsnew/3.12.rst:324 -msgid "PEP 669: Low impact monitoring for CPython" +#: ../../whatsnew/3.12.rst:416 +msgid "" +"A comprehension iterating directly over ``locals()`` (e.g. ``[k for k in " +"locals()]``) may see \"RuntimeError: dictionary changed size during " +"iteration\" when run under tracing (e.g. code coverage measurement). This is " +"the same behavior already seen in e.g. ``for k in locals():``. To avoid the " +"error, first create a list of keys to iterate over: ``keys = list(locals()); " +"[k for k in keys]``." msgstr "" -#: ../../whatsnew/3.12.rst:326 +#: ../../whatsnew/3.12.rst:423 +msgid "(Contributed by Carl Meyer and Vladimir Matveev in :pep:`709`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:426 +msgid "Improved Error Messages" +msgstr "" + +#: ../../whatsnew/3.12.rst:428 msgid "" -"CPython 3.12 now supports the ability to monitor calls, returns, lines, " -"exceptions and other events using instrumentation. This means that you only " -"pay for what you use, providing support for near-zero overhead debuggers and " -"coverage tools." +"Modules from the standard library are now potentially suggested as part of " +"the error messages displayed by the interpreter when a :exc:`NameError` is " +"raised to the top level. (Contributed by Pablo Galindo in :gh:`98254`.)" msgstr "" -#: ../../whatsnew/3.12.rst:331 -msgid "See :mod:`sys.monitoring` for details." +#: ../../whatsnew/3.12.rst:437 +msgid "" +"Improve the error suggestion for :exc:`NameError` exceptions for instances. " +"Now if a :exc:`NameError` is raised in a method and the instance has an " +"attribute that's exactly equal to the name in the exception, the suggestion " +"will include ``self.`` instead of the closest match in the method " +"scope. (Contributed by Pablo Galindo in :gh:`99139`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:457 +msgid "" +"Improve the :exc:`SyntaxError` error message when the user types ``import x " +"from y`` instead of ``from y import x``. (Contributed by Pablo Galindo in :" +"gh:`98931`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:467 +msgid "" +":exc:`ImportError` exceptions raised from failed ``from import " +"`` statements now include suggestions for the value of ```` " +"based on the available names in ````. (Contributed by Pablo Galindo " +"in :gh:`91058`.)" msgstr "" -#: ../../whatsnew/3.12.rst:335 +#: ../../whatsnew/3.12.rst:478 msgid "New Features Related to Type Hints" msgstr "" -#: ../../whatsnew/3.12.rst:337 +#: ../../whatsnew/3.12.rst:480 msgid "" -"This section covers major changes affecting :pep:`484` type hints and the :" +"This section covers major changes affecting :pep:`type hints <484>` and the :" "mod:`typing` module." msgstr "" -#: ../../whatsnew/3.12.rst:343 +#: ../../whatsnew/3.12.rst:486 msgid "PEP 692: Using ``TypedDict`` for more precise ``**kwargs`` typing" msgstr "" -#: ../../whatsnew/3.12.rst:345 +#: ../../whatsnew/3.12.rst:488 msgid "" "Typing ``**kwargs`` in a function signature as introduced by :pep:`484` " "allowed for valid annotations only in cases where all of the ``**kwargs`` " "were of the same type." msgstr "" -#: ../../whatsnew/3.12.rst:349 +#: ../../whatsnew/3.12.rst:492 msgid "" -"This PEP specifies a more precise way of typing ``**kwargs`` by relying on " +":pep:`692` specifies a more precise way of typing ``**kwargs`` by relying on " "typed dictionaries::" msgstr "" -#: ../../whatsnew/3.12.rst:360 +#: ../../whatsnew/3.12.rst:503 msgid "See :pep:`692` for more details." msgstr "" -#: ../../whatsnew/3.12.rst:362 +#: ../../whatsnew/3.12.rst:505 msgid "(Contributed by Franek Magiera in :gh:`103629`.)" msgstr "(由 Franek Magiera 於 :gh:`103629` 中貢獻。)" -#: ../../whatsnew/3.12.rst:367 +#: ../../whatsnew/3.12.rst:510 msgid "PEP 698: Override Decorator for Static Typing" msgstr "" -#: ../../whatsnew/3.12.rst:369 +#: ../../whatsnew/3.12.rst:512 msgid "" "A new decorator :func:`typing.override` has been added to the :mod:`typing` " "module. It indicates to type checkers that the method is intended to " @@ -402,138 +614,73 @@ msgid "" "class does not in fact do so." msgstr "" -#: ../../whatsnew/3.12.rst:375 +#: ../../whatsnew/3.12.rst:518 msgid "Example::" msgstr "" -#: ../../whatsnew/3.12.rst:393 -msgid "(Contributed by Steven Troxler in :gh:`101561`.)" -msgstr "(由 Steven Troxler 於 :gh:`101561` 中貢獻。)" - -#: ../../whatsnew/3.12.rst:398 -msgid "PEP 695: Type Parameter Syntax" -msgstr "" - -#: ../../whatsnew/3.12.rst:400 -msgid "" -"Generic classes and functions under :pep:`484` were declared using a verbose " -"syntax that left the scope of type parameters unclear and required explicit " -"declarations of variance." -msgstr "" - -#: ../../whatsnew/3.12.rst:404 -msgid "" -":pep:`695` introduces a new, more compact and explicit way to create :ref:" -"`generic classes ` and :ref:`functions `::" -msgstr "" - -#: ../../whatsnew/3.12.rst:417 -msgid "" -"In addition, the PEP introduces a new way to declare :ref:`type aliases " -"` using the :keyword:`type` statement, which creates an " -"instance of :class:`~typing.TypeAliasType`::" -msgstr "" - -#: ../../whatsnew/3.12.rst:423 -msgid "Type aliases can also be :ref:`generic `::" +#: ../../whatsnew/3.12.rst:536 +msgid "See :pep:`698` for more details." msgstr "" -#: ../../whatsnew/3.12.rst:427 -msgid "" -"The new syntax allows declaring :class:`~typing.TypeVarTuple` and :class:" -"`~typing.ParamSpec` parameters, as well as :class:`~typing.TypeVar` " -"parameters with bounds or constraints::" -msgstr "" - -#: ../../whatsnew/3.12.rst:436 -msgid "" -"The value of type aliases and the bound and constraints of type variables " -"created through this syntax are evaluated only on demand (see :ref:`lazy-" -"evaluation`). This means type aliases are able to refer to other types " -"defined later in the file." -msgstr "" - -#: ../../whatsnew/3.12.rst:441 -msgid "" -"Type parameters declared through a type parameter list are visible within " -"the scope of the declaration and any nested scopes, but not in the outer " -"scope. For example, they can be used in the type annotations for the methods " -"of a generic class or in the class body. However, they cannot be used in the " -"module scope after the class is defined. See :ref:`type-params` for a " -"detailed description of the runtime semantics of type parameters." -msgstr "" - -#: ../../whatsnew/3.12.rst:448 -msgid "" -"In order to support these scoping semantics, a new kind of scope is " -"introduced, the :ref:`annotation scope `. Annotation " -"scopes behave for the most part like function scopes, but interact " -"differently with enclosing class scopes. In Python 3.13, :term:`annotations " -"` will also be evaluated in annotation scopes." -msgstr "" - -#: ../../whatsnew/3.12.rst:454 -msgid "See :pep:`695` for more details." -msgstr "詳情請見 :pep:`695`。" - -#: ../../whatsnew/3.12.rst:456 -msgid "" -"(PEP written by Eric Traut. Implementation by Jelle Zijlstra, Eric Traut, " -"and others in :gh:`103764`.)" -msgstr "" +#: ../../whatsnew/3.12.rst:538 +msgid "(Contributed by Steven Troxler in :gh:`101561`.)" +msgstr "(由 Steven Troxler 於 :gh:`101561` 中貢獻。)" -#: ../../whatsnew/3.12.rst:460 +#: ../../whatsnew/3.12.rst:541 msgid "Other Language Changes" msgstr "其他語言更動" -#: ../../whatsnew/3.12.rst:462 +#: ../../whatsnew/3.12.rst:543 msgid "" -"Add :ref:`perf_profiling` through the new environment variable :envvar:" -"`PYTHONPERFSUPPORT`, the new command-line option :option:`-X perf <-X>`, as " -"well as the new :func:`sys.activate_stack_trampoline`, :func:`sys." -"deactivate_stack_trampoline`, and :func:`sys.is_stack_trampoline_active` " -"APIs. (Design by Pablo Galindo. Contributed by Pablo Galindo and Christian " -"Heimes with contributions from Gregory P. Smith [Google] and Mark Shannon " -"in :gh:`96123`.)" +"The parser now raises :exc:`SyntaxError` when parsing source code containing " +"null bytes. (Contributed by Pablo Galindo in :gh:`96670`.)" msgstr "" -#: ../../whatsnew/3.12.rst:472 -msgid "" -"The extraction methods in :mod:`tarfile`, and :func:`shutil.unpack_archive`, " -"have a new a *filter* argument that allows limiting tar features than may be " -"surprising or dangerous, such as creating files outside the destination " -"directory. See :ref:`tarfile-extraction-filter` for details. In Python 3.14, " -"the default will switch to ``'data'``. (Contributed by Petr Viktorin in :pep:" -"`706`.)" +#: ../../whatsnew/3.12.rst:546 +msgid "" +"A backslash-character pair that is not a valid escape sequence now generates " +"a :exc:`SyntaxWarning`, instead of :exc:`DeprecationWarning`. For example, " +"``re.compile(\"\\d+\\.\\d+\")`` now emits a :exc:`SyntaxWarning` " +"(``\"\\d\"`` is an invalid escape sequence, use raw strings for regular " +"expression: ``re.compile(r\"\\d+\\.\\d+\")``). In a future Python version, :" +"exc:`SyntaxError` will eventually be raised, instead of :exc:" +"`SyntaxWarning`. (Contributed by Victor Stinner in :gh:`98401`.)" msgstr "" -#: ../../whatsnew/3.12.rst:480 +#: ../../whatsnew/3.12.rst:555 msgid "" -":class:`types.MappingProxyType` instances are now hashable if the underlying " -"mapping is hashable. (Contributed by Serhiy Storchaka in :gh:`87995`.)" +"Octal escapes with value larger than ``0o377`` (ex: ``\"\\477\"``), " +"deprecated in Python 3.11, now produce a :exc:`SyntaxWarning`, instead of :" +"exc:`DeprecationWarning`. In a future Python version they will be eventually " +"a :exc:`SyntaxError`. (Contributed by Victor Stinner in :gh:`98401`.)" msgstr "" -#: ../../whatsnew/3.12.rst:484 +#: ../../whatsnew/3.12.rst:561 msgid "" -":class:`memoryview` now supports the half-float type (the \"e\" format " -"code). (Contributed by Dong-hee Na and Antoine Pitrou in :gh:`90751`.)" +"Variables used in the target part of comprehensions that are not stored to " +"can now be used in assignment expressions (``:=``). For example, in ``[(b := " +"1) for a, b.prop in some_iter]``, the assignment to ``b`` is now allowed. " +"Note that assigning to variables stored to in the target part of " +"comprehensions (like ``a``) is still disallowed, as per :pep:`572`. " +"(Contributed by Nikita Sobolev in :gh:`100581`.)" msgstr "" -#: ../../whatsnew/3.12.rst:487 +#: ../../whatsnew/3.12.rst:568 msgid "" -"The parser now raises :exc:`SyntaxError` when parsing source code containing " -"null bytes. (Contributed by Pablo Galindo in :gh:`96670`.)" +"Exceptions raised in a class or type's ``__set_name__`` method are no longer " +"wrapped by a :exc:`RuntimeError`. Context information is added to the " +"exception as a :pep:`678` note. (Contributed by Irit Katriel in :gh:`77757`.)" msgstr "" -#: ../../whatsnew/3.12.rst:490 +#: ../../whatsnew/3.12.rst:572 msgid "" -":func:`ast.parse` now raises :exc:`SyntaxError` instead of :exc:`ValueError` " -"when parsing source code containing null bytes. (Contributed by Pablo " -"Galindo in :gh:`96670`.)" +"When a ``try-except*`` construct handles the entire :exc:`ExceptionGroup` " +"and raises one other exception, that exception is no longer wrapped in an :" +"exc:`ExceptionGroup`. Also changed in version 3.11.4. (Contributed by Irit " +"Katriel in :gh:`103590`.)" msgstr "" -#: ../../whatsnew/3.12.rst:494 +#: ../../whatsnew/3.12.rst:577 msgid "" "The Garbage Collector now runs only on the eval breaker mechanism of the " "Python bytecode evaluation loop instead of object allocations. The GC can " @@ -543,98 +690,94 @@ msgid "" "`97922`.)" msgstr "" -#: ../../whatsnew/3.12.rst:501 -msgid "" -"A backslash-character pair that is not a valid escape sequence now generates " -"a :exc:`SyntaxWarning`, instead of :exc:`DeprecationWarning`. For example, " -"``re.compile(\"\\d+\\.\\d+\")`` now emits a :exc:`SyntaxWarning` " -"(``\"\\d\"`` is an invalid escape sequence), use raw strings for regular " -"expression: ``re.compile(r\"\\d+\\.\\d+\")``. In a future Python version, :" -"exc:`SyntaxError` will eventually be raised, instead of :exc:" -"`SyntaxWarning`. (Contributed by Victor Stinner in :gh:`98401`.)" -msgstr "" - -#: ../../whatsnew/3.12.rst:510 -msgid "" -"Octal escapes with value larger than ``0o377`` (ex: ``\"\\477\"``), " -"deprecated in Python 3.11, now produce a :exc:`SyntaxWarning`, instead of :" -"exc:`DeprecationWarning`. In a future Python version they will be eventually " -"a :exc:`SyntaxError`. (Contributed by Victor Stinner in :gh:`98401`.)" -msgstr "" - -#: ../../whatsnew/3.12.rst:516 +#: ../../whatsnew/3.12.rst:584 msgid "" "All builtin and extension callables expecting boolean parameters now accept " "arguments of any type instead of just :class:`bool` and :class:`int`. " "(Contributed by Serhiy Storchaka in :gh:`60203`.)" msgstr "" -#: ../../whatsnew/3.12.rst:520 +#: ../../whatsnew/3.12.rst:588 msgid "" -"Variables used in the target part of comprehensions that are not stored to " -"can now be used in assignment expressions (``:=``). For example, in ``[(b := " -"1) for a, b.prop in some_iter]``, the assignment to ``b`` is now allowed. " -"Note that assigning to variables stored to in the target part of " -"comprehensions (like ``a``) is still disallowed, as per :pep:`572`. " -"(Contributed by Nikita Sobolev in :gh:`100581`.)" +":class:`memoryview` now supports the half-float type (the \"e\" format " +"code). (Contributed by Donghee Na and Antoine Pitrou in :gh:`90751`.)" msgstr "" -#: ../../whatsnew/3.12.rst:527 +#: ../../whatsnew/3.12.rst:591 msgid "" ":class:`slice` objects are now hashable, allowing them to be used as dict " "keys and set items. (Contributed by Will Bradshaw, Furkan Onder, and Raymond " "Hettinger in :gh:`101264`.)" msgstr "" -#: ../../whatsnew/3.12.rst:530 +#: ../../whatsnew/3.12.rst:594 msgid "" -":func:`sum` now uses Neumaier summation to improve accuracy when summing " -"floats or mixed ints and floats. (Contributed by Raymond Hettinger in :gh:" -"`100425`.)" +":func:`sum` now uses Neumaier summation to improve accuracy and " +"commutativity when summing floats or mixed ints and floats. (Contributed by " +"Raymond Hettinger in :gh:`100425`.)" msgstr "" -#: ../../whatsnew/3.12.rst:534 +#: ../../whatsnew/3.12.rst:598 msgid "" -"Exceptions raised in a typeobject's ``__set_name__`` method are no longer " -"wrapped by a :exc:`RuntimeError`. Context information is added to the " -"exception as a :pep:`678` note. (Contributed by Irit Katriel in :gh:`77757`.)" +":func:`ast.parse` now raises :exc:`SyntaxError` instead of :exc:`ValueError` " +"when parsing source code containing null bytes. (Contributed by Pablo " +"Galindo in :gh:`96670`.)" msgstr "" -#: ../../whatsnew/3.12.rst:538 +#: ../../whatsnew/3.12.rst:602 msgid "" -"When a ``try-except*`` construct handles the entire :exc:`ExceptionGroup` " -"and raises one other exception, that exception is no longer wrapped in an :" -"exc:`ExceptionGroup`. Also changed in version 3.11.4. (Contributed by Irit " -"Katriel in :gh:`103590`.)" +"The extraction methods in :mod:`tarfile`, and :func:`shutil.unpack_archive`, " +"have a new a *filter* argument that allows limiting tar features than may be " +"surprising or dangerous, such as creating files outside the destination " +"directory. See :ref:`tarfile extraction filters ` " +"for details. In Python 3.14, the default will switch to ``'data'``. " +"(Contributed by Petr Viktorin in :pep:`706`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:610 +msgid "" +":class:`types.MappingProxyType` instances are now hashable if the underlying " +"mapping is hashable. (Contributed by Serhiy Storchaka in :gh:`87995`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:614 +msgid "" +"Add :ref:`support for the perf profiler ` through the new " +"environment variable :envvar:`PYTHONPERFSUPPORT` and command-line option :" +"option:`-X perf <-X>`, as well as the new :func:`sys." +"activate_stack_trampoline`, :func:`sys.deactivate_stack_trampoline`, and :" +"func:`sys.is_stack_trampoline_active` functions. (Design by Pablo Galindo. " +"Contributed by Pablo Galindo and Christian Heimes with contributions from " +"Gregory P. Smith [Google] and Mark Shannon in :gh:`96123`.)" msgstr "" -#: ../../whatsnew/3.12.rst:545 +#: ../../whatsnew/3.12.rst:626 msgid "New Modules" msgstr "" -#: ../../whatsnew/3.12.rst:547 +#: ../../whatsnew/3.12.rst:628 msgid "None." msgstr "" -#: ../../whatsnew/3.12.rst:551 +#: ../../whatsnew/3.12.rst:632 msgid "Improved Modules" msgstr "" -#: ../../whatsnew/3.12.rst:554 +#: ../../whatsnew/3.12.rst:635 msgid "array" msgstr "array" -#: ../../whatsnew/3.12.rst:556 +#: ../../whatsnew/3.12.rst:637 msgid "" "The :class:`array.array` class now supports subscripting, making it a :term:" "`generic type`. (Contributed by Jelle Zijlstra in :gh:`98658`.)" msgstr "" -#: ../../whatsnew/3.12.rst:560 +#: ../../whatsnew/3.12.rst:641 msgid "asyncio" msgstr "asyncio" -#: ../../whatsnew/3.12.rst:562 +#: ../../whatsnew/3.12.rst:643 msgid "" "The performance of writing to sockets in :mod:`asyncio` has been " "significantly improved. ``asyncio`` now avoids unnecessary copying when " @@ -642,140 +785,134 @@ msgid "" "supports it. (Contributed by Kumar Aditya in :gh:`91166`.)" msgstr "" -#: ../../whatsnew/3.12.rst:567 +#: ../../whatsnew/3.12.rst:648 msgid "" -"Added :func:`asyncio.eager_task_factory` and :func:`asyncio." +"Add :func:`asyncio.eager_task_factory` and :func:`asyncio." "create_eager_task_factory` functions to allow opting an event loop in to " "eager task execution, making some use-cases 2x to 5x faster. (Contributed by " -"Jacob Bower & Itamar O in :gh:`102853`, :gh:`104140`, and :gh:`104138`)" +"Jacob Bower & Itamar Oren in :gh:`102853`, :gh:`104140`, and :gh:`104138`)" msgstr "" -#: ../../whatsnew/3.12.rst:572 +#: ../../whatsnew/3.12.rst:653 msgid "" -"On Linux, :mod:`asyncio` uses :class:`~asyncio.PidfdChildWatcher` by default " +"On Linux, :mod:`asyncio` uses :class:`asyncio.PidfdChildWatcher` by default " "if :func:`os.pidfd_open` is available and functional instead of :class:" -"`~asyncio.ThreadedChildWatcher`. (Contributed by Kumar Aditya in :gh:" -"`98024`.)" -msgstr "" - -#: ../../whatsnew/3.12.rst:577 -msgid "" -"The child watcher classes :class:`~asyncio.MultiLoopChildWatcher`, :class:" -"`~asyncio.FastChildWatcher`, :class:`~asyncio.AbstractChildWatcher` and :" -"class:`~asyncio.SafeChildWatcher` are deprecated and will be removed in " -"Python 3.14. It is recommended to not manually configure a child watcher as " -"the event loop now uses the best available child watcher for each platform (:" -"class:`~asyncio.PidfdChildWatcher` if supported and :class:`~asyncio." -"ThreadedChildWatcher` otherwise). (Contributed by Kumar Aditya in :gh:" -"`94597`.)" +"`asyncio.ThreadedChildWatcher`. (Contributed by Kumar Aditya in :gh:`98024`.)" msgstr "" -#: ../../whatsnew/3.12.rst:586 +#: ../../whatsnew/3.12.rst:658 msgid "" -":func:`asyncio.set_child_watcher`, :func:`asyncio.get_child_watcher`, :meth:" -"`asyncio.AbstractEventLoopPolicy.set_child_watcher` and :meth:`asyncio." -"AbstractEventLoopPolicy.get_child_watcher` are deprecated and will be " -"removed in Python 3.14. (Contributed by Kumar Aditya in :gh:`94597`.)" +"The event loop now uses the best available child watcher for each platform (:" +"class:`asyncio.PidfdChildWatcher` if supported and :class:`asyncio." +"ThreadedChildWatcher` otherwise), so manually configuring a child watcher is " +"not recommended. (Contributed by Kumar Aditya in :gh:`94597`.)" msgstr "" -#: ../../whatsnew/3.12.rst:592 +#: ../../whatsnew/3.12.rst:664 msgid "" "Add *loop_factory* parameter to :func:`asyncio.run` to allow specifying a " "custom event loop factory. (Contributed by Kumar Aditya in :gh:`99388`.)" msgstr "" -#: ../../whatsnew/3.12.rst:596 +#: ../../whatsnew/3.12.rst:668 msgid "" "Add C implementation of :func:`asyncio.current_task` for 4x-6x speedup. " -"(Contributed by Itamar Ostricher and Pranav Thulasiram Bhat in :gh:`100344`.)" +"(Contributed by Itamar Oren and Pranav Thulasiram Bhat in :gh:`100344`.)" msgstr "" -#: ../../whatsnew/3.12.rst:599 +#: ../../whatsnew/3.12.rst:671 msgid "" ":func:`asyncio.iscoroutine` now returns ``False`` for generators as :mod:" "`asyncio` does not support legacy generator-based coroutines. (Contributed " "by Kumar Aditya in :gh:`102748`.)" msgstr "" -#: ../../whatsnew/3.12.rst:603 +#: ../../whatsnew/3.12.rst:675 msgid "" ":func:`asyncio.wait` and :func:`asyncio.as_completed` now accepts generators " "yielding tasks. (Contributed by Kumar Aditya in :gh:`78530`.)" msgstr "" -#: ../../whatsnew/3.12.rst:608 +#: ../../whatsnew/3.12.rst:680 msgid "calendar" msgstr "calendar" -#: ../../whatsnew/3.12.rst:610 +#: ../../whatsnew/3.12.rst:682 msgid "" -"Add enums :data:`~calendar.Month` and :data:`~calendar.Day`. (Contributed by " -"Prince Roshan in :gh:`103636`.)" +"Add enums :data:`calendar.Month` and :data:`calendar.Day` defining months of " +"the year and days of the week. (Contributed by Prince Roshan in :gh:" +"`103636`.)" msgstr "" -#: ../../whatsnew/3.12.rst:614 +#: ../../whatsnew/3.12.rst:687 msgid "csv" msgstr "csv" -#: ../../whatsnew/3.12.rst:616 +#: ../../whatsnew/3.12.rst:689 msgid "" -"Add :const:`~csv.QUOTE_NOTNULL` and :const:`~csv.QUOTE_STRINGS` flags to " -"provide finer grained control of ``None`` and empty strings by :class:`~csv." +"Add :const:`csv.QUOTE_NOTNULL` and :const:`csv.QUOTE_STRINGS` flags to " +"provide finer grained control of ``None`` and empty strings by :class:`csv." "writer` objects." msgstr "" -#: ../../whatsnew/3.12.rst:621 +#: ../../whatsnew/3.12.rst:694 msgid "dis" msgstr "dis" -#: ../../whatsnew/3.12.rst:623 +#: ../../whatsnew/3.12.rst:696 msgid "" "Pseudo instruction opcodes (which are used by the compiler but do not appear " "in executable bytecode) are now exposed in the :mod:`dis` module. :opcode:" "`HAVE_ARGUMENT` is still relevant to real opcodes, but it is not useful for " -"pseudo instructions. Use the new :data:`~dis.hasarg` collection instead. " +"pseudo instructions. Use the new :data:`dis.hasarg` collection instead. " "(Contributed by Irit Katriel in :gh:`94216`.)" msgstr "" -#: ../../whatsnew/3.12.rst:632 +#: ../../whatsnew/3.12.rst:704 +msgid "" +"Add the :data:`dis.hasexc` collection to signify instructions that set an " +"exception handler. (Contributed by Irit Katriel in :gh:`94216`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:708 msgid "fractions" msgstr "fractions" -#: ../../whatsnew/3.12.rst:634 +#: ../../whatsnew/3.12.rst:710 msgid "" "Objects of type :class:`fractions.Fraction` now support float-style " "formatting. (Contributed by Mark Dickinson in :gh:`100161`.)" msgstr "" -#: ../../whatsnew/3.12.rst:638 +#: ../../whatsnew/3.12.rst:714 msgid "importlib.resources" msgstr "" -#: ../../whatsnew/3.12.rst:640 +#: ../../whatsnew/3.12.rst:716 msgid "" ":func:`importlib.resources.as_file` now supports resource directories. " "(Contributed by Jason R. Coombs in :gh:`97930`.)" msgstr "" -#: ../../whatsnew/3.12.rst:644 +#: ../../whatsnew/3.12.rst:720 msgid "inspect" msgstr "inspect" -#: ../../whatsnew/3.12.rst:646 +#: ../../whatsnew/3.12.rst:722 msgid "" "Add :func:`inspect.markcoroutinefunction` to mark sync functions that return " "a :term:`coroutine` for use with :func:`inspect.iscoroutinefunction`. " "(Contributed Carlton Gibson in :gh:`99247`.)" msgstr "" -#: ../../whatsnew/3.12.rst:650 +#: ../../whatsnew/3.12.rst:726 msgid "" "Add :func:`inspect.getasyncgenstate` and :func:`inspect.getasyncgenlocals` " "for determining the current state of asynchronous generators. (Contributed " -"by Thomas Krennwallner in :issue:`35759`.)" +"by Thomas Krennwallner in :gh:`79940`.)" msgstr "" -#: ../../whatsnew/3.12.rst:654 +#: ../../whatsnew/3.12.rst:730 msgid "" "The performance of :func:`inspect.getattr_static` has been considerably " "improved. Most calls to the function should be at least 2x faster than they " @@ -783,60 +920,60 @@ msgid "" "Waygood in :gh:`103193`.)" msgstr "" -#: ../../whatsnew/3.12.rst:660 +#: ../../whatsnew/3.12.rst:736 msgid "itertools" msgstr "itertools" -#: ../../whatsnew/3.12.rst:662 +#: ../../whatsnew/3.12.rst:738 msgid "" -"Added :class:`itertools.batched()` for collecting into even-sized tuples " -"where the last batch may be shorter than the rest. (Contributed by Raymond " +"Add :class:`itertools.batched()` for collecting into even-sized tuples where " +"the last batch may be shorter than the rest. (Contributed by Raymond " "Hettinger in :gh:`98363`.)" msgstr "" -#: ../../whatsnew/3.12.rst:667 +#: ../../whatsnew/3.12.rst:743 msgid "math" msgstr "math" -#: ../../whatsnew/3.12.rst:669 +#: ../../whatsnew/3.12.rst:745 msgid "" -"Added :func:`math.sumprod` for computing a sum of products. (Contributed by " +"Add :func:`math.sumprod` for computing a sum of products. (Contributed by " "Raymond Hettinger in :gh:`100485`.)" msgstr "" -#: ../../whatsnew/3.12.rst:672 +#: ../../whatsnew/3.12.rst:748 msgid "" -"Extended :func:`math.nextafter` to include a *steps* argument for moving up " -"or down multiple steps at a time. (By Matthias Goergens, Mark Dickinson, and " +"Extend :func:`math.nextafter` to include a *steps* argument for moving up or " +"down multiple steps at a time. (By Matthias Goergens, Mark Dickinson, and " "Raymond Hettinger in :gh:`94906`.)" msgstr "" -#: ../../whatsnew/3.12.rst:677 +#: ../../whatsnew/3.12.rst:753 msgid "os" msgstr "os" -#: ../../whatsnew/3.12.rst:679 +#: ../../whatsnew/3.12.rst:755 msgid "" "Add :const:`os.PIDFD_NONBLOCK` to open a file descriptor for a process with :" "func:`os.pidfd_open` in non-blocking mode. (Contributed by Kumar Aditya in :" "gh:`93312`.)" msgstr "" -#: ../../whatsnew/3.12.rst:683 +#: ../../whatsnew/3.12.rst:759 msgid "" ":class:`os.DirEntry` now includes an :meth:`os.DirEntry.is_junction` method " "to check if the entry is a junction. (Contributed by Charles Machalow in :gh:" "`99547`.)" msgstr "" -#: ../../whatsnew/3.12.rst:687 +#: ../../whatsnew/3.12.rst:763 msgid "" "Add :func:`os.listdrives`, :func:`os.listvolumes` and :func:`os.listmounts` " "functions on Windows for enumerating drives, volumes and mount points. " "(Contributed by Steve Dower in :gh:`102519`.)" msgstr "" -#: ../../whatsnew/3.12.rst:691 +#: ../../whatsnew/3.12.rst:767 msgid "" ":func:`os.stat` and :func:`os.lstat` are now more accurate on Windows. The " "``st_birthtime`` field will now be filled with the creation time of the " @@ -849,56 +986,56 @@ msgid "" "`99726`.)" msgstr "" -#: ../../whatsnew/3.12.rst:702 +#: ../../whatsnew/3.12.rst:778 msgid "os.path" msgstr "os.path" -#: ../../whatsnew/3.12.rst:704 +#: ../../whatsnew/3.12.rst:780 msgid "" "Add :func:`os.path.isjunction` to check if a given path is a junction. " "(Contributed by Charles Machalow in :gh:`99547`.)" msgstr "" -#: ../../whatsnew/3.12.rst:707 +#: ../../whatsnew/3.12.rst:783 msgid "" "Add :func:`os.path.splitroot` to split a path into a triad ``(drive, root, " "tail)``. (Contributed by Barney Gale in :gh:`101000`.)" msgstr "" -#: ../../whatsnew/3.12.rst:711 +#: ../../whatsnew/3.12.rst:787 msgid "pathlib" msgstr "pathlib" -#: ../../whatsnew/3.12.rst:713 +#: ../../whatsnew/3.12.rst:789 msgid "" -"Add support for subclassing :class:`pathlib.PurePath` and :class:`~pathlib." +"Add support for subclassing :class:`pathlib.PurePath` and :class:`pathlib." "Path`, plus their Posix- and Windows-specific variants. Subclasses may " -"override the :meth:`~pathlib.PurePath.with_segments` method to pass " +"override the :meth:`pathlib.PurePath.with_segments` method to pass " "information between path instances." msgstr "" -#: ../../whatsnew/3.12.rst:718 +#: ../../whatsnew/3.12.rst:794 msgid "" -"Add :meth:`~pathlib.Path.walk` for walking the directory trees and " -"generating all file or directory names within them, similar to :func:`os." -"walk`. (Contributed by Stanislav Zmiev in :gh:`90385`.)" +"Add :meth:`pathlib.Path.walk` for walking the directory trees and generating " +"all file or directory names within them, similar to :func:`os.walk`. " +"(Contributed by Stanislav Zmiev in :gh:`90385`.)" msgstr "" -#: ../../whatsnew/3.12.rst:722 +#: ../../whatsnew/3.12.rst:798 msgid "" "Add *walk_up* optional parameter to :meth:`pathlib.PurePath.relative_to` to " "allow the insertion of ``..`` entries in the result; this behavior is more " "consistent with :func:`os.path.relpath`. (Contributed by Domenico Ragusa in :" -"issue:`40358`.)" +"gh:`84538`.)" msgstr "" -#: ../../whatsnew/3.12.rst:727 +#: ../../whatsnew/3.12.rst:803 msgid "" "Add :meth:`pathlib.Path.is_junction` as a proxy to :func:`os.path." "isjunction`. (Contributed by Charles Machalow in :gh:`99547`.)" msgstr "" -#: ../../whatsnew/3.12.rst:730 +#: ../../whatsnew/3.12.rst:806 msgid "" "Add *case_sensitive* optional parameter to :meth:`pathlib.Path.glob`, :meth:" "`pathlib.Path.rglob` and :meth:`pathlib.PurePath.match` for matching the " @@ -906,38 +1043,38 @@ msgid "" "process." msgstr "" -#: ../../whatsnew/3.12.rst:735 +#: ../../whatsnew/3.12.rst:811 msgid "pdb" msgstr "pdb" -#: ../../whatsnew/3.12.rst:737 +#: ../../whatsnew/3.12.rst:813 msgid "" "Add convenience variables to hold values temporarily for debug session and " "provide quick access to values like the current frame or the return value. " "(Contributed by Tian Gao in :gh:`103693`.)" msgstr "" -#: ../../whatsnew/3.12.rst:743 +#: ../../whatsnew/3.12.rst:819 msgid "random" msgstr "random" -#: ../../whatsnew/3.12.rst:745 +#: ../../whatsnew/3.12.rst:821 msgid "" -"Added :func:`random.binomialvariate`. (Contributed by Raymond Hettinger in :" -"gh:`81620`.)" +"Add :func:`random.binomialvariate`. (Contributed by Raymond Hettinger in :gh:" +"`81620`.)" msgstr "" -#: ../../whatsnew/3.12.rst:748 +#: ../../whatsnew/3.12.rst:824 msgid "" -"Added a default of ``lamb=1.0`` to :func:`random.expovariate`. (Contributed " +"Add a default of ``lambd=1.0`` to :func:`random.expovariate`. (Contributed " "by Raymond Hettinger in :gh:`100234`.)" msgstr "" -#: ../../whatsnew/3.12.rst:752 +#: ../../whatsnew/3.12.rst:828 msgid "shutil" msgstr "shutil" -#: ../../whatsnew/3.12.rst:754 +#: ../../whatsnew/3.12.rst:830 msgid "" ":func:`shutil.make_archive` now passes the *root_dir* argument to custom " "archivers which support it. In this case it no longer temporarily changes " @@ -945,7 +1082,7 @@ msgid "" "archiving. (Contributed by Serhiy Storchaka in :gh:`74696`.)" msgstr "" -#: ../../whatsnew/3.12.rst:760 +#: ../../whatsnew/3.12.rst:836 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 " @@ -953,14 +1090,14 @@ msgid "" "Python 3.14. (Contributed by Irit Katriel in :gh:`102828`.)" msgstr "" -#: ../../whatsnew/3.12.rst:766 +#: ../../whatsnew/3.12.rst:842 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:771 +#: ../../whatsnew/3.12.rst:847 msgid "" ":func:`shutil.which` will call ``NeedCurrentDirectoryForExePathW`` when " "querying for executables on Windows to determine if the current working " @@ -968,61 +1105,68 @@ msgid "" "Machalow in :gh:`103179`.)" msgstr "" -#: ../../whatsnew/3.12.rst:776 +#: ../../whatsnew/3.12.rst:852 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:782 ../../whatsnew/3.12.rst:1461 +#: ../../whatsnew/3.12.rst:858 ../../whatsnew/3.12.rst:1637 msgid "sqlite3" msgstr "sqlite3" -#: ../../whatsnew/3.12.rst:784 +#: ../../whatsnew/3.12.rst:860 msgid "" "Add a :ref:`command-line interface `. (Contributed by Erlend E. " "Aasland in :gh:`77617`.)" msgstr "" -#: ../../whatsnew/3.12.rst:787 +#: ../../whatsnew/3.12.rst:863 msgid "" -"Add the :attr:`~sqlite3.Connection.autocommit` attribute to :class:`~sqlite3." -"Connection` and the *autocommit* parameter to :func:`~sqlite3.connect` to " +"Add the :attr:`sqlite3.Connection.autocommit` attribute to :class:`sqlite3." +"Connection` and the *autocommit* parameter to :func:`sqlite3.connect` to " "control :pep:`249`-compliant :ref:`transaction handling `. (Contributed by Erlend E. Aasland in :gh:`83638`.)" msgstr "" -#: ../../whatsnew/3.12.rst:794 +#: ../../whatsnew/3.12.rst:870 msgid "" -"Add *entrypoint* keyword-only parameter to :meth:`~sqlite3.Connection." +"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:799 +#: ../../whatsnew/3.12.rst:875 msgid "" -"Add :meth:`~sqlite3.Connection.getconfig` and :meth:`~sqlite3.Connection." -"setconfig` to :class:`~sqlite3.Connection` to make configuration changes to " -"a database connection. (Contributed by Erlend E. Aasland in :gh:`103489`.)" +"Add :meth:`sqlite3.Connection.getconfig` and :meth:`sqlite3.Connection." +"setconfig` to :class:`sqlite3.Connection` to make configuration changes to a " +"database connection. (Contributed by Erlend E. Aasland in :gh:`103489`.)" msgstr "" -#: ../../whatsnew/3.12.rst:805 +#: ../../whatsnew/3.12.rst:881 msgid "statistics" msgstr "statistics" -#: ../../whatsnew/3.12.rst:807 +#: ../../whatsnew/3.12.rst:883 msgid "" -"Extended :func:`statistics.correlation` to include as a ``ranked`` method " -"for computing the Spearman correlation of ranked data. (Contributed by " -"Raymond Hettinger in :gh:`95861`.)" +"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:812 +#: ../../whatsnew/3.12.rst:888 msgid "sys" msgstr "sys" -#: ../../whatsnew/3.12.rst:814 +#: ../../whatsnew/3.12.rst:890 +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:894 msgid "" "Add :func:`sys.activate_stack_trampoline` and :func:`sys." "deactivate_stack_trampoline` for activating and deactivating stack profiler " @@ -1032,7 +1176,7 @@ msgid "" "Shannon in :gh:`96123`.)" msgstr "" -#: ../../whatsnew/3.12.rst:823 +#: ../../whatsnew/3.12.rst:903 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 " @@ -1041,14 +1185,14 @@ msgid "" "Katriel in :gh:`102778`.)" msgstr "" -#: ../../whatsnew/3.12.rst:829 ../../whatsnew/3.12.rst:1647 +#: ../../whatsnew/3.12.rst:909 ../../whatsnew/3.12.rst:1825 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:833 +#: ../../whatsnew/3.12.rst:913 msgid "" ":func:`sys.setrecursionlimit` and :func:`sys.getrecursionlimit`. The " "recursion limit now applies only to Python code. Builtin functions do not " @@ -1056,27 +1200,27 @@ msgid "" "prevents recursion from causing a virtual machine crash." msgstr "" -#: ../../whatsnew/3.12.rst:839 +#: ../../whatsnew/3.12.rst:919 msgid "tempfile" msgstr "tempfile" -#: ../../whatsnew/3.12.rst:841 +#: ../../whatsnew/3.12.rst:921 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:843 +#: ../../whatsnew/3.12.rst:923 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:849 +#: ../../whatsnew/3.12.rst:929 msgid "threading" msgstr "threading" -#: ../../whatsnew/3.12.rst:851 +#: ../../whatsnew/3.12.rst:931 msgid "" "Add :func:`threading.settrace_all_threads` and :func:`threading." "setprofile_all_threads` that allow to set tracing and profiling functions in " @@ -1084,11 +1228,11 @@ msgid "" "Galindo in :gh:`93503`.)" msgstr "" -#: ../../whatsnew/3.12.rst:857 +#: ../../whatsnew/3.12.rst:937 msgid "tkinter" msgstr "tkinter" -#: ../../whatsnew/3.12.rst:859 +#: ../../whatsnew/3.12.rst:939 msgid "" "``tkinter.Canvas.coords()`` now flattens its arguments. It now accepts not " "only coordinates as separate arguments (``x1, y1, x2, y2, ...``) and a " @@ -1098,34 +1242,34 @@ msgid "" "in :gh:`94473`.)" msgstr "" -#: ../../whatsnew/3.12.rst:868 +#: ../../whatsnew/3.12.rst:948 msgid "tokenize" msgstr "tokenize" -#: ../../whatsnew/3.12.rst:870 +#: ../../whatsnew/3.12.rst:950 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 :" +"(Contributed by Marta Gómez Macías and Pablo Galindo in :gh:`102856`.) See :" "ref:`whatsnew312-porting-to-python312` for more information on the changes " "to the :mod:`tokenize` module." msgstr "" -#: ../../whatsnew/3.12.rst:876 +#: ../../whatsnew/3.12.rst:956 msgid "types" msgstr "types" -#: ../../whatsnew/3.12.rst:878 +#: ../../whatsnew/3.12.rst:958 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:883 +#: ../../whatsnew/3.12.rst:963 msgid "typing" msgstr "typing" -#: ../../whatsnew/3.12.rst:885 +#: ../../whatsnew/3.12.rst:965 msgid "" ":func:`isinstance` checks against :func:`runtime-checkable protocols ` now use :func:`inspect.getattr_static` rather than :func:" @@ -1138,7 +1282,7 @@ msgid "" "affected by this change. (Contributed by Alex Waygood in :gh:`102433`.)" msgstr "" -#: ../../whatsnew/3.12.rst:896 +#: ../../whatsnew/3.12.rst:976 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 " @@ -1146,13 +1290,13 @@ msgid "" "on :func:`isinstance` checks comparing objects to the protocol. For example::" msgstr "" -#: ../../whatsnew/3.12.rst:918 +#: ../../whatsnew/3.12.rst:998 msgid "" "This change was made in order to speed up ``isinstance()`` checks against " "runtime-checkable protocols." msgstr "" -#: ../../whatsnew/3.12.rst:921 +#: ../../whatsnew/3.12.rst:1001 msgid "" "The performance profile of :func:`isinstance` checks against :func:`runtime-" "checkable protocols ` has changed significantly. " @@ -1163,71 +1307,71 @@ msgid "" "in :gh:`74690` and :gh:`103193`.)" msgstr "" -#: ../../whatsnew/3.12.rst:929 +#: ../../whatsnew/3.12.rst:1009 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:933 +#: ../../whatsnew/3.12.rst:1013 msgid "" "Add ``frozen_default`` parameter to :func:`typing.dataclass_transform`. " "(Contributed by Erik De Bonte in :gh:`99957`.)" msgstr "" -#: ../../whatsnew/3.12.rst:937 +#: ../../whatsnew/3.12.rst:1017 msgid "unicodedata" msgstr "unicodedata" -#: ../../whatsnew/3.12.rst:939 +#: ../../whatsnew/3.12.rst:1019 msgid "" "The Unicode database has been updated to version 15.0.0. (Contributed by " "Benjamin Peterson in :gh:`96734`)." msgstr "" -#: ../../whatsnew/3.12.rst:943 ../../whatsnew/3.12.rst:1502 +#: ../../whatsnew/3.12.rst:1023 ../../whatsnew/3.12.rst:1678 msgid "unittest" msgstr "unittest" -#: ../../whatsnew/3.12.rst:945 +#: ../../whatsnew/3.12.rst:1025 msgid "" -"Added ``--durations`` command line option, showing the N slowest test cases::" +"Add a ``--durations`` command line option, showing the N slowest test cases::" msgstr "" -#: ../../whatsnew/3.12.rst:961 -msgid "(Contributed by Giampaolo Rodola in :issue:`4080`)" -msgstr "(由 Giampaolo Rodola 於 :issue:`4080` 中貢獻。)" +#: ../../whatsnew/3.12.rst:1041 +msgid "(Contributed by Giampaolo Rodola in :gh:`48330`)" +msgstr "" -#: ../../whatsnew/3.12.rst:964 +#: ../../whatsnew/3.12.rst:1044 msgid "uuid" msgstr "uuid" -#: ../../whatsnew/3.12.rst:966 +#: ../../whatsnew/3.12.rst:1046 msgid "" "Add a :ref:`command-line interface `. (Contributed by Adam Chhina " "in :gh:`88597`.)" msgstr "" -#: ../../whatsnew/3.12.rst:971 +#: ../../whatsnew/3.12.rst:1051 msgid "Optimizations" msgstr "最佳化" -#: ../../whatsnew/3.12.rst:973 +#: ../../whatsnew/3.12.rst:1053 msgid "" -"Removed ``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`.)" +"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:977 +#: ../../whatsnew/3.12.rst:1057 msgid "" -"Added experimental support for using the BOLT binary optimizer in the build " +"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 Dong-hee Na in :gh:`101525`)" +"Modzelewski in :gh:`90536` and tuned by Donghee Na in :gh:`101525`)" msgstr "" -#: ../../whatsnew/3.12.rst:981 +#: ../../whatsnew/3.12.rst:1061 msgid "" "Speed up the regular expression substitution (functions :func:`re.sub` and :" "func:`re.subn` and corresponding :class:`!re.Pattern` methods) for " @@ -1235,13 +1379,13 @@ msgid "" "by Serhiy Storchaka in :gh:`91524`.)" msgstr "" -#: ../../whatsnew/3.12.rst:986 +#: ../../whatsnew/3.12.rst:1066 msgid "" "Speed up :class:`asyncio.Task` creation by deferring expensive string " -"formatting. (Contributed by Itamar O in :gh:`103793`.)" +"formatting. (Contributed by Itamar Oren in :gh:`103793`.)" msgstr "" -#: ../../whatsnew/3.12.rst:989 +#: ../../whatsnew/3.12.rst:1069 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:" @@ -1249,134 +1393,345 @@ msgid "" "Pablo Galindo in :gh:`102856`.)" msgstr "" -#: ../../whatsnew/3.12.rst:994 +#: ../../whatsnew/3.12.rst:1074 +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:1080 +msgid "CPython bytecode changes" +msgstr "" + +#: ../../whatsnew/3.12.rst:1082 +msgid "" +"Remove the :opcode:`!LOAD_METHOD` instruction. It has been merged into :" +"opcode:`LOAD_ATTR`. :opcode:`LOAD_ATTR` will now behave like the old :opcode:" +"`!LOAD_METHOD` instruction if the low bit of its oparg is set. (Contributed " +"by Ken Jin in :gh:`93429`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1087 +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:1090 +msgid "" +"Remove the :opcode:`!PRECALL` instruction. (Contributed by Mark Shannon in :" +"gh:`92925`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1093 +msgid "" +"Add the :opcode:`BINARY_SLICE` and :opcode:`STORE_SLICE` instructions. " +"(Contributed by Mark Shannon in :gh:`94163`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1096 +msgid "" +"Add the :opcode:`CALL_INTRINSIC_1` instructions. (Contributed by Mark " +"Shannon in :gh:`99005`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1099 +msgid "" +"Add the :opcode:`CALL_INTRINSIC_2` instruction. (Contributed by Irit Katriel " +"in :gh:`101799`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1102 +msgid "" +"Add the :opcode:`CLEANUP_THROW` instruction. (Contributed by Brandt Bucher " +"in :gh:`90997`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1105 +msgid "" +"Add the :opcode:`!END_SEND` instruction. (Contributed by Mark Shannon in :gh:" +"`103082`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1108 +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:1111 +msgid "" +"Add the :opcode:`LOAD_FAST_CHECK` instruction. (Contributed by Dennis " +"Sweeney in :gh:`93143`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1114 +msgid "" +"Add the :opcode:`LOAD_FROM_DICT_OR_DEREF`, :opcode:" +"`LOAD_FROM_DICT_OR_GLOBALS`, and :opcode:`LOAD_LOCALS` opcodes as part of " +"the implementation of :pep:`695`. Remove the :opcode:`!LOAD_CLASSDEREF` " +"opcode, which can be replaced with :opcode:`LOAD_LOCALS` plus :opcode:" +"`LOAD_FROM_DICT_OR_DEREF`. (Contributed by Jelle Zijlstra in :gh:`103764`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1120 +msgid "" +"Add the :opcode:`LOAD_SUPER_ATTR` instruction. (Contributed by Carl Meyer " +"and Vladimir Matveev in :gh:`103497`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1123 +msgid "" +"Add the :opcode:`RETURN_CONST` instruction. (Contributed by Wenyang Wang in :" +"gh:`101632`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1126 +msgid "Demos and Tools" +msgstr "" + +#: ../../whatsnew/3.12.rst:1128 +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:1133 +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:1140 ../../whatsnew/3.12.rst:2219 +msgid "Deprecated" +msgstr "已棄用" + +#: ../../whatsnew/3.12.rst:1142 +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:1147 +msgid "" +":mod:`ast`: The following :mod:`ast` features have been deprecated in " +"documentation since Python 3.8, now cause a :exc:`DeprecationWarning` to be " +"emitted at runtime when they are accessed or used, and will be removed in " +"Python 3.14:" +msgstr "" + +#: ../../whatsnew/3.12.rst:1151 ../../whatsnew/3.12.rst:1383 +msgid ":class:`!ast.Num`" +msgstr ":class:`!ast.Num`" + +#: ../../whatsnew/3.12.rst:1152 ../../whatsnew/3.12.rst:1384 +msgid ":class:`!ast.Str`" +msgstr ":class:`!ast.Str`" + +#: ../../whatsnew/3.12.rst:1153 ../../whatsnew/3.12.rst:1385 +msgid ":class:`!ast.Bytes`" +msgstr ":class:`!ast.Bytes`" + +#: ../../whatsnew/3.12.rst:1154 ../../whatsnew/3.12.rst:1386 +msgid ":class:`!ast.NameConstant`" +msgstr ":class:`!ast.NameConstant`" + +#: ../../whatsnew/3.12.rst:1155 ../../whatsnew/3.12.rst:1387 +msgid ":class:`!ast.Ellipsis`" +msgstr ":class:`!ast.Ellipsis`" + +#: ../../whatsnew/3.12.rst:1157 +msgid "" +"Use :class:`ast.Constant` instead. (Contributed by Serhiy Storchaka in :gh:" +"`90953`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1160 ../../whatsnew/3.12.rst:1389 +msgid ":mod:`asyncio`:" +msgstr "" + +#: ../../whatsnew/3.12.rst:1162 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`.)" +"The child watcher classes :class:`asyncio.MultiLoopChildWatcher`, :class:" +"`asyncio.FastChildWatcher`, :class:`asyncio.AbstractChildWatcher` and :class:" +"`asyncio.SafeChildWatcher` are deprecated and will be removed in Python " +"3.14. (Contributed by Kumar Aditya in :gh:`94597`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1000 -msgid "CPython bytecode changes" +#: ../../whatsnew/3.12.rst:1168 +msgid "" +":func:`asyncio.set_child_watcher`, :func:`asyncio.get_child_watcher`, :meth:" +"`asyncio.AbstractEventLoopPolicy.set_child_watcher` and :meth:`asyncio." +"AbstractEventLoopPolicy.get_child_watcher` are deprecated and will be " +"removed in Python 3.14. (Contributed by Kumar Aditya in :gh:`94597`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1002 +#: ../../whatsnew/3.12.rst:1174 msgid "" -"Remove the :opcode:`LOAD_METHOD` instruction. It has been merged into :" -"opcode:`LOAD_ATTR`. :opcode:`LOAD_ATTR` will now behave like the old :opcode:" -"`LOAD_METHOD` instruction if the low bit of its oparg is set. (Contributed " -"by Ken Jin in :gh:`93429`.)" +"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 " +"and it decides to create one. (Contributed by Serhiy Storchaka and Guido van " +"Rossum in :gh:`100160`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1007 +#: ../../whatsnew/3.12.rst:1179 msgid "" -"Remove the :opcode:`!JUMP_IF_FALSE_OR_POP` and :opcode:`!" -"JUMP_IF_TRUE_OR_POP` instructions. (Contributed by Irit Katriel in :gh:" -"`102859`.)" +":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:1010 +#: ../../whatsnew/3.12.rst:1183 msgid "" -"Removed the :opcode:`!PRECALL` instruction. (Contributed by Mark Shannon in :" -"gh:`92925`.)" +":mod:`collections.abc`: Deprecated :class:`collections.abc.ByteString`. " +"Prefer :class:`Sequence` or :class:`collections.abc.Buffer`. For use in " +"typing, prefer a union, like ``bytes | bytearray``, or :class:`collections." +"abc.Buffer`. (Contributed by Shantanu Jain in :gh:`91896`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1013 +#: ../../whatsnew/3.12.rst:1188 msgid "" -"Add the :opcode:`LOAD_FAST_AND_CLEAR` instruction as part of the " -"implementation of :pep:`709`. (Contributed by Carl Meyer in :gh:`101441`.)" +":mod:`datetime`: :class:`datetime.datetime`'s :meth:`~datetime.datetime." +"utcnow` and :meth:`~datetime.datetime.utcfromtimestamp` are deprecated and " +"will be removed in a future version. Instead, use timezone-aware objects to " +"represent datetimes in UTC: respectively, call :meth:`~datetime.datetime." +"now` and :meth:`~datetime.datetime.fromtimestamp` with the *tz* parameter " +"set to :const:`datetime.UTC`. (Contributed by Paul Ganssle in :gh:`103857`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1016 +#: ../../whatsnew/3.12.rst:1196 msgid "" -"Add the :opcode:`LOAD_FROM_DICT_OR_DEREF`, :opcode:" -"`LOAD_FROM_DICT_OR_GLOBALS`, and :opcode:`LOAD_LOCALS` opcodes as part of " -"the implementation of :pep:`695`. Remove the :opcode:`!LOAD_CLASSDEREF` " -"opcode, which can be replaced with :opcode:`LOAD_LOCALS` plus :opcode:" -"`LOAD_FROM_DICT_OR_DEREF`. (Contributed by Jelle Zijlstra in :gh:`103764`.)" +":mod:`email`: Deprecate the *isdst* parameter in :func:`email.utils." +"localtime`. (Contributed by Alan Williams in :gh:`72346`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1022 +#: ../../whatsnew/3.12.rst:1199 msgid "" -"Add the :opcode:`LOAD_SUPER_ATTR` instruction. (Contributed by Carl Meyer " -"and Vladimir Matveev in :gh:`103497`.)" +":mod:`importlib.abc`: Deprecated the following classes, scheduled for " +"removal in Python 3.14:" msgstr "" -#: ../../whatsnew/3.12.rst:1026 -msgid "Demos and Tools" +#: ../../whatsnew/3.12.rst:1202 ../../whatsnew/3.12.rst:1406 +msgid ":class:`!importlib.abc.ResourceReader`" +msgstr ":class:`!importlib.abc.ResourceReader`" + +#: ../../whatsnew/3.12.rst:1203 ../../whatsnew/3.12.rst:1407 +msgid ":class:`!importlib.abc.Traversable`" +msgstr ":class:`!importlib.abc.Traversable`" + +#: ../../whatsnew/3.12.rst:1204 ../../whatsnew/3.12.rst:1408 +msgid ":class:`!importlib.abc.TraversableResources`" +msgstr ":class:`!importlib.abc.TraversableResources`" + +#: ../../whatsnew/3.12.rst:1206 +msgid "Use :mod:`importlib.resources.abc` classes instead:" msgstr "" -#: ../../whatsnew/3.12.rst:1028 +#: ../../whatsnew/3.12.rst:1208 +msgid ":class:`importlib.resources.abc.Traversable`" +msgstr ":class:`importlib.resources.abc.Traversable`" + +#: ../../whatsnew/3.12.rst:1209 +msgid ":class:`importlib.resources.abc.TraversableResources`" +msgstr ":class:`importlib.resources.abc.TraversableResources`" + +#: ../../whatsnew/3.12.rst:1211 +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:1213 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`.)" +":mod:`itertools`: Deprecate the support for copy, deepcopy, and pickle " +"operations, which is undocumented, inefficient, historically buggy, and " +"inconsistent. This will be removed in 3.14 for a significant reduction in " +"code volume and maintenance burden. (Contributed by Raymond Hettinger in :gh:" +"`101588`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1033 +#: ../../whatsnew/3.12.rst:1219 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`.)" +":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 " +"POSIX platforms where ``'fork'`` is currently the default (:gh:`84559`). " +"Adding a runtime warning about this was deemed too disruptive as the " +"majority of code is not expected to care. Use the :func:`~multiprocessing." +"get_context` or :func:`~multiprocessing.set_start_method` APIs to explicitly " +"specify when your code *requires* ``'fork'``. See :ref:`contexts and start " +"methods `." msgstr "" -#: ../../whatsnew/3.12.rst:1040 ../../whatsnew/3.12.rst:2038 -msgid "Deprecated" -msgstr "已棄用" +#: ../../whatsnew/3.12.rst:1229 +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:1042 +#: ../../whatsnew/3.12.rst:1234 msgid "" -":mod:`asyncio`: 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 and it decides to create one. (Contributed by Serhiy " -"Storchaka and Guido van Rossum in :gh:`100160`.)" +":mod:`pty`: The module has two undocumented ``master_open()`` and " +"``slave_open()`` functions that have been deprecated since Python 2 but only " +"gained a proper :exc:`DeprecationWarning` in 3.12. Remove them in 3.14. " +"(Contributed by Soumendra Ganguly and Gregory P. Smith in :gh:`85984`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1047 +#: ../../whatsnew/3.12.rst:1239 +msgid ":mod:`os`:" +msgstr "" + +#: ../../whatsnew/3.12.rst:1241 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`.)" +"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 " +"metadata change time, consistent with other platforms. For now, they still " +"contain the creation time, which is also available in the new " +"``st_birthtime`` field. (Contributed by Steve Dower in :gh:`99726`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1051 +#: ../../whatsnew/3.12.rst:1247 msgid "" -":mod:`datetime`: :class:`datetime.datetime`'s :meth:`~datetime.datetime." -"utcnow` and :meth:`~datetime.datetime.utcfromtimestamp` are deprecated and " -"will be removed in a future version. Instead, use timezone-aware objects to " -"represent datetimes in UTC: respectively, call :meth:`~datetime.datetime." -"now` and :meth:`~datetime.datetime.fromtimestamp` with the *tz* parameter " -"set to :const:`datetime.UTC`. (Contributed by Paul Ganssle in :gh:`103857`.)" +"On POSIX platforms, :func:`os.fork` can now raise a :exc:" +"`DeprecationWarning` when it can detect being called from a multithreaded " +"process. There has always been a fundamental incompatibility with the POSIX " +"platform when doing so. Even if such code *appeared* to work. We added the " +"warning to to raise awareness as issues encounted by code doing this are " +"becoming more frequent. See the :func:`os.fork` documentation for more " +"details along with `this discussion on fork being incompatible with threads " +"`_ for *why* we're now surfacing this " +"longstanding platform compatibility problem to developers." msgstr "" -#: ../../whatsnew/3.12.rst:1059 +#: ../../whatsnew/3.12.rst:1257 msgid "" -":mod:`os`: 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 metadata change time, consistent with other platforms. For now, they " -"still contain the creation time, which is also available in the new " -"``st_birthtime`` field. (Contributed by Steve Dower in :gh:`99726`.)" +"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:1065 +#: ../../whatsnew/3.12.rst:1261 msgid "" ":mod:`shutil`: The *onerror* argument of :func:`shutil.rmtree` is deprecated " -"as will be removed in Python 3.14. Use *onexc* instead. (Contributed by Irit " -"Katriel in :gh:`102828`.)" +"and will be removed in Python 3.14. Use *onexc* instead. (Contributed by " +"Irit Katriel in :gh:`102828`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1080 +#: ../../whatsnew/3.12.rst:1264 msgid ":mod:`sqlite3`:" msgstr "" -#: ../../whatsnew/3.12.rst:1069 +#: ../../whatsnew/3.12.rst:1266 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:1075 +#: ../../whatsnew/3.12.rst:1272 msgid "" "In :meth:`~sqlite3.Cursor.execute`, :exc:`DeprecationWarning` is now emitted " "when :ref:`named placeholders ` are used together with " @@ -1386,402 +1741,355 @@ msgid "" "Erlend E. Aasland in :gh:`101698`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1082 +#: ../../whatsnew/3.12.rst:1279 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:1086 +#: ../../whatsnew/3.12.rst:1283 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:1090 +#: ../../whatsnew/3.12.rst:1287 +msgid ":mod:`typing`:" +msgstr "" + +#: ../../whatsnew/3.12.rst:1289 msgid "" -":mod:`typing`: :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`. (:gh:`94309`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1093 +#: ../../whatsnew/3.12.rst:1292 +msgid "" +":class:`typing.ByteString`, deprecated since Python 3.9, now causes a :exc:" +"`DeprecationWarning` to be emitted when it is used. (Contributed by Alex " +"Waygood in :gh:`91896`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1296 msgid "" ":mod:`xml.etree.ElementTree`: The module now emits :exc:`DeprecationWarning` " "when testing the truth value of an :class:`xml.etree.ElementTree.Element`. " "Before, the Python implementation emitted :exc:`FutureWarning`, and the C " -"implementation emitted nothing." +"implementation emitted nothing. (Contributed by Jacob Walls in :gh:`83122`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1098 +#: ../../whatsnew/3.12.rst:1302 msgid "" -"The 3-arg signatures (type, value, traceback) of :meth:`~coroutine.throw`, :" -"meth:`~generator.throw` and :meth:`~agen.athrow` are deprecated and may be " -"removed in a future version of Python. Use the single-arg versions of these " -"functions instead. (Contributed by Ofey Chan in :gh:`89874`.)" +"The 3-arg signatures (type, value, traceback) of :meth:`coroutine throw() " +"`, :meth:`generator throw() ` and :meth:" +"`async generator throw() ` are deprecated and may be removed in " +"a future version of Python. Use the single-arg versions of these functions " +"instead. (Contributed by Ofey Chan in :gh:`89874`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1103 +#: ../../whatsnew/3.12.rst:1308 msgid "" ":exc:`DeprecationWarning` is now raised when ``__package__`` on a module " "differs from ``__spec__.parent`` (previously it was :exc:`ImportWarning`). " "(Contributed by Brett Cannon in :gh:`65961`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1108 +#: ../../whatsnew/3.12.rst:1313 msgid "" -"In accordance with :pep:`699`, the ``ma_version_tag`` field in :c:type:" -"`PyDictObject` is deprecated for extension modules. Accessing this field " -"will generate a compiler warning at compile time. This field will be removed " -"in Python 3.14. (Contributed by Ramvikrams and Kumar Aditya in :gh:`101193`. " -"PEP by Ken Jin.)" +"Setting ``__package__`` or ``__cached__`` on a module is deprecated, and " +"will cease to be set or taken into consideration by the import system in " +"Python 3.14. (Contributed by Brett Cannon in :gh:`65961`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1113 +#: ../../whatsnew/3.12.rst:1317 msgid "" "The bitwise inversion operator (``~``) on bool is deprecated. It will throw " "an error in Python 3.14. Use ``not`` for logical negation of bools instead. " "In the rare case that you really need the bitwise inversion of the " -"underlying ``int``, convert to int explicitly with ``~int(x)``. (Contributed " -"by Tim Hoffmann in :gh:`103487`.)" +"underlying ``int``, convert to int explicitly: ``~int(x)``. (Contributed by " +"Tim Hoffmann in :gh:`103487`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1120 +#: ../../whatsnew/3.12.rst:1323 +msgid "" +"Accessing ``co_lnotab`` on code objects was deprecated in Python 3.10 via :" +"pep:`626`, but it only got a proper :exc:`DeprecationWarning` in 3.12, " +"therefore it will be removed in 3.14. (Contributed by Nikita Sobolev in :gh:" +"`101866`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1329 msgid "Pending Removal in Python 3.13" msgstr "" -#: ../../whatsnew/3.12.rst:1122 +#: ../../whatsnew/3.12.rst:1331 msgid "" "The following modules and APIs have been deprecated in earlier Python " "releases, and will be removed in Python 3.13." msgstr "" -#: ../../whatsnew/3.12.rst:1125 +#: ../../whatsnew/3.12.rst:1334 msgid "Modules (see :pep:`594`):" msgstr "" -#: ../../whatsnew/3.12.rst:1127 +#: ../../whatsnew/3.12.rst:1336 msgid ":mod:`aifc`" msgstr ":mod:`aifc`" -#: ../../whatsnew/3.12.rst:1128 +#: ../../whatsnew/3.12.rst:1337 msgid ":mod:`audioop`" msgstr ":mod:`audioop`" -#: ../../whatsnew/3.12.rst:1129 +#: ../../whatsnew/3.12.rst:1338 msgid ":mod:`cgi`" msgstr ":mod:`cgi`" -#: ../../whatsnew/3.12.rst:1130 +#: ../../whatsnew/3.12.rst:1339 msgid ":mod:`cgitb`" msgstr ":mod:`cgitb`" -#: ../../whatsnew/3.12.rst:1131 +#: ../../whatsnew/3.12.rst:1340 msgid ":mod:`chunk`" msgstr ":mod:`chunk`" -#: ../../whatsnew/3.12.rst:1132 +#: ../../whatsnew/3.12.rst:1341 msgid ":mod:`crypt`" msgstr ":mod:`crypt`" -#: ../../whatsnew/3.12.rst:1133 +#: ../../whatsnew/3.12.rst:1342 msgid ":mod:`imghdr`" msgstr ":mod:`imghdr`" -#: ../../whatsnew/3.12.rst:1134 +#: ../../whatsnew/3.12.rst:1343 msgid ":mod:`mailcap`" msgstr ":mod:`mailcap`" -#: ../../whatsnew/3.12.rst:1135 +#: ../../whatsnew/3.12.rst:1344 msgid ":mod:`msilib`" msgstr ":mod:`msilib`" -#: ../../whatsnew/3.12.rst:1136 +#: ../../whatsnew/3.12.rst:1345 msgid ":mod:`nis`" msgstr ":mod:`nis`" -#: ../../whatsnew/3.12.rst:1137 +#: ../../whatsnew/3.12.rst:1346 msgid ":mod:`nntplib`" msgstr ":mod:`nntplib`" -#: ../../whatsnew/3.12.rst:1138 +#: ../../whatsnew/3.12.rst:1347 msgid ":mod:`ossaudiodev`" msgstr ":mod:`ossaudiodev`" -#: ../../whatsnew/3.12.rst:1139 +#: ../../whatsnew/3.12.rst:1348 msgid ":mod:`pipes`" msgstr ":mod:`pipes`" -#: ../../whatsnew/3.12.rst:1140 +#: ../../whatsnew/3.12.rst:1349 msgid ":mod:`sndhdr`" msgstr ":mod:`sndhdr`" -#: ../../whatsnew/3.12.rst:1141 +#: ../../whatsnew/3.12.rst:1350 msgid ":mod:`spwd`" msgstr ":mod:`spwd`" -#: ../../whatsnew/3.12.rst:1142 +#: ../../whatsnew/3.12.rst:1351 msgid ":mod:`sunau`" msgstr ":mod:`sunau`" -#: ../../whatsnew/3.12.rst:1143 +#: ../../whatsnew/3.12.rst:1352 msgid ":mod:`telnetlib`" msgstr ":mod:`telnetlib`" -#: ../../whatsnew/3.12.rst:1144 +#: ../../whatsnew/3.12.rst:1353 msgid ":mod:`uu`" msgstr ":mod:`uu`" -#: ../../whatsnew/3.12.rst:1145 +#: ../../whatsnew/3.12.rst:1354 msgid ":mod:`xdrlib`" msgstr ":mod:`xdrlib`" -#: ../../whatsnew/3.12.rst:1147 +#: ../../whatsnew/3.12.rst:1356 msgid "Other modules:" msgstr "" -#: ../../whatsnew/3.12.rst:1149 +#: ../../whatsnew/3.12.rst:1358 msgid ":mod:`!lib2to3`, and the :program:`2to3` program (:gh:`84540`)" msgstr "" -#: ../../whatsnew/3.12.rst:1151 +#: ../../whatsnew/3.12.rst:1360 msgid "APIs:" msgstr "" -#: ../../whatsnew/3.12.rst:1153 +#: ../../whatsnew/3.12.rst:1362 msgid ":class:`!configparser.LegacyInterpolation` (:gh:`90765`)" msgstr ":class:`!configparser.LegacyInterpolation` (:gh:`90765`)" -#: ../../whatsnew/3.12.rst:1154 +#: ../../whatsnew/3.12.rst:1363 msgid ":func:`locale.getdefaultlocale` (:gh:`90817`)" msgstr ":func:`locale.getdefaultlocale` (:gh:`90817`)" -#: ../../whatsnew/3.12.rst:1155 +#: ../../whatsnew/3.12.rst:1364 msgid ":meth:`!turtle.RawTurtle.settiltangle` (:gh:`50096`)" msgstr ":meth:`!turtle.RawTurtle.settiltangle` (:gh:`50096`)" -#: ../../whatsnew/3.12.rst:1156 +#: ../../whatsnew/3.12.rst:1365 msgid ":func:`!unittest.findTestCases` (:gh:`50096`)" msgstr ":func:`!unittest.findTestCases` (:gh:`50096`)" -#: ../../whatsnew/3.12.rst:1157 +#: ../../whatsnew/3.12.rst:1366 msgid ":func:`!unittest.getTestCaseNames` (:gh:`50096`)" msgstr ":func:`!unittest.getTestCaseNames` (:gh:`50096`)" -#: ../../whatsnew/3.12.rst:1158 +#: ../../whatsnew/3.12.rst:1367 msgid ":func:`!unittest.makeSuite` (:gh:`50096`)" msgstr ":func:`!unittest.makeSuite` (:gh:`50096`)" -#: ../../whatsnew/3.12.rst:1159 +#: ../../whatsnew/3.12.rst:1368 msgid ":meth:`!unittest.TestProgram.usageExit` (:gh:`67048`)" msgstr ":meth:`!unittest.TestProgram.usageExit` (:gh:`67048`)" -#: ../../whatsnew/3.12.rst:1160 +#: ../../whatsnew/3.12.rst:1369 msgid ":class:`!webbrowser.MacOSX` (:gh:`86421`)" msgstr ":class:`!webbrowser.MacOSX` (:gh:`86421`)" -#: ../../whatsnew/3.12.rst:1161 +#: ../../whatsnew/3.12.rst:1370 msgid ":class:`classmethod` descriptor chaining (:gh:`89519`)" msgstr "" -#: ../../whatsnew/3.12.rst:1164 +#: ../../whatsnew/3.12.rst:1373 ../../whatsnew/3.12.rst:2306 msgid "Pending Removal in Python 3.14" msgstr "" -#: ../../whatsnew/3.12.rst:1166 +#: ../../whatsnew/3.12.rst:1375 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`.)" +"The following APIs have been deprecated and will be removed in Python 3.14." msgstr "" -#: ../../whatsnew/3.12.rst:1171 +#: ../../whatsnew/3.12.rst:1378 msgid "" -":mod:`ast`: The following :mod:`ast` features have been deprecated in " -"documentation since Python 3.8, now cause a :exc:`DeprecationWarning` to be " -"emitted at runtime when they are accessed or used, and will be removed in " -"Python 3.14:" +":mod:`argparse`: The *type*, *choices*, and *metavar* parameters of :class:`!" +"argparse.BooleanOptionalAction`" msgstr "" -#: ../../whatsnew/3.12.rst:1175 -msgid ":class:`!ast.Num`" -msgstr ":class:`!ast.Num`" - -#: ../../whatsnew/3.12.rst:1176 -msgid ":class:`!ast.Str`" -msgstr ":class:`!ast.Str`" +#: ../../whatsnew/3.12.rst:1381 +msgid ":mod:`ast`:" +msgstr ":mod:`ast`:" -#: ../../whatsnew/3.12.rst:1177 -msgid ":class:`!ast.Bytes`" -msgstr ":class:`!ast.Bytes`" +#: ../../whatsnew/3.12.rst:1391 +msgid ":class:`!asyncio.MultiLoopChildWatcher`" +msgstr ":class:`!asyncio.MultiLoopChildWatcher`" -#: ../../whatsnew/3.12.rst:1178 -msgid ":class:`!ast.NameConstant`" -msgstr ":class:`!ast.NameConstant`" +#: ../../whatsnew/3.12.rst:1392 +msgid ":class:`!asyncio.FastChildWatcher`" +msgstr ":class:`!asyncio.FastChildWatcher`" -#: ../../whatsnew/3.12.rst:1179 -msgid ":class:`!ast.Ellipsis`" -msgstr ":class:`!ast.Ellipsis`" +#: ../../whatsnew/3.12.rst:1393 +msgid ":class:`!asyncio.AbstractChildWatcher`" +msgstr ":class:`!asyncio.AbstractChildWatcher`" -#: ../../whatsnew/3.12.rst:1181 -msgid "" -"Use :class:`ast.Constant` instead. (Contributed by Serhiy Storchaka in :gh:" -"`90953`.)" -msgstr "" +#: ../../whatsnew/3.12.rst:1394 +msgid ":class:`!asyncio.SafeChildWatcher`" +msgstr ":class:`!asyncio.SafeChildWatcher`" -#: ../../whatsnew/3.12.rst:1184 -msgid "" -":mod:`asyncio`: the *msg* parameter of both :meth:`asyncio.Future.cancel` " -"and :meth:`asyncio.Task.cancel` (:gh:`90985`)" -msgstr "" +#: ../../whatsnew/3.12.rst:1395 +msgid ":func:`!asyncio.set_child_watcher`" +msgstr ":func:`!asyncio.set_child_watcher`" -#: ../../whatsnew/3.12.rst:1188 -msgid "" -":mod:`collections.abc`: Deprecated :class:`collections.abc.ByteString`. " -"Prefer :class:`Sequence` or :class:`collections.abc.Buffer`. For use in " -"typing, prefer a union, like ``bytes | bytearray``, or :class:`collections." -"abc.Buffer`. (Contributed by Shantanu Jain in :gh:`91896`.)" -msgstr "" +#: ../../whatsnew/3.12.rst:1396 +msgid ":func:`!asyncio.get_child_watcher`," +msgstr ":func:`!asyncio.get_child_watcher`、" -#: ../../whatsnew/3.12.rst:1193 -msgid "" -":mod:`email`: Deprecated the *isdst* parameter in :func:`email.utils." -"localtime`. (Contributed by Alan Williams in :gh:`72346`.)" -msgstr "" +#: ../../whatsnew/3.12.rst:1397 +msgid ":meth:`!asyncio.AbstractEventLoopPolicy.set_child_watcher`" +msgstr ":meth:`!asyncio.AbstractEventLoopPolicy.set_child_watcher`" -#: ../../whatsnew/3.12.rst:1196 -msgid "" -":mod:`importlib.abc`: Deprecated the following classes, scheduled for " -"removal in Python 3.14:" -msgstr "" +#: ../../whatsnew/3.12.rst:1398 +msgid ":meth:`!asyncio.AbstractEventLoopPolicy.get_child_watcher`" +msgstr ":meth:`!asyncio.AbstractEventLoopPolicy.get_child_watcher`" -#: ../../whatsnew/3.12.rst:1199 -msgid ":class:`!importlib.abc.ResourceReader`" -msgstr ":class:`!importlib.abc.ResourceReader`" +#: ../../whatsnew/3.12.rst:1400 +msgid ":mod:`collections.abc`: :class:`!collections.abc.ByteString`." +msgstr ":mod:`collections.abc`: :class:`!collections.abc.ByteString`。" -#: ../../whatsnew/3.12.rst:1200 -msgid ":class:`!importlib.abc.Traversable`" -msgstr ":class:`!importlib.abc.Traversable`" +#: ../../whatsnew/3.12.rst:1402 +msgid ":mod:`email`: the *isdst* parameter in :func:`email.utils.localtime`." +msgstr "" -#: ../../whatsnew/3.12.rst:1201 -msgid ":class:`!importlib.abc.TraversableResources`" -msgstr ":class:`!importlib.abc.TraversableResources`" +#: ../../whatsnew/3.12.rst:1404 +msgid ":mod:`importlib.abc`:" +msgstr ":mod:`importlib.abc`:" -#: ../../whatsnew/3.12.rst:1203 -msgid "Use :mod:`importlib.resources.abc` classes instead:" +#: ../../whatsnew/3.12.rst:1410 +msgid ":mod:`itertools`: Support for copy, deepcopy, and pickle operations." msgstr "" -#: ../../whatsnew/3.12.rst:1205 -msgid ":class:`importlib.resources.abc.Traversable`" -msgstr ":class:`importlib.resources.abc.Traversable`" - -#: ../../whatsnew/3.12.rst:1206 -msgid ":class:`importlib.resources.abc.TraversableResources`" -msgstr ":class:`importlib.resources.abc.TraversableResources`" +#: ../../whatsnew/3.12.rst:1412 +msgid ":mod:`pkgutil`:" +msgstr ":mod:`pkgutil`:" -#: ../../whatsnew/3.12.rst:1208 -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:1414 +msgid ":func:`!pkgutil.find_loader`" +msgstr ":func:`!pkgutil.find_loader`" -#: ../../whatsnew/3.12.rst:1210 -msgid "" -":mod:`itertools`: The module had undocumented, inefficient, historically " -"buggy, and inconsistent support for copy, deepcopy, and pickle operations. " -"This will be removed in 3.14 for a significant reduction in code volume and " -"maintenance burden. (Contributed by Raymond Hettinger in :gh:`101588`.)" -msgstr "" +#: ../../whatsnew/3.12.rst:1415 +msgid ":func:`!pkgutil.get_loader`." +msgstr ":func:`!pkgutil.get_loader`。" -#: ../../whatsnew/3.12.rst:1216 -msgid "" -":mod:`multiprocessing`: The default :mod:`multiprocessing` start method will " -"change to a safer one on Linux, BSDs, and other non-macOS POSIX platforms " -"where ``'fork'`` is currently the default (:gh:`84559`). Adding a runtime " -"warning about this was deemed too disruptive as the majority of code is not " -"expected to care. Use the :func:`~multiprocessing.get_context` or :func:" -"`~multiprocessing.set_start_method` APIs to explicitly specify when your " -"code *requires* ``'fork'``. See :ref:`multiprocessing-start-methods`." -msgstr "" +#: ../../whatsnew/3.12.rst:1417 +msgid ":mod:`pty`:" +msgstr ":mod:`pty`:" -#: ../../whatsnew/3.12.rst:1224 -msgid "" -":mod:`pkgutil`: :func:`pkgutil.find_loader` and :func:`pkgutil.get_loader` " -"now raise :exc:`DeprecationWarning`; use :func:`importlib.util.find_spec` " -"instead. (Contributed by Nikita Sobolev in :gh:`97850`.)" -msgstr "" +#: ../../whatsnew/3.12.rst:1419 +msgid ":func:`!pty.master_open`" +msgstr ":func:`!pty.master_open`" -#: ../../whatsnew/3.12.rst:1229 -msgid "" -":mod:`pty`: The module has two undocumented ``master_open()`` and " -"``slave_open()`` functions that have been deprecated since Python 2 but only " -"gained a proper :exc:`DeprecationWarning` in 3.12. Remove them in 3.14." -msgstr "" +#: ../../whatsnew/3.12.rst:1420 +msgid ":func:`!pty.slave_open`" +msgstr ":func:`!pty.slave_open`" -#: ../../whatsnew/3.12.rst:1233 -msgid "" -":mod:`shutil`: The *onerror* argument of :func:`shutil.rmtree` is deprecated " -"in 3.12, and will be removed in 3.14." +#: ../../whatsnew/3.12.rst:1422 +msgid ":mod:`shutil`: The *onerror* argument of :func:`shutil.rmtree`" msgstr "" -#: ../../whatsnew/3.12.rst:1236 -msgid "" -":mod:`typing`: :class:`typing.ByteString`, deprecated since Python 3.9, now " -"causes a :exc:`DeprecationWarning` to be emitted when it is used." -msgstr "" +#: ../../whatsnew/3.12.rst:1424 +msgid ":mod:`typing`: :class:`!typing.ByteString`" +msgstr ":mod:`typing`::class:`!typing.ByteString`" -#: ../../whatsnew/3.12.rst:1239 +#: ../../whatsnew/3.12.rst:1426 msgid "" ":mod:`xml.etree.ElementTree`: Testing the truth value of an :class:`xml." -"etree.ElementTree.Element` is deprecated and will raise an exception in " -"Python 3.14." -msgstr "" - -#: ../../whatsnew/3.12.rst:1242 -msgid "" -"Creating immutable types (:c:macro:`Py_TPFLAGS_IMMUTABLETYPE`) with mutable " -"bases using the C API (:gh:`95388`)." -msgstr "" - -#: ../../whatsnew/3.12.rst:1245 -msgid "" -"``__package__`` and ``__cached__`` will cease to be set or taken into " -"consideration by the import system (:gh:`97879`)." +"etree.ElementTree.Element`." msgstr "" -#: ../../whatsnew/3.12.rst:1248 -msgid "" -"Accessing ``co_lnotab`` was deprecated in :pep:`626` since 3.10 and was " -"planned to be removed in 3.12 but it only got a proper :exc:" -"`DeprecationWarning` in 3.12. May be removed in 3.14. (Contributed by Nikita " -"Sobolev in :gh:`101866`.)" +#: ../../whatsnew/3.12.rst:1428 +msgid "The ``__package__`` and ``__cached__`` attributes on module objects." msgstr "" -#: ../../whatsnew/3.12.rst:1254 -msgid "" -"Creating :c:data:`immutable types ` with mutable " -"bases using the C API (:gh:`95388`)" +#: ../../whatsnew/3.12.rst:1430 +msgid "The ``co_lnotab`` attribute of code objects." msgstr "" -#: ../../whatsnew/3.12.rst:1258 +#: ../../whatsnew/3.12.rst:1433 ../../whatsnew/3.12.rst:2361 msgid "Pending Removal in Future Versions" msgstr "" -#: ../../whatsnew/3.12.rst:1260 +#: ../../whatsnew/3.12.rst:1435 msgid "" "The following APIs were deprecated in earlier Python versions and will be " "removed, although there is currently no date scheduled for their removal." msgstr "" -#: ../../whatsnew/3.12.rst:1263 +#: ../../whatsnew/3.12.rst:1438 msgid ":mod:`array`'s ``'u'`` format code (:gh:`57281`)" msgstr "" -#: ../../whatsnew/3.12.rst:1265 +#: ../../whatsnew/3.12.rst:1440 msgid ":class:`typing.Text` (:gh:`92332`)" msgstr ":class:`typing.Text` (:gh:`92332`)" -#: ../../whatsnew/3.12.rst:1267 +#: ../../whatsnew/3.12.rst:1442 msgid "" "Currently Python accepts numeric literals immediately followed by keywords, " "for example ``0in x``, ``1or x``, ``0if 1else 2``. It allows confusing and " @@ -1793,54 +2101,54 @@ msgid "" "syntax error. (:gh:`87999`)" msgstr "" -#: ../../whatsnew/3.12.rst:1278 ../../whatsnew/3.12.rst:2120 +#: ../../whatsnew/3.12.rst:1453 ../../whatsnew/3.12.rst:2393 msgid "Removed" msgstr "已移除" -#: ../../whatsnew/3.12.rst:1281 +#: ../../whatsnew/3.12.rst:1456 msgid "asynchat and asyncore" -msgstr "" +msgstr "asynchat 和 asyncore" -#: ../../whatsnew/3.12.rst:1283 +#: ../../whatsnew/3.12.rst:1458 msgid "" "These two modules have been removed according to the schedule in :pep:`594`, " "having been deprecated in Python 3.6. Use :mod:`asyncio` instead. " "(Contributed by Nikita Sobolev in :gh:`96580`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1290 +#: ../../whatsnew/3.12.rst:1465 msgid "configparser" -msgstr "" +msgstr "configparser" -#: ../../whatsnew/3.12.rst:1292 +#: ../../whatsnew/3.12.rst:1467 msgid "" "Several names deprecated in the :mod:`configparser` way back in 3.2 have " "been removed per :gh:`89336`:" msgstr "" -#: ../../whatsnew/3.12.rst:1295 +#: ../../whatsnew/3.12.rst:1470 msgid "" ":class:`configparser.ParsingError` no longer has a ``filename`` attribute or " "argument. Use the ``source`` attribute and argument instead." msgstr "" -#: ../../whatsnew/3.12.rst:1297 +#: ../../whatsnew/3.12.rst:1472 msgid "" ":mod:`configparser` no longer has a ``SafeConfigParser`` class. Use the " "shorter :class:`~configparser.ConfigParser` name instead." msgstr "" -#: ../../whatsnew/3.12.rst:1299 +#: ../../whatsnew/3.12.rst:1474 msgid "" ":class:`configparser.ConfigParser` no longer has a ``readfp`` method. Use :" "meth:`~configparser.ConfigParser.read_file` instead." msgstr "" -#: ../../whatsnew/3.12.rst:1303 +#: ../../whatsnew/3.12.rst:1478 msgid "distutils" -msgstr "" +msgstr "distutils" -#: ../../whatsnew/3.12.rst:1305 +#: ../../whatsnew/3.12.rst:1480 msgid "" "Remove the :py:mod:`!distutils` package. It was deprecated in Python 3.10 " "by :pep:`632` \"Deprecate distutils module\". For projects still using " @@ -1849,17 +2157,17 @@ msgid "" "Victor Stinner in :gh:`92584`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1312 +#: ../../whatsnew/3.12.rst:1487 msgid "ensurepip" -msgstr "" +msgstr "ensurepip" -#: ../../whatsnew/3.12.rst:1314 +#: ../../whatsnew/3.12.rst:1489 msgid "" "Remove the bundled setuptools wheel from :mod:`ensurepip`, and stop " "installing setuptools in environments created by :mod:`venv`." msgstr "" -#: ../../whatsnew/3.12.rst:1317 +#: ../../whatsnew/3.12.rst:1492 msgid "" "``pip (>= 22.1)`` does not require setuptools to be installed in the " "environment. ``setuptools``-based (and ``distutils``-based) packages can " @@ -1867,7 +2175,7 @@ msgid "" "the build environment it uses for building a package." msgstr "" -#: ../../whatsnew/3.12.rst:1323 +#: ../../whatsnew/3.12.rst:1498 msgid "" "``easy_install``, ``pkg_resources``, ``setuptools`` and ``distutils`` are no " "longer provided by default in environments created with ``venv`` or " @@ -1877,35 +2185,35 @@ msgid "" "(typically, using pip)." msgstr "" -#: ../../whatsnew/3.12.rst:1330 +#: ../../whatsnew/3.12.rst:1505 msgid "(Contributed by Pradyun Gedam in :gh:`95299`.)" msgstr "(由 Pradyun Gedam 於 :gh:`95299` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1333 +#: ../../whatsnew/3.12.rst:1508 msgid "enum" -msgstr "" +msgstr "enum" -#: ../../whatsnew/3.12.rst:1335 +#: ../../whatsnew/3.12.rst:1510 msgid "" "Remove :mod:`enum`'s ``EnumMeta.__getattr__``, which is no longer needed for " "enum attribute access. (Contributed by Ethan Furman in :gh:`95083`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1340 +#: ../../whatsnew/3.12.rst:1515 msgid "ftplib" -msgstr "" +msgstr "ftplib" -#: ../../whatsnew/3.12.rst:1342 +#: ../../whatsnew/3.12.rst:1517 msgid "" "Remove :mod:`ftplib`'s ``FTP_TLS.ssl_version`` class attribute: use the " "*context* parameter instead. (Contributed by Victor Stinner in :gh:`94172`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1347 +#: ../../whatsnew/3.12.rst:1522 msgid "gzip" -msgstr "" +msgstr "gzip" -#: ../../whatsnew/3.12.rst:1349 +#: ../../whatsnew/3.12.rst:1524 msgid "" "Remove the ``filename`` attribute of :mod:`gzip`'s :class:`gzip.GzipFile`, " "deprecated since Python 2.6, use the :attr:`~gzip.GzipFile.name` attribute " @@ -1914,11 +2222,11 @@ msgid "" "`94196`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1356 +#: ../../whatsnew/3.12.rst:1531 msgid "hashlib" -msgstr "" +msgstr "hashlib" -#: ../../whatsnew/3.12.rst:1358 +#: ../../whatsnew/3.12.rst:1533 msgid "" "Remove the pure Python implementation of :mod:`hashlib`'s :func:`hashlib." "pbkdf2_hmac()`, deprecated in Python 3.10. Python 3.10 and newer requires " @@ -1927,183 +2235,191 @@ msgid "" "Stinner in :gh:`94199`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1365 ../../whatsnew/3.12.rst:1392 +#: ../../whatsnew/3.12.rst:1540 ../../whatsnew/3.12.rst:1567 msgid "importlib" msgstr "importlib" -#: ../../whatsnew/3.12.rst:1367 +#: ../../whatsnew/3.12.rst:1542 msgid "" "Many previously deprecated cleanups in :mod:`importlib` have now been " "completed:" msgstr "" -#: ../../whatsnew/3.12.rst:1370 +#: ../../whatsnew/3.12.rst:1545 msgid "" "References to, and support for :meth:`!module_repr()` has been removed. " "(Contributed by Barry Warsaw in :gh:`97850`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1373 +#: ../../whatsnew/3.12.rst:1548 msgid "" "``importlib.util.set_package``, ``importlib.util.set_loader`` and " "``importlib.util.module_for_loader`` have all been removed. (Contributed by " "Brett Cannon and Nikita Sobolev in :gh:`65961` and :gh:`97850`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1377 +#: ../../whatsnew/3.12.rst:1552 msgid "" "Support for ``find_loader()`` and ``find_module()`` APIs have been removed. " "(Contributed by Barry Warsaw in :gh:`98040`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1380 +#: ../../whatsnew/3.12.rst:1555 msgid "" "``importlib.abc.Finder``, ``pkgutil.ImpImporter``, and ``pkgutil.ImpLoader`` " "have been removed. (Contributed by Barry Warsaw in :gh:`98040`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1384 ../../whatsnew/3.12.rst:1392 +#: ../../whatsnew/3.12.rst:1559 ../../whatsnew/3.12.rst:1567 msgid "imp" msgstr "imp" -#: ../../whatsnew/3.12.rst:1386 +#: ../../whatsnew/3.12.rst:1561 msgid "" "The :mod:`!imp` module has been removed. (Contributed by Barry Warsaw in :" "gh:`98040`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1389 -msgid "Replace removed :mod:`!imp` functions with :mod:`importlib` functions:" +#: ../../whatsnew/3.12.rst:1564 +msgid "To migrate, consult the following correspondence table:" msgstr "" -#: ../../whatsnew/3.12.rst:1394 +#: ../../whatsnew/3.12.rst:1569 msgid "``imp.NullImporter``" msgstr "``imp.NullImporter``" -#: ../../whatsnew/3.12.rst:1394 +#: ../../whatsnew/3.12.rst:1569 msgid "Insert ``None`` into ``sys.path_importer_cache``" msgstr "" -#: ../../whatsnew/3.12.rst:1395 +#: ../../whatsnew/3.12.rst:1570 msgid "``imp.cache_from_source()``" msgstr "``imp.cache_from_source()``" -#: ../../whatsnew/3.12.rst:1395 +#: ../../whatsnew/3.12.rst:1570 msgid ":func:`importlib.util.cache_from_source`" msgstr ":func:`importlib.util.cache_from_source`" -#: ../../whatsnew/3.12.rst:1396 +#: ../../whatsnew/3.12.rst:1571 msgid "``imp.find_module()``" msgstr "``imp.find_module()``" -#: ../../whatsnew/3.12.rst:1396 +#: ../../whatsnew/3.12.rst:1571 msgid ":func:`importlib.util.find_spec`" msgstr ":func:`importlib.util.find_spec`" -#: ../../whatsnew/3.12.rst:1397 +#: ../../whatsnew/3.12.rst:1572 msgid "``imp.get_magic()``" msgstr "``imp.get_magic()``" -#: ../../whatsnew/3.12.rst:1397 +#: ../../whatsnew/3.12.rst:1572 msgid ":attr:`importlib.util.MAGIC_NUMBER`" msgstr ":attr:`importlib.util.MAGIC_NUMBER`" -#: ../../whatsnew/3.12.rst:1398 +#: ../../whatsnew/3.12.rst:1573 msgid "``imp.get_suffixes()``" msgstr "``imp.get_suffixes()``" -#: ../../whatsnew/3.12.rst:1398 +#: ../../whatsnew/3.12.rst:1573 msgid "" ":attr:`importlib.machinery.SOURCE_SUFFIXES`, :attr:`importlib.machinery." "EXTENSION_SUFFIXES`, and :attr:`importlib.machinery.BYTECODE_SUFFIXES`" msgstr "" -#: ../../whatsnew/3.12.rst:1399 +#: ../../whatsnew/3.12.rst:1574 msgid "``imp.get_tag()``" msgstr "``imp.get_tag()``" -#: ../../whatsnew/3.12.rst:1399 +#: ../../whatsnew/3.12.rst:1574 msgid ":attr:`sys.implementation.cache_tag `" msgstr ":attr:`sys.implementation.cache_tag `" -#: ../../whatsnew/3.12.rst:1400 +#: ../../whatsnew/3.12.rst:1575 msgid "``imp.load_module()``" msgstr "``imp.load_module()``" -#: ../../whatsnew/3.12.rst:1400 +#: ../../whatsnew/3.12.rst:1575 msgid ":func:`importlib.import_module`" msgstr ":func:`importlib.import_module`" -#: ../../whatsnew/3.12.rst:1401 +#: ../../whatsnew/3.12.rst:1576 msgid "``imp.new_module(name)``" msgstr "``imp.new_module(name)``" -#: ../../whatsnew/3.12.rst:1401 +#: ../../whatsnew/3.12.rst:1576 msgid "``types.ModuleType(name)``" msgstr "``types.ModuleType(name)``" -#: ../../whatsnew/3.12.rst:1402 +#: ../../whatsnew/3.12.rst:1577 msgid "``imp.reload()``" msgstr "``imp.reload()``" -#: ../../whatsnew/3.12.rst:1402 +#: ../../whatsnew/3.12.rst:1577 msgid ":func:`importlib.reload`" msgstr ":func:`importlib.reload`" -#: ../../whatsnew/3.12.rst:1403 +#: ../../whatsnew/3.12.rst:1578 msgid "``imp.source_from_cache()``" msgstr "``imp.source_from_cache()``" -#: ../../whatsnew/3.12.rst:1403 +#: ../../whatsnew/3.12.rst:1578 msgid ":func:`importlib.util.source_from_cache`" msgstr ":func:`importlib.util.source_from_cache`" -#: ../../whatsnew/3.12.rst:1406 +#: ../../whatsnew/3.12.rst:1579 +msgid "``imp.load_source()``" +msgstr "``imp.load_source()``" + +#: ../../whatsnew/3.12.rst:1579 +msgid "*See below*" +msgstr "" + +#: ../../whatsnew/3.12.rst:1582 msgid "Replace ``imp.load_source()`` with::" msgstr "" -#: ../../whatsnew/3.12.rst:1421 -msgid "Removed :mod:`!imp` functions and attributes with no replacements:" +#: ../../whatsnew/3.12.rst:1597 +msgid "Remove :mod:`!imp` functions and attributes with no replacements:" msgstr "" -#: ../../whatsnew/3.12.rst:1423 -msgid "undocumented functions:" +#: ../../whatsnew/3.12.rst:1599 +msgid "Undocumented functions:" msgstr "" -#: ../../whatsnew/3.12.rst:1425 +#: ../../whatsnew/3.12.rst:1601 msgid "``imp.init_builtin()``" msgstr "``imp.init_builtin()``" -#: ../../whatsnew/3.12.rst:1426 +#: ../../whatsnew/3.12.rst:1602 msgid "``imp.load_compiled()``" msgstr "``imp.load_compiled()``" -#: ../../whatsnew/3.12.rst:1427 +#: ../../whatsnew/3.12.rst:1603 msgid "``imp.load_dynamic()``" msgstr "``imp.load_dynamic()``" -#: ../../whatsnew/3.12.rst:1428 +#: ../../whatsnew/3.12.rst:1604 msgid "``imp.load_package()``" msgstr "``imp.load_package()``" -#: ../../whatsnew/3.12.rst:1430 +#: ../../whatsnew/3.12.rst:1606 msgid "" "``imp.lock_held()``, ``imp.acquire_lock()``, ``imp.release_lock()``: the " "locking scheme has changed in Python 3.3 to per-module locks." msgstr "" -#: ../../whatsnew/3.12.rst:1432 +#: ../../whatsnew/3.12.rst:1608 msgid "" "``imp.find_module()`` constants: ``SEARCH_ERROR``, ``PY_SOURCE``, " "``PY_COMPILED``, ``C_EXTENSION``, ``PY_RESOURCE``, ``PKG_DIRECTORY``, " "``C_BUILTIN``, ``PY_FROZEN``, ``PY_CODERESOURCE``, ``IMP_HOOK``." msgstr "" -#: ../../whatsnew/3.12.rst:1437 +#: ../../whatsnew/3.12.rst:1613 msgid "io" -msgstr "" +msgstr "io" -#: ../../whatsnew/3.12.rst:1439 +#: ../../whatsnew/3.12.rst:1615 msgid "" "Remove :mod:`io`'s ``io.OpenWrapper`` and ``_pyio.OpenWrapper``, deprecated " "in Python 3.10: just use :func:`open` instead. The :func:`open` (:func:`io." @@ -2112,18 +2428,18 @@ msgid "" "`94169`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1446 +#: ../../whatsnew/3.12.rst:1622 msgid "locale" -msgstr "" +msgstr "locale" -#: ../../whatsnew/3.12.rst:1448 +#: ../../whatsnew/3.12.rst:1624 msgid "" "Remove :mod:`locale`'s :func:`!locale.format` function, deprecated in Python " "3.7: use :func:`locale.format_string` instead. (Contributed by Victor " "Stinner in :gh:`94226`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1452 +#: ../../whatsnew/3.12.rst:1628 msgid "" "``smtpd``: The 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 " @@ -2131,27 +2447,27 @@ msgid "" "Oleg Iarygin in :gh:`93243`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1463 +#: ../../whatsnew/3.12.rst:1639 msgid "" "The following undocumented :mod:`sqlite3` features, deprecated in Python " "3.10, are now removed:" msgstr "" -#: ../../whatsnew/3.12.rst:1466 +#: ../../whatsnew/3.12.rst:1642 msgid "``sqlite3.enable_shared_cache()``" msgstr "``sqlite3.enable_shared_cache()``" -#: ../../whatsnew/3.12.rst:1467 +#: ../../whatsnew/3.12.rst:1643 msgid "``sqlite3.OptimizedUnicode``" msgstr "``sqlite3.OptimizedUnicode``" -#: ../../whatsnew/3.12.rst:1469 +#: ../../whatsnew/3.12.rst:1645 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:1472 +#: ../../whatsnew/3.12.rst:1648 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 " @@ -2159,22 +2475,22 @@ msgid "" "default value which is also ``str``." msgstr "" -#: ../../whatsnew/3.12.rst:1477 +#: ../../whatsnew/3.12.rst:1653 msgid "(Contributed by Erlend E. Aasland in :gh:`92548`.)" msgstr "(由 Erlend E. Aasland 於 :gh:`92548` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1480 +#: ../../whatsnew/3.12.rst:1656 msgid "ssl" -msgstr "" +msgstr "ssl" -#: ../../whatsnew/3.12.rst:1482 +#: ../../whatsnew/3.12.rst:1658 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:1486 +#: ../../whatsnew/3.12.rst:1662 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 " @@ -2182,7 +2498,7 @@ msgid "" "Stinner in :gh:`94199`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1492 +#: ../../whatsnew/3.12.rst:1668 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." @@ -2193,189 +2509,189 @@ msgid "" "Validation. (Contributed by Victor Stinner in :gh:`94199`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1504 -msgid "Removed many old deprecated :mod:`unittest` features:" +#: ../../whatsnew/3.12.rst:1680 +msgid "Remove many long-deprecated :mod:`unittest` features:" msgstr "" -#: ../../whatsnew/3.12.rst:1506 +#: ../../whatsnew/3.12.rst:1684 msgid "A number of :class:`~unittest.TestCase` method aliases:" msgstr "" -#: ../../whatsnew/3.12.rst:1509 +#: ../../whatsnew/3.12.rst:1687 msgid "Deprecated alias" -msgstr "" +msgstr "已棄用的別名" -#: ../../whatsnew/3.12.rst:1509 +#: ../../whatsnew/3.12.rst:1687 msgid "Method Name" -msgstr "" +msgstr "方法名稱" -#: ../../whatsnew/3.12.rst:1509 +#: ../../whatsnew/3.12.rst:1687 msgid "Deprecated in" msgstr "" -#: ../../whatsnew/3.12.rst:1511 +#: ../../whatsnew/3.12.rst:1689 msgid "``failUnless``" msgstr "``failUnless``" -#: ../../whatsnew/3.12.rst:1511 ../../whatsnew/3.12.rst:1518 +#: ../../whatsnew/3.12.rst:1689 ../../whatsnew/3.12.rst:1696 msgid ":meth:`.assertTrue`" msgstr ":meth:`.assertTrue`" -#: ../../whatsnew/3.12.rst:1511 ../../whatsnew/3.12.rst:1512 -#: ../../whatsnew/3.12.rst:1513 ../../whatsnew/3.12.rst:1514 -#: ../../whatsnew/3.12.rst:1515 ../../whatsnew/3.12.rst:1516 -#: ../../whatsnew/3.12.rst:1517 +#: ../../whatsnew/3.12.rst:1689 ../../whatsnew/3.12.rst:1690 +#: ../../whatsnew/3.12.rst:1691 ../../whatsnew/3.12.rst:1692 +#: ../../whatsnew/3.12.rst:1693 ../../whatsnew/3.12.rst:1694 +#: ../../whatsnew/3.12.rst:1695 msgid "3.1" msgstr "3.1" -#: ../../whatsnew/3.12.rst:1512 +#: ../../whatsnew/3.12.rst:1690 msgid "``failIf``" msgstr "``failIf``" -#: ../../whatsnew/3.12.rst:1512 +#: ../../whatsnew/3.12.rst:1690 msgid ":meth:`.assertFalse`" msgstr ":meth:`.assertFalse`" -#: ../../whatsnew/3.12.rst:1513 +#: ../../whatsnew/3.12.rst:1691 msgid "``failUnlessEqual``" msgstr "``failUnlessEqual``" -#: ../../whatsnew/3.12.rst:1513 ../../whatsnew/3.12.rst:1519 +#: ../../whatsnew/3.12.rst:1691 ../../whatsnew/3.12.rst:1697 msgid ":meth:`.assertEqual`" msgstr ":meth:`.assertEqual`" -#: ../../whatsnew/3.12.rst:1514 +#: ../../whatsnew/3.12.rst:1692 msgid "``failIfEqual``" msgstr "``failIfEqual``" -#: ../../whatsnew/3.12.rst:1514 ../../whatsnew/3.12.rst:1520 +#: ../../whatsnew/3.12.rst:1692 ../../whatsnew/3.12.rst:1698 msgid ":meth:`.assertNotEqual`" msgstr ":meth:`.assertNotEqual`" -#: ../../whatsnew/3.12.rst:1515 +#: ../../whatsnew/3.12.rst:1693 msgid "``failUnlessAlmostEqual``" msgstr "``failUnlessAlmostEqual``" -#: ../../whatsnew/3.12.rst:1515 ../../whatsnew/3.12.rst:1521 +#: ../../whatsnew/3.12.rst:1693 ../../whatsnew/3.12.rst:1699 msgid ":meth:`.assertAlmostEqual`" msgstr ":meth:`.assertAlmostEqual`" -#: ../../whatsnew/3.12.rst:1516 +#: ../../whatsnew/3.12.rst:1694 msgid "``failIfAlmostEqual``" msgstr "``failIfAlmostEqual``" -#: ../../whatsnew/3.12.rst:1516 ../../whatsnew/3.12.rst:1522 +#: ../../whatsnew/3.12.rst:1694 ../../whatsnew/3.12.rst:1700 msgid ":meth:`.assertNotAlmostEqual`" msgstr ":meth:`.assertNotAlmostEqual`" -#: ../../whatsnew/3.12.rst:1517 +#: ../../whatsnew/3.12.rst:1695 msgid "``failUnlessRaises``" msgstr "``failUnlessRaises``" -#: ../../whatsnew/3.12.rst:1517 +#: ../../whatsnew/3.12.rst:1695 msgid ":meth:`.assertRaises`" msgstr ":meth:`.assertRaises`" -#: ../../whatsnew/3.12.rst:1518 +#: ../../whatsnew/3.12.rst:1696 msgid "``assert_``" msgstr "``assert_``" -#: ../../whatsnew/3.12.rst:1518 ../../whatsnew/3.12.rst:1519 -#: ../../whatsnew/3.12.rst:1520 ../../whatsnew/3.12.rst:1521 -#: ../../whatsnew/3.12.rst:1522 ../../whatsnew/3.12.rst:1523 -#: ../../whatsnew/3.12.rst:1524 +#: ../../whatsnew/3.12.rst:1696 ../../whatsnew/3.12.rst:1697 +#: ../../whatsnew/3.12.rst:1698 ../../whatsnew/3.12.rst:1699 +#: ../../whatsnew/3.12.rst:1700 ../../whatsnew/3.12.rst:1701 +#: ../../whatsnew/3.12.rst:1702 msgid "3.2" msgstr "3.2" -#: ../../whatsnew/3.12.rst:1519 +#: ../../whatsnew/3.12.rst:1697 msgid "``assertEquals``" msgstr "``assertEquals``" -#: ../../whatsnew/3.12.rst:1520 +#: ../../whatsnew/3.12.rst:1698 msgid "``assertNotEquals``" msgstr "``assertNotEquals``" -#: ../../whatsnew/3.12.rst:1521 +#: ../../whatsnew/3.12.rst:1699 msgid "``assertAlmostEquals``" msgstr "``assertAlmostEquals``" -#: ../../whatsnew/3.12.rst:1522 +#: ../../whatsnew/3.12.rst:1700 msgid "``assertNotAlmostEquals``" msgstr "``assertNotAlmostEquals``" -#: ../../whatsnew/3.12.rst:1523 +#: ../../whatsnew/3.12.rst:1701 msgid "``assertRegexpMatches``" msgstr "``assertRegexpMatches``" -#: ../../whatsnew/3.12.rst:1523 +#: ../../whatsnew/3.12.rst:1701 msgid ":meth:`.assertRegex`" msgstr ":meth:`.assertRegex`" -#: ../../whatsnew/3.12.rst:1524 +#: ../../whatsnew/3.12.rst:1702 msgid "``assertRaisesRegexp``" msgstr "``assertRaisesRegexp``" -#: ../../whatsnew/3.12.rst:1524 +#: ../../whatsnew/3.12.rst:1702 msgid ":meth:`.assertRaisesRegex`" msgstr ":meth:`.assertRaisesRegex`" -#: ../../whatsnew/3.12.rst:1525 +#: ../../whatsnew/3.12.rst:1703 msgid "``assertNotRegexpMatches``" msgstr "``assertNotRegexpMatches``" -#: ../../whatsnew/3.12.rst:1525 +#: ../../whatsnew/3.12.rst:1703 msgid ":meth:`.assertNotRegex`" msgstr ":meth:`.assertNotRegex`" -#: ../../whatsnew/3.12.rst:1525 +#: ../../whatsnew/3.12.rst:1703 msgid "3.5" msgstr "3.5" -#: ../../whatsnew/3.12.rst:1528 +#: ../../whatsnew/3.12.rst:1706 msgid "" "You can use https://github.com/isidentical/teyit to automatically modernise " "your unit tests." msgstr "" -#: ../../whatsnew/3.12.rst:1531 +#: ../../whatsnew/3.12.rst:1709 msgid "" "Undocumented and broken :class:`~unittest.TestCase` method " "``assertDictContainsSubset`` (deprecated in Python 3.2)." msgstr "" -#: ../../whatsnew/3.12.rst:1534 +#: ../../whatsnew/3.12.rst:1712 msgid "" "Undocumented :meth:`TestLoader.loadTestsFromModule ` parameter *use_load_tests* (deprecated and ignored " "since Python 3.2)." msgstr "" -#: ../../whatsnew/3.12.rst:1538 +#: ../../whatsnew/3.12.rst:1716 msgid "" "An alias of the :class:`~unittest.TextTestResult` class: ``_TextTestResult`` " "(deprecated in Python 3.2)." msgstr "" -#: ../../whatsnew/3.12.rst:1541 -msgid "(Contributed by Serhiy Storchaka in :issue:`45162`.)" -msgstr "(由 Serhiy Storchaka 於 :issue:`45162` 中貢獻。)" +#: ../../whatsnew/3.12.rst:1719 +msgid "(Contributed by Serhiy Storchaka in :gh:`89325`.)" +msgstr "(由 Serhiy Storchaka 於 :gh:`89325` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1544 +#: ../../whatsnew/3.12.rst:1722 msgid "webbrowser" -msgstr "" +msgstr "webbrowser" -#: ../../whatsnew/3.12.rst:1546 +#: ../../whatsnew/3.12.rst:1724 msgid "" -"Remove support for obsolete browsers from :mod:`webbrowser`. Removed " +"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:1551 +#: ../../whatsnew/3.12.rst:1729 msgid "xml.etree.ElementTree" -msgstr "" +msgstr "xml.etree.ElementTree" -#: ../../whatsnew/3.12.rst:1553 +#: ../../whatsnew/3.12.rst:1731 msgid "" "Remove the ``ElementTree.Element.copy()`` method of the pure Python " "implementation, deprecated in Python 3.10, use the :func:`copy.copy` " @@ -2384,29 +2700,30 @@ msgid "" "Stinner in :gh:`94383`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1560 +#: ../../whatsnew/3.12.rst:1738 msgid "zipimport" -msgstr "" +msgstr "zipimport" -#: ../../whatsnew/3.12.rst:1562 +#: ../../whatsnew/3.12.rst:1740 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:1568 +#: ../../whatsnew/3.12.rst:1746 msgid "Others" -msgstr "" +msgstr "其他" -#: ../../whatsnew/3.12.rst:1570 +#: ../../whatsnew/3.12.rst:1748 msgid "" -"Removed the ``suspicious`` rule from the documentation Makefile, and removed " -"``Doc/tools/rstlint.py``, both in favor of `sphinx-lint `_. (Contributed by Julien Palard in :gh:`98179`.)" +"Remove the ``suspicious`` rule from the documentation :file:`Makefile` and :" +"file:`Doc/tools/rstlint.py`, both in favor of `sphinx-lint `_. (Contributed by Julien Palard in :gh:" +"`98179`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1575 +#: ../../whatsnew/3.12.rst:1753 msgid "" "Remove the *keyfile* and *certfile* parameters from the :mod:`ftplib`, :mod:" "`imaplib`, :mod:`poplib` and :mod:`smtplib` modules, and the *key_file*, " @@ -2416,21 +2733,21 @@ msgid "" "in :gh:`94172`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1586 ../../whatsnew/3.12.rst:1898 +#: ../../whatsnew/3.12.rst:1764 ../../whatsnew/3.12.rst:2079 msgid "Porting to Python 3.12" msgstr "" -#: ../../whatsnew/3.12.rst:1588 +#: ../../whatsnew/3.12.rst:1766 msgid "" "This section lists previously described changes and other bugfixes that may " "require changes to your code." msgstr "" -#: ../../whatsnew/3.12.rst:1592 +#: ../../whatsnew/3.12.rst:1770 msgid "Changes in the Python API" msgstr "" -#: ../../whatsnew/3.12.rst:1594 +#: ../../whatsnew/3.12.rst:1772 msgid "" "More strict rules are now applied for numerical group references and group " "names in regular expressions. Only sequence of ASCII digits is now accepted " @@ -2439,9 +2756,9 @@ msgid "" "(Contributed by Serhiy Storchaka in :gh:`91760`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1601 +#: ../../whatsnew/3.12.rst:1779 msgid "" -"Removed ``randrange()`` functionality deprecated since Python 3.10. " +"Remove ``randrange()`` functionality deprecated since Python 3.10. " "Formerly, ``randrange(10.0)`` losslessly converted to ``randrange(10)``. " "Now, it raises a :exc:`TypeError`. Also, the exception raised for non-" "integer values such as ``randrange(10.5)`` or ``randrange('10')`` has been " @@ -2451,7 +2768,7 @@ msgid "" "`86388`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1609 +#: ../../whatsnew/3.12.rst:1787 msgid "" ":class:`argparse.ArgumentParser` changed encoding and error handler for " "reading arguments from file (e.g. ``fromfile_prefix_chars`` option) from " @@ -2461,21 +2778,21 @@ msgid "" "on Windows." msgstr "" -#: ../../whatsnew/3.12.rst:1615 +#: ../../whatsnew/3.12.rst:1793 msgid "" -"Removed the ``asyncore``-based ``smtpd`` module deprecated in Python 3.4.7 " +"Remove the ``asyncore``-based ``smtpd`` module deprecated in Python 3.4.7 " "and 3.5.4. A recommended replacement is the :mod:`asyncio`-based aiosmtpd_ " "PyPI module." msgstr "" -#: ../../whatsnew/3.12.rst:1619 +#: ../../whatsnew/3.12.rst:1797 msgid "" ":func:`shlex.split`: Passing ``None`` for *s* argument now raises an " "exception, rather than reading :data:`sys.stdin`. The feature was deprecated " "in Python 3.9. (Contributed by Victor Stinner in :gh:`94352`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1624 +#: ../../whatsnew/3.12.rst:1802 msgid "" "The :mod:`os` module no longer accepts bytes-like paths, like :class:" "`bytearray` and :class:`memoryview` types: only the exact :class:`bytes` " @@ -2483,7 +2800,7 @@ msgid "" "`98393`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1629 +#: ../../whatsnew/3.12.rst:1807 msgid "" ":func:`syslog.openlog` and :func:`syslog.closelog` now fail if used in " "subinterpreters. :func:`syslog.syslog` may still be used in subinterpreters, " @@ -2492,10 +2809,10 @@ msgid "" "only a very small set of users might be affected. This change helps with " "interpreter isolation. Furthermore, :mod:`syslog` is a wrapper around " "process-global resources, which are best managed from the main interpreter. " -"(Contributed by Dong-hee Na in :gh:`99127`.)" +"(Contributed by Donghee Na in :gh:`99127`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1638 +#: ../../whatsnew/3.12.rst:1816 msgid "" "The undocumented locking behavior of :func:`~functools.cached_property` is " "removed, because it locked across all instances of the class, leading to " @@ -2507,14 +2824,14 @@ msgid "" "property getter function or around multi-threaded access points." msgstr "" -#: ../../whatsnew/3.12.rst:1651 +#: ../../whatsnew/3.12.rst:1829 msgid "" "When extracting tar files using :mod:`tarfile` or :func:`shutil." "unpack_archive`, pass the *filter* argument to limit features that may be " "surprising or dangerous. See :ref:`tarfile-extraction-filter` for details." msgstr "" -#: ../../whatsnew/3.12.rst:1656 +#: ../../whatsnew/3.12.rst:1834 msgid "" "The output of the :func:`tokenize.tokenize` and :func:`tokenize." "generate_tokens` functions is now changed due to the changes introduced in :" @@ -2526,231 +2843,231 @@ msgid "" "``f\"start {1+1} end\"`` the old version of the tokenizer emitted::" msgstr "" -#: ../../whatsnew/3.12.rst:1667 +#: ../../whatsnew/3.12.rst:1845 msgid "while the new version emits::" msgstr "" -#: ../../whatsnew/3.12.rst:1679 +#: ../../whatsnew/3.12.rst:1857 msgid "" "Additionally, there may be some minor behavioral changes as a consequence of " "the changes required to support :pep:`701`. Some of these changes include:" msgstr "" -#: ../../whatsnew/3.12.rst:1682 +#: ../../whatsnew/3.12.rst:1860 msgid "" "The ``type`` attribute of the tokens emitted when tokenizing some invalid " "Python characters such as ``!`` has changed from ``ERRORTOKEN`` to ``OP``." msgstr "" -#: ../../whatsnew/3.12.rst:1685 +#: ../../whatsnew/3.12.rst:1863 msgid "" "Incomplete single-line strings now also raise :exc:`tokenize.TokenError` as " "incomplete multiline strings do." msgstr "" -#: ../../whatsnew/3.12.rst:1688 +#: ../../whatsnew/3.12.rst:1866 msgid "" "Some incomplete or invalid Python code now raises :exc:`tokenize.TokenError` " "instead of returning arbitrary ``ERRORTOKEN`` tokens when tokenizing it." msgstr "" -#: ../../whatsnew/3.12.rst:1691 +#: ../../whatsnew/3.12.rst:1869 msgid "" "Mixing tabs and spaces as indentation in the same file is not supported " "anymore and will raise a :exc:`TabError`." msgstr "" -#: ../../whatsnew/3.12.rst:1695 +#: ../../whatsnew/3.12.rst:1873 msgid "Build Changes" msgstr "" -#: ../../whatsnew/3.12.rst:1697 +#: ../../whatsnew/3.12.rst:1875 msgid "" -"Python no longer uses ``setup.py`` to build shared C extension modules. " +"Python no longer uses :file:`setup.py` to build shared C extension modules. " "Build parameters like headers and libraries are detected in ``configure`` " -"script. Extensions are built by ``Makefile``. Most extensions use ``pkg-" +"script. Extensions are built by :file:`Makefile`. Most extensions use ``pkg-" "config`` and fall back to manual detection. (Contributed by Christian Heimes " "in :gh:`93939`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1703 +#: ../../whatsnew/3.12.rst:1881 msgid "" "``va_start()`` with two parameters, like ``va_start(args, format),`` is now " "required to build Python. ``va_start()`` is no longer called with a single " "parameter. (Contributed by Kumar Aditya in :gh:`93207`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1708 +#: ../../whatsnew/3.12.rst:1886 msgid "" "CPython now uses the ThinLTO option as the default link time optimization " -"policy if the Clang compiler accepts the flag. (Contributed by Dong-hee Na " +"policy if the Clang compiler accepts the flag. (Contributed by Donghee Na " "in :gh:`89536`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1712 +#: ../../whatsnew/3.12.rst:1890 msgid "" -"Add ``COMPILEALL_OPTS`` variable in Makefile to override :mod:`compileall` " -"options (default: ``-j0``) in ``make install``. Also merged the 3 " -"``compileall`` commands into a single command to build .pyc files for all " +"Add ``COMPILEALL_OPTS`` variable in :file:`Makefile` to override :mod:" +"`compileall` options (default: ``-j0``) in ``make install``. Also merged the " +"3 ``compileall`` commands into a single command to build .pyc files for all " "optimization levels (0, 1, 2) at once. (Contributed by Victor Stinner in :gh:" "`99289`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1718 +#: ../../whatsnew/3.12.rst:1896 msgid "Add platform triplets for 64-bit LoongArch:" msgstr "" -#: ../../whatsnew/3.12.rst:1720 +#: ../../whatsnew/3.12.rst:1898 msgid "loongarch64-linux-gnusf" msgstr "loongarch64-linux-gnusf" -#: ../../whatsnew/3.12.rst:1721 +#: ../../whatsnew/3.12.rst:1899 msgid "loongarch64-linux-gnuf32" msgstr "loongarch64-linux-gnuf32" -#: ../../whatsnew/3.12.rst:1722 +#: ../../whatsnew/3.12.rst:1900 msgid "loongarch64-linux-gnu" msgstr "loongarch64-linux-gnu" -#: ../../whatsnew/3.12.rst:1724 +#: ../../whatsnew/3.12.rst:1902 msgid "(Contributed by Zhang Na in :gh:`90656`.)" msgstr "(由 Zhang Na 於 :gh:`90656` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1726 +#: ../../whatsnew/3.12.rst:1904 msgid "``PYTHON_FOR_REGEN`` now require Python 3.10 or newer." msgstr "" -#: ../../whatsnew/3.12.rst:1728 +#: ../../whatsnew/3.12.rst:1906 msgid "" "Autoconf 2.71 and aclocal 1.16.4 is now required to regenerate :file:`!" "configure`. (Contributed by Christian Heimes in :gh:`89886`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1732 +#: ../../whatsnew/3.12.rst:1910 msgid "" "Windows builds and macOS installers from python.org now use OpenSSL 3.0." msgstr "" -#: ../../whatsnew/3.12.rst:1736 +#: ../../whatsnew/3.12.rst:1914 msgid "C API Changes" msgstr "" -#: ../../whatsnew/3.12.rst:1742 +#: ../../whatsnew/3.12.rst:1921 msgid "" -":pep:`697`: Introduced the :ref:`Unstable C API tier `, " +":pep:`697`: Introduce the :ref:`Unstable C API tier `, " "intended for low-level tools like debuggers and JIT compilers. This API may " "change in each minor release of CPython without deprecation warnings. Its " "contents are marked by the ``PyUnstable_`` prefix in names." msgstr "" -#: ../../whatsnew/3.12.rst:1748 +#: ../../whatsnew/3.12.rst:1927 msgid "Code object constructors:" msgstr "" -#: ../../whatsnew/3.12.rst:1750 +#: ../../whatsnew/3.12.rst:1929 msgid "``PyUnstable_Code_New()`` (renamed from ``PyCode_New``)" msgstr "" -#: ../../whatsnew/3.12.rst:1751 +#: ../../whatsnew/3.12.rst:1930 msgid "" "``PyUnstable_Code_NewWithPosOnlyArgs()`` (renamed from " "``PyCode_NewWithPosOnlyArgs``)" msgstr "" -#: ../../whatsnew/3.12.rst:1753 +#: ../../whatsnew/3.12.rst:1932 msgid "Extra storage for code objects (:pep:`523`):" msgstr "" -#: ../../whatsnew/3.12.rst:1755 +#: ../../whatsnew/3.12.rst:1934 msgid "" "``PyUnstable_Eval_RequestCodeExtraIndex()`` (renamed from " "``_PyEval_RequestCodeExtraIndex``)" msgstr "" -#: ../../whatsnew/3.12.rst:1756 +#: ../../whatsnew/3.12.rst:1935 msgid "``PyUnstable_Code_GetExtra()`` (renamed from ``_PyCode_GetExtra``)" msgstr "" -#: ../../whatsnew/3.12.rst:1757 +#: ../../whatsnew/3.12.rst:1936 msgid "``PyUnstable_Code_SetExtra()`` (renamed from ``_PyCode_SetExtra``)" msgstr "" -#: ../../whatsnew/3.12.rst:1759 +#: ../../whatsnew/3.12.rst:1938 msgid "" "The original names will continue to be available until the respective API " "changes." msgstr "" -#: ../../whatsnew/3.12.rst:1762 +#: ../../whatsnew/3.12.rst:1941 msgid "(Contributed by Petr Viktorin in :gh:`101101`.)" msgstr "(由 Petr Viktorin 於 :gh:`101101` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1764 +#: ../../whatsnew/3.12.rst:1943 msgid "" -":pep:`697`: Added API for extending types whose instance memory layout is " +":pep:`697`: Add an API for extending types whose instance memory layout is " "opaque:" msgstr "" -#: ../../whatsnew/3.12.rst:1767 +#: ../../whatsnew/3.12.rst:1946 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:1769 +#: ../../whatsnew/3.12.rst:1948 msgid "" ":c:func:`PyObject_GetTypeData` and :c:func:`PyType_GetTypeDataSize` added to " "allow access to subclass-specific instance data." msgstr "" -#: ../../whatsnew/3.12.rst:1771 +#: ../../whatsnew/3.12.rst:1950 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:1774 +#: ../../whatsnew/3.12.rst:1953 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:1777 +#: ../../whatsnew/3.12.rst:1956 msgid "(Contributed by Petr Viktorin in :gh:`103509`.)" msgstr "(由 Petr Viktorin 於 :gh:`103509` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1779 +#: ../../whatsnew/3.12.rst:1958 msgid "" -"Added the new :ref:`limited C API ` function :c:func:" +"Add the new :ref:`limited C API ` function :c:func:" "`PyType_FromMetaclass`, which generalizes the existing :c:func:" "`PyType_FromModuleAndSpec` using an additional metaclass argument. " "(Contributed by Wenzel Jakob in :gh:`93012`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1784 +#: ../../whatsnew/3.12.rst:1963 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:1788 +#: ../../whatsnew/3.12.rst:1967 msgid ":c:macro:`Py_TPFLAGS_HAVE_VECTORCALL`" msgstr "" -#: ../../whatsnew/3.12.rst:1789 +#: ../../whatsnew/3.12.rst:1968 msgid ":c:func:`PyVectorcall_NARGS`" msgstr ":c:func:`PyVectorcall_NARGS`" -#: ../../whatsnew/3.12.rst:1790 +#: ../../whatsnew/3.12.rst:1969 msgid ":c:func:`PyVectorcall_Call`" msgstr ":c:func:`PyVectorcall_Call`" -#: ../../whatsnew/3.12.rst:1791 +#: ../../whatsnew/3.12.rst:1970 msgid ":c:type:`vectorcallfunc`" msgstr ":c:type:`vectorcallfunc`" -#: ../../whatsnew/3.12.rst:1793 +#: ../../whatsnew/3.12.rst:1972 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 " @@ -2761,7 +3078,7 @@ msgid "" "`93274`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1801 +#: ../../whatsnew/3.12.rst:1980 msgid "" "The :c:macro:`Py_TPFLAGS_MANAGED_DICT` and :c:macro:" "`Py_TPFLAGS_MANAGED_WEAKREF` flags have been added. This allows extensions " @@ -2769,47 +3086,47 @@ msgid "" "using less memory and with faster access." msgstr "" -#: ../../whatsnew/3.12.rst:1806 +#: ../../whatsnew/3.12.rst:1985 msgid "" "API for performing calls using :ref:`the vectorcall protocol ` " "was added to the :ref:`Limited API `:" msgstr "" -#: ../../whatsnew/3.12.rst:1810 +#: ../../whatsnew/3.12.rst:1989 msgid ":c:func:`PyObject_Vectorcall`" msgstr ":c:func:`PyObject_Vectorcall`" -#: ../../whatsnew/3.12.rst:1811 +#: ../../whatsnew/3.12.rst:1990 msgid ":c:func:`PyObject_VectorcallMethod`" msgstr ":c:func:`PyObject_VectorcallMethod`" -#: ../../whatsnew/3.12.rst:1812 +#: ../../whatsnew/3.12.rst:1991 msgid ":c:macro:`PY_VECTORCALL_ARGUMENTS_OFFSET`" -msgstr "" +msgstr ":c:macro:`PY_VECTORCALL_ARGUMENTS_OFFSET`" -#: ../../whatsnew/3.12.rst:1814 +#: ../../whatsnew/3.12.rst:1993 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:1818 +#: ../../whatsnew/3.12.rst:1997 msgid "" -"Added two new public functions, :c:func:`PyEval_SetProfileAllThreads` and :c:" +"Add two new public functions, :c:func:`PyEval_SetProfileAllThreads` and :c:" "func:`PyEval_SetTraceAllThreads`, that allow to set tracing and profiling " "functions in all running threads in addition to the calling one. " "(Contributed by Pablo Galindo in :gh:`93503`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1824 +#: ../../whatsnew/3.12.rst:2003 msgid "" -"Added 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`.)" +"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:1828 +#: ../../whatsnew/3.12.rst:2007 msgid "" "The C API now permits registering callbacks via :c:func:" "`PyDict_AddWatcher`, :c:func:`PyDict_Watch` and related APIs to be called " @@ -2818,28 +3135,28 @@ msgid "" "`91052`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1834 +#: ../../whatsnew/3.12.rst:2013 msgid "" -"Added :c:func:`PyType_AddWatcher` and :c:func:`PyType_Watch` API to register " +"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:1838 +#: ../../whatsnew/3.12.rst:2017 msgid "" -"Added :c:func:`PyCode_AddWatcher` and :c:func:`PyCode_ClearWatcher` APIs to " +"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 Ostricher in :gh:`91054`.)" +"code objects. (Contributed by Itamar Oren in :gh:`91054`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1843 +#: ../../whatsnew/3.12.rst:2022 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:1847 +#: ../../whatsnew/3.12.rst:2026 msgid "" "Add :c:func:`PyErr_GetRaisedException` and :c:func:" "`PyErr_SetRaisedException` for saving and restoring the current exception. " @@ -2849,14 +3166,14 @@ msgid "" "(Contributed by Mark Shannon in :gh:`101578`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1855 +#: ../../whatsnew/3.12.rst:2034 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:1859 +#: ../../whatsnew/3.12.rst:2038 msgid "" "Add :c:func:`PyException_GetArgs` and :c:func:`PyException_SetArgs` as " "convenience functions for retrieving and modifying the :attr:`~BaseException." @@ -2864,99 +3181,99 @@ msgid "" "in :gh:`101578`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1864 +#: ../../whatsnew/3.12.rst:2043 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:1868 +#: ../../whatsnew/3.12.rst:2049 msgid "" -":pep:`683`: Introduced Immortal Objects to Python which allows objects to " -"bypass reference counts and introduced changes to the C-API:" +":pep:`683`: Introduce *Immortal Objects*, which allows objects to bypass " +"reference counts, and related changes to the C-API:" msgstr "" -#: ../../whatsnew/3.12.rst:1871 +#: ../../whatsnew/3.12.rst:2052 msgid "``_Py_IMMORTAL_REFCNT``: The reference count that defines an object" msgstr "" -#: ../../whatsnew/3.12.rst:1872 +#: ../../whatsnew/3.12.rst:2053 msgid "as immortal." msgstr "" -#: ../../whatsnew/3.12.rst:1873 +#: ../../whatsnew/3.12.rst:2054 msgid "" "``_Py_IsImmortal`` Checks if an object has the immortal reference count." msgstr "" -#: ../../whatsnew/3.12.rst:1874 +#: ../../whatsnew/3.12.rst:2055 msgid "``PyObject_HEAD_INIT`` This will now initialize reference count to" msgstr "" -#: ../../whatsnew/3.12.rst:1875 +#: ../../whatsnew/3.12.rst:2056 msgid "``_Py_IMMORTAL_REFCNT`` when used with ``Py_BUILD_CORE``." msgstr "" -#: ../../whatsnew/3.12.rst:1876 +#: ../../whatsnew/3.12.rst:2057 msgid "``SSTATE_INTERNED_IMMORTAL`` An identifier for interned unicode objects" msgstr "" -#: ../../whatsnew/3.12.rst:1877 +#: ../../whatsnew/3.12.rst:2058 msgid "that are immortal." msgstr "" -#: ../../whatsnew/3.12.rst:1878 +#: ../../whatsnew/3.12.rst:2059 msgid "``SSTATE_INTERNED_IMMORTAL_STATIC`` An identifier for interned unicode" msgstr "" -#: ../../whatsnew/3.12.rst:1879 +#: ../../whatsnew/3.12.rst:2060 msgid "objects that are immortal and static" msgstr "" -#: ../../whatsnew/3.12.rst:1882 +#: ../../whatsnew/3.12.rst:2063 msgid "``sys.getunicodeinternedsize`` This returns the total number of unicode" msgstr "" -#: ../../whatsnew/3.12.rst:1881 +#: ../../whatsnew/3.12.rst:2062 msgid "" -"objects that have been interned. This is now needed for refleak.py to " -"correctly track reference counts and allocated blocks" +"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:1884 +#: ../../whatsnew/3.12.rst:2065 msgid "(Contributed by Eddie Elizondo in :gh:`84436`.)" msgstr "(由 Eddie Elizondo 於 :gh:`84436` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1886 +#: ../../whatsnew/3.12.rst:2067 msgid "" -":pep:`684`: Added the new :c:func:`Py_NewInterpreterFromConfig` function " -"and :c:type:`PyInterpreterConfig`, which may be used to create sub-" -"interpreters with their own GILs. (See :ref:`whatsnew312-pep684` for more " -"info.) (Contributed by Eric Snow in :gh:`104110`.)" +":pep:`684`: Add the new :c:func:`Py_NewInterpreterFromConfig` function and :" +"c:type:`PyInterpreterConfig`, which may be used to create sub-interpreters " +"with their own GILs. (See :ref:`whatsnew312-pep684` for more info.) " +"(Contributed by Eric Snow in :gh:`104110`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1892 +#: ../../whatsnew/3.12.rst:2073 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:1900 +#: ../../whatsnew/3.12.rst:2081 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:1903 +#: ../../whatsnew/3.12.rst:2084 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:1907 +#: ../../whatsnew/3.12.rst:2088 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 " @@ -2965,7 +3282,7 @@ msgid "" "necessary, the (internal-only) ``_PyObject_GET_WEAKREFS_LISTPTR()`` macro." msgstr "" -#: ../../whatsnew/3.12.rst:1914 +#: ../../whatsnew/3.12.rst:2095 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 " @@ -2973,13 +3290,13 @@ msgid "" "only field directly." msgstr "" -#: ../../whatsnew/3.12.rst:1919 +#: ../../whatsnew/3.12.rst:2100 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:1923 +#: ../../whatsnew/3.12.rst:2104 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 " @@ -2988,7 +3305,7 @@ msgid "" "`98836`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1929 +#: ../../whatsnew/3.12.rst:2110 msgid "" "An unrecognized format character in :c:func:`PyUnicode_FromFormat` and :c:" "func:`PyUnicode_FromFormatV` now sets a :exc:`SystemError`. In previous " @@ -2997,13 +3314,13 @@ msgid "" "Storchaka in :gh:`95781`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1935 +#: ../../whatsnew/3.12.rst:2116 msgid "" -"Fixed wrong sign placement in :c:func:`PyUnicode_FromFormat` and :c:func:" +"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:1939 +#: ../../whatsnew/3.12.rst:2120 msgid "" "Extension classes wanting to add a ``__dict__`` or weak reference slot " "should use :c:macro:`Py_TPFLAGS_MANAGED_DICT` and :c:macro:" @@ -3017,7 +3334,7 @@ msgid "" "func:`PyObject_ClearWeakRefs`, as before." msgstr "" -#: ../../whatsnew/3.12.rst:1951 +#: ../../whatsnew/3.12.rst:2132 msgid "" "The :c:func:`PyUnicode_FSDecoder` function no longer accepts bytes-like " "paths, like :class:`bytearray` and :class:`memoryview` types: only the " @@ -3025,7 +3342,7 @@ msgid "" "Victor Stinner in :gh:`98393`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1956 +#: ../../whatsnew/3.12.rst:2137 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 " @@ -3033,7 +3350,7 @@ msgid "" "Stinner in :gh:`98724`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1961 +#: ../../whatsnew/3.12.rst:2142 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 " @@ -3041,7 +3358,7 @@ msgid "" "(Contributed by Mark Shannon in :gh:`101578`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1966 +#: ../../whatsnew/3.12.rst:2147 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 " @@ -3049,25 +3366,25 @@ msgid "" "``_Py_GetGlobalRefTotal()``." msgstr "" -#: ../../whatsnew/3.12.rst:1971 +#: ../../whatsnew/3.12.rst:2152 msgid "" "The following functions now select an appropriate metaclass for the newly " "created type:" msgstr "" -#: ../../whatsnew/3.12.rst:1974 +#: ../../whatsnew/3.12.rst:2155 msgid ":c:func:`PyType_FromSpec`" msgstr ":c:func:`PyType_FromSpec`" -#: ../../whatsnew/3.12.rst:1975 +#: ../../whatsnew/3.12.rst:2156 msgid ":c:func:`PyType_FromSpecWithBases`" msgstr ":c:func:`PyType_FromSpecWithBases`" -#: ../../whatsnew/3.12.rst:1976 +#: ../../whatsnew/3.12.rst:2157 msgid ":c:func:`PyType_FromModuleAndSpec`" msgstr ":c:func:`PyType_FromModuleAndSpec`" -#: ../../whatsnew/3.12.rst:1978 +#: ../../whatsnew/3.12.rst:2159 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 " @@ -3075,14 +3392,14 @@ msgid "" "initialization." msgstr "" -#: ../../whatsnew/3.12.rst:1983 +#: ../../whatsnew/3.12.rst:2164 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:1987 +#: ../../whatsnew/3.12.rst:2168 msgid "" "Since ``tp_new`` overrides almost everything ``PyType_From*`` functions do, " "the two are incompatible with each other. The existing behavior -- ignoring " @@ -3091,17 +3408,17 @@ msgid "" "general workaround. One of the following may work for you:" msgstr "" -#: ../../whatsnew/3.12.rst:1994 +#: ../../whatsnew/3.12.rst:2175 msgid "If you control the metaclass, avoid using ``tp_new`` in it:" msgstr "" -#: ../../whatsnew/3.12.rst:1996 +#: ../../whatsnew/3.12.rst:2177 msgid "" "If initialization can be skipped, it can be done in :c:member:`~PyTypeObject." "tp_init` instead." msgstr "" -#: ../../whatsnew/3.12.rst:1998 +#: ../../whatsnew/3.12.rst:2179 msgid "" "If the metaclass doesn't need to be instantiated from Python, set its " "``tp_new`` to ``NULL`` using the :c:macro:" @@ -3109,20 +3426,20 @@ msgid "" "``PyType_From*`` functions." msgstr "" -#: ../../whatsnew/3.12.rst:2003 +#: ../../whatsnew/3.12.rst:2184 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:2007 +#: ../../whatsnew/3.12.rst:2188 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:2010 +#: ../../whatsnew/3.12.rst:2191 msgid "" ":c:var:`PyOS_InputHook` and :c:var:`PyOS_ReadlineFunctionPointer` are no " "longer called in :ref:`subinterpreters `. This is " @@ -3130,14 +3447,14 @@ msgid "" "callbacks have no way of recovering extension module state)." msgstr "" -#: ../../whatsnew/3.12.rst:2015 +#: ../../whatsnew/3.12.rst:2196 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:2019 +#: ../../whatsnew/3.12.rst:2200 msgid "" ":c:struct:`PyLongObject` has had its internals changed for better " "performance. Although the internals of :c:struct:`PyLongObject` are private, " @@ -3148,15 +3465,15 @@ msgid "" "a single machine word:" msgstr "" -#: ../../whatsnew/3.12.rst:2027 +#: ../../whatsnew/3.12.rst:2208 msgid ":c:func:`PyUnstable_Long_IsCompact`" -msgstr "" +msgstr ":c:func:`PyUnstable_Long_IsCompact`" -#: ../../whatsnew/3.12.rst:2028 +#: ../../whatsnew/3.12.rst:2209 msgid ":c:func:`PyUnstable_Long_CompactValue`" -msgstr "" +msgstr ":c:func:`PyUnstable_Long_CompactValue`" -#: ../../whatsnew/3.12.rst:2030 +#: ../../whatsnew/3.12.rst:2211 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 " @@ -3165,291 +3482,472 @@ msgid "" "create a new GitHub issue and CC ``@ericsnowcurrently``." msgstr "" -#: ../../whatsnew/3.12.rst:2040 +#: ../../whatsnew/3.12.rst:2221 +msgid "" +"In accordance with :pep:`699`, the ``ma_version_tag`` field in :c:type:" +"`PyDictObject` is deprecated for extension modules. Accessing this field " +"will generate a compiler warning at compile time. This field will be removed " +"in Python 3.14. (Contributed by Ramvikrams and Kumar Aditya in :gh:`101193`. " +"PEP by Ken Jin.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:2226 msgid "Deprecate global configuration variable:" msgstr "" -#: ../../whatsnew/3.12.rst:2042 +#: ../../whatsnew/3.12.rst:2228 ../../whatsnew/3.12.rst:2313 msgid ":c:var:`Py_DebugFlag`: use :c:member:`PyConfig.parser_debug`" msgstr "" -#: ../../whatsnew/3.12.rst:2043 +#: ../../whatsnew/3.12.rst:2229 ../../whatsnew/3.12.rst:2314 msgid ":c:var:`Py_VerboseFlag`: use :c:member:`PyConfig.verbose`" msgstr "" -#: ../../whatsnew/3.12.rst:2044 +#: ../../whatsnew/3.12.rst:2230 ../../whatsnew/3.12.rst:2315 msgid ":c:var:`Py_QuietFlag`: use :c:member:`PyConfig.quiet`" msgstr "" -#: ../../whatsnew/3.12.rst:2045 +#: ../../whatsnew/3.12.rst:2231 ../../whatsnew/3.12.rst:2316 msgid ":c:var:`Py_InteractiveFlag`: use :c:member:`PyConfig.interactive`" msgstr "" -#: ../../whatsnew/3.12.rst:2046 +#: ../../whatsnew/3.12.rst:2232 ../../whatsnew/3.12.rst:2317 msgid ":c:var:`Py_InspectFlag`: use :c:member:`PyConfig.inspect`" msgstr "" -#: ../../whatsnew/3.12.rst:2047 +#: ../../whatsnew/3.12.rst:2233 ../../whatsnew/3.12.rst:2318 msgid ":c:var:`Py_OptimizeFlag`: use :c:member:`PyConfig.optimization_level`" msgstr "" -#: ../../whatsnew/3.12.rst:2048 +#: ../../whatsnew/3.12.rst:2234 ../../whatsnew/3.12.rst:2319 msgid ":c:var:`Py_NoSiteFlag`: use :c:member:`PyConfig.site_import`" msgstr "" -#: ../../whatsnew/3.12.rst:2049 +#: ../../whatsnew/3.12.rst:2235 ../../whatsnew/3.12.rst:2320 msgid ":c:var:`Py_BytesWarningFlag`: use :c:member:`PyConfig.bytes_warning`" msgstr "" -#: ../../whatsnew/3.12.rst:2050 +#: ../../whatsnew/3.12.rst:2236 ../../whatsnew/3.12.rst:2321 msgid ":c:var:`Py_FrozenFlag`: use :c:member:`PyConfig.pathconfig_warnings`" msgstr "" -#: ../../whatsnew/3.12.rst:2051 +#: ../../whatsnew/3.12.rst:2237 ../../whatsnew/3.12.rst:2322 msgid "" ":c:var:`Py_IgnoreEnvironmentFlag`: use :c:member:`PyConfig.use_environment`" msgstr "" -#: ../../whatsnew/3.12.rst:2052 +#: ../../whatsnew/3.12.rst:2238 ../../whatsnew/3.12.rst:2323 msgid "" ":c:var:`Py_DontWriteBytecodeFlag`: use :c:member:`PyConfig.write_bytecode`" msgstr "" -#: ../../whatsnew/3.12.rst:2053 +#: ../../whatsnew/3.12.rst:2239 ../../whatsnew/3.12.rst:2324 msgid "" ":c:var:`Py_NoUserSiteDirectory`: use :c:member:`PyConfig.user_site_directory`" msgstr "" -#: ../../whatsnew/3.12.rst:2054 +#: ../../whatsnew/3.12.rst:2240 ../../whatsnew/3.12.rst:2325 msgid "" ":c:var:`Py_UnbufferedStdioFlag`: use :c:member:`PyConfig.buffered_stdio`" msgstr "" -#: ../../whatsnew/3.12.rst:2055 +#: ../../whatsnew/3.12.rst:2241 ../../whatsnew/3.12.rst:2326 msgid "" ":c:var:`Py_HashRandomizationFlag`: use :c:member:`PyConfig.use_hash_seed` " "and :c:member:`PyConfig.hash_seed`" msgstr "" -#: ../../whatsnew/3.12.rst:2057 +#: ../../whatsnew/3.12.rst:2243 ../../whatsnew/3.12.rst:2328 msgid ":c:var:`Py_IsolatedFlag`: use :c:member:`PyConfig.isolated`" msgstr "" -#: ../../whatsnew/3.12.rst:2058 +#: ../../whatsnew/3.12.rst:2244 ../../whatsnew/3.12.rst:2329 msgid "" ":c:var:`Py_LegacyWindowsFSEncodingFlag`: use :c:member:`PyPreConfig." "legacy_windows_fs_encoding`" msgstr "" -#: ../../whatsnew/3.12.rst:2059 +#: ../../whatsnew/3.12.rst:2245 ../../whatsnew/3.12.rst:2330 msgid "" ":c:var:`Py_LegacyWindowsStdioFlag`: use :c:member:`PyConfig." "legacy_windows_stdio`" msgstr "" -#: ../../whatsnew/3.12.rst:2060 +#: ../../whatsnew/3.12.rst:2246 ../../whatsnew/3.12.rst:2331 msgid "" ":c:var:`!Py_FileSystemDefaultEncoding`: use :c:member:`PyConfig." "filesystem_encoding`" msgstr "" -#: ../../whatsnew/3.12.rst:2061 +#: ../../whatsnew/3.12.rst:2247 ../../whatsnew/3.12.rst:2332 msgid "" ":c:var:`!Py_HasFileSystemDefaultEncoding`: use :c:member:`PyConfig." "filesystem_encoding`" msgstr "" -#: ../../whatsnew/3.12.rst:2062 +#: ../../whatsnew/3.12.rst:2248 ../../whatsnew/3.12.rst:2333 msgid "" ":c:var:`!Py_FileSystemDefaultEncodeErrors`: use :c:member:`PyConfig." "filesystem_errors`" msgstr "" -#: ../../whatsnew/3.12.rst:2063 +#: ../../whatsnew/3.12.rst:2249 ../../whatsnew/3.12.rst:2334 msgid "" ":c:var:`!Py_UTF8Mode`: use :c:member:`PyPreConfig.utf8_mode` (see :c:func:" "`Py_PreInitialize`)" msgstr "" -#: ../../whatsnew/3.12.rst:2065 +#: ../../whatsnew/3.12.rst:2251 msgid "" "The :c:func:`Py_InitializeFromConfig` API should be used with :c:type:" "`PyConfig` instead. (Contributed by Victor Stinner in :gh:`77782`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2069 +#: ../../whatsnew/3.12.rst:2255 msgid "" -"Creating immutable types (:c:macro:`Py_TPFLAGS_IMMUTABLETYPE`) with mutable " -"bases is deprecated and will be disabled in Python 3.14." +"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:2072 +#: ../../whatsnew/3.12.rst:2258 msgid "" -"The ``structmember.h`` header is deprecated, though it continues to be " +"The :file:`structmember.h` header is deprecated, though it continues to be " "available and there are no plans to remove it." msgstr "" -#: ../../whatsnew/3.12.rst:2075 +#: ../../whatsnew/3.12.rst:2261 msgid "" -"Its contents are now available just by including ``Python.h``, with a ``Py`` " -"prefix added if it was missing:" +"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:2078 +#: ../../whatsnew/3.12.rst:2264 msgid "" ":c:struct:`PyMemberDef`, :c:func:`PyMember_GetOne` and :c:func:" "`PyMember_SetOne`" msgstr "" +":c:struct:`PyMemberDef`、:c:func:`PyMember_GetOne` 和 :c:func:" +"`PyMember_SetOne`" -#: ../../whatsnew/3.12.rst:2080 +#: ../../whatsnew/3.12.rst:2266 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:2082 +#: ../../whatsnew/3.12.rst:2268 msgid "" "The flags :c:macro:`Py_READONLY` (previously ``READONLY``) and :c:macro:" "`Py_AUDIT_READ` (previously all uppercase)" msgstr "" -#: ../../whatsnew/3.12.rst:2085 -msgid "Several items are not exposed from ``Python.h``:" +#: ../../whatsnew/3.12.rst:2271 +msgid "Several items are not exposed from :file:`Python.h`:" msgstr "" -#: ../../whatsnew/3.12.rst:2087 +#: ../../whatsnew/3.12.rst:2273 msgid ":c:macro:`T_OBJECT` (use :c:macro:`Py_T_OBJECT_EX`)" msgstr "" -#: ../../whatsnew/3.12.rst:2088 +#: ../../whatsnew/3.12.rst:2274 msgid ":c:macro:`T_NONE` (previously undocumented, and pretty quirky)" msgstr "" -#: ../../whatsnew/3.12.rst:2089 +#: ../../whatsnew/3.12.rst:2275 msgid "The macro ``WRITE_RESTRICTED`` which does nothing." msgstr "" -#: ../../whatsnew/3.12.rst:2090 +#: ../../whatsnew/3.12.rst:2276 msgid "" "The macros ``RESTRICTED`` and ``READ_RESTRICTED``, equivalents of :c:macro:" "`Py_AUDIT_READ`." msgstr "" -#: ../../whatsnew/3.12.rst:2092 +#: ../../whatsnew/3.12.rst:2278 msgid "" -"In some configurations, ```` is not included from ``Python.h``. It " -"should be included manually when using ``offsetof()``." +"In some configurations, ```` is not included from :file:`Python." +"h`. It should be included manually when using ``offsetof()``." msgstr "" -#: ../../whatsnew/3.12.rst:2095 +#: ../../whatsnew/3.12.rst:2281 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:2100 +#: ../../whatsnew/3.12.rst:2286 msgid "" "(Contributed in :gh:`47146` by Petr Viktorin, based on earlier work by " "Alexander Belopolsky and Matthias Braun.)" msgstr "" -#: ../../whatsnew/3.12.rst:2103 +#: ../../whatsnew/3.12.rst:2289 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:2108 +#: ../../whatsnew/3.12.rst:2294 msgid "" ":c:func:`!PyErr_Display` is deprecated. Use :c:func:`PyErr_DisplayException` " "instead. (Contributed by Irit Katriel in :gh:`102755`)." msgstr "" -#: ../../whatsnew/3.12.rst:2111 +#: ../../whatsnew/3.12.rst:2297 msgid "" "``_PyErr_ChainExceptions`` is deprecated. Use ``_PyErr_ChainExceptions1`` " "instead. (Contributed by Irit Katriel in :gh:`102192`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2114 +#: ../../whatsnew/3.12.rst:2300 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:2122 +#: ../../whatsnew/3.12.rst:2308 +msgid "" +"The ``ma_version_tag`` field in :c:type:`PyDictObject` for extension modules " +"(:pep:`699`; :gh:`101193`)." +msgstr "" + +#: ../../whatsnew/3.12.rst:2311 +msgid "Global configuration variables:" +msgstr "" + +#: ../../whatsnew/3.12.rst:2336 +msgid "" +"The :c:func:`Py_InitializeFromConfig` API should be used with :c:type:" +"`PyConfig` instead." +msgstr "" + +#: ../../whatsnew/3.12.rst:2339 +msgid "" +"Creating :c:data:`immutable types ` with mutable " +"bases (:gh:`95388`)." +msgstr "" + +#: ../../whatsnew/3.12.rst:2343 +msgid "Pending Removal in Python 3.15" +msgstr "" + +#: ../../whatsnew/3.12.rst:2345 +msgid "" +":c:func:`PyImport_ImportModuleNoBlock`: use :c:func:`PyImport_ImportModule`" +msgstr "" + +#: ../../whatsnew/3.12.rst:2346 +msgid ":c:type:`!Py_UNICODE_WIDE` type: use :c:type:`wchar_t`" +msgstr "" + +#: ../../whatsnew/3.12.rst:2347 +msgid ":c:type:`Py_UNICODE` type: use :c:type:`wchar_t`" +msgstr "" + +#: ../../whatsnew/3.12.rst:2348 +msgid "Python initialization functions:" +msgstr "" + +#: ../../whatsnew/3.12.rst:2350 +msgid "" +":c:func:`PySys_ResetWarnOptions`: clear :data:`sys.warnoptions` and :data:`!" +"warnings.filters`" +msgstr "" + +#: ../../whatsnew/3.12.rst:2352 +msgid ":c:func:`Py_GetExecPrefix`: get :data:`sys.exec_prefix`" +msgstr "" + +#: ../../whatsnew/3.12.rst:2353 +msgid ":c:func:`Py_GetPath`: get :data:`sys.path`" +msgstr "" + +#: ../../whatsnew/3.12.rst:2354 +msgid ":c:func:`Py_GetPrefix`: get :data:`sys.prefix`" +msgstr "" + +#: ../../whatsnew/3.12.rst:2355 +msgid ":c:func:`Py_GetProgramFullPath`: get :data:`sys.executable`" +msgstr "" + +#: ../../whatsnew/3.12.rst:2356 +msgid ":c:func:`Py_GetProgramName`: get :data:`sys.executable`" +msgstr "" + +#: ../../whatsnew/3.12.rst:2357 +msgid "" +":c:func:`Py_GetPythonHome`: get :c:member:`PyConfig.home` or the :envvar:" +"`PYTHONHOME` environment variable" +msgstr "" + +#: ../../whatsnew/3.12.rst:2363 +msgid "" +"The following APIs are deprecated and will be removed, although there is " +"currently no date scheduled for their removal." +msgstr "" + +#: ../../whatsnew/3.12.rst:2366 +msgid ":c:macro:`Py_TPFLAGS_HAVE_FINALIZE`: unneeded since Python 3.8" +msgstr "" + +#: ../../whatsnew/3.12.rst:2367 +msgid ":c:func:`PyErr_Fetch`: use :c:func:`PyErr_GetRaisedException`" +msgstr "" + +#: ../../whatsnew/3.12.rst:2368 +msgid "" +":c:func:`PyErr_NormalizeException`: use :c:func:`PyErr_GetRaisedException`" +msgstr "" + +#: ../../whatsnew/3.12.rst:2369 +msgid ":c:func:`PyErr_Restore`: use :c:func:`PyErr_SetRaisedException`" +msgstr "" + +#: ../../whatsnew/3.12.rst:2370 +msgid "" +":c:func:`PyModule_GetFilename`: use :c:func:`PyModule_GetFilenameObject`" +msgstr "" + +#: ../../whatsnew/3.12.rst:2371 +msgid ":c:func:`PyOS_AfterFork`: use :c:func:`PyOS_AfterFork_Child`" +msgstr "" + +#: ../../whatsnew/3.12.rst:2372 +msgid "" +":c:func:`PySlice_GetIndicesEx`: use :c:func:`PySlice_Unpack` and :c:func:" +"`PySlice_AdjustIndices`" +msgstr "" + +#: ../../whatsnew/3.12.rst:2373 +msgid ":c:func:`!PyUnicode_AsDecodedObject`: use :c:func:`PyCodec_Decode`" +msgstr "" + +#: ../../whatsnew/3.12.rst:2374 +msgid ":c:func:`!PyUnicode_AsDecodedUnicode`: use :c:func:`PyCodec_Decode`" +msgstr "" + +#: ../../whatsnew/3.12.rst:2375 +msgid ":c:func:`!PyUnicode_AsEncodedObject`: use :c:func:`PyCodec_Encode`" +msgstr "" + +#: ../../whatsnew/3.12.rst:2376 +msgid ":c:func:`!PyUnicode_AsEncodedUnicode`: use :c:func:`PyCodec_Encode`" +msgstr "" + +#: ../../whatsnew/3.12.rst:2377 +msgid ":c:func:`PyUnicode_READY`: unneeded since Python 3.12" +msgstr "" + +#: ../../whatsnew/3.12.rst:2378 +msgid ":c:func:`!PyErr_Display`: use :c:func:`PyErr_DisplayException`" +msgstr "" + +#: ../../whatsnew/3.12.rst:2379 +msgid ":c:func:`!_PyErr_ChainExceptions`: use ``_PyErr_ChainExceptions1``" +msgstr "" + +#: ../../whatsnew/3.12.rst:2380 +msgid "" +":c:member:`!PyBytesObject.ob_shash` member: call :c:func:`PyObject_Hash` " +"instead" +msgstr "" + +#: ../../whatsnew/3.12.rst:2382 +msgid ":c:member:`!PyDictObject.ma_version_tag` member" +msgstr ":c:member:`!PyDictObject.ma_version_tag` 成員" + +#: ../../whatsnew/3.12.rst:2383 +msgid "Thread Local Storage (TLS) API:" +msgstr "" + +#: ../../whatsnew/3.12.rst:2385 +msgid ":c:func:`PyThread_create_key`: use :c:func:`PyThread_tss_alloc`" +msgstr "" + +#: ../../whatsnew/3.12.rst:2386 +msgid ":c:func:`PyThread_delete_key`: use :c:func:`PyThread_tss_free`" +msgstr "" + +#: ../../whatsnew/3.12.rst:2387 +msgid ":c:func:`PyThread_set_key_value`: use :c:func:`PyThread_tss_set`" +msgstr "" + +#: ../../whatsnew/3.12.rst:2388 +msgid ":c:func:`PyThread_get_key_value`: use :c:func:`PyThread_tss_get`" +msgstr "" + +#: ../../whatsnew/3.12.rst:2389 +msgid ":c:func:`PyThread_delete_key_value`: use :c:func:`PyThread_tss_delete`" +msgstr "" + +#: ../../whatsnew/3.12.rst:2390 +msgid ":c:func:`PyThread_ReInitTLS`: unneeded since Python 3.7" +msgstr "" + +#: ../../whatsnew/3.12.rst:2395 msgid "" -"Remove the ``token.h`` header file. There was never any public tokenizer C " -"API. The ``token.h`` header file was only designed to be used by Python " -"internals. (Contributed by Victor Stinner in :gh:`92651`.)" +"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:2127 +#: ../../whatsnew/3.12.rst:2400 msgid "Legacy Unicode APIs have been removed. See :pep:`623` for detail." msgstr "" -#: ../../whatsnew/3.12.rst:2129 +#: ../../whatsnew/3.12.rst:2402 msgid ":c:macro:`!PyUnicode_WCHAR_KIND`" msgstr ":c:macro:`!PyUnicode_WCHAR_KIND`" -#: ../../whatsnew/3.12.rst:2130 +#: ../../whatsnew/3.12.rst:2403 msgid ":c:func:`!PyUnicode_AS_UNICODE`" msgstr ":c:func:`!PyUnicode_AS_UNICODE`" -#: ../../whatsnew/3.12.rst:2131 +#: ../../whatsnew/3.12.rst:2404 msgid ":c:func:`!PyUnicode_AsUnicode`" msgstr ":c:func:`!PyUnicode_AsUnicode`" -#: ../../whatsnew/3.12.rst:2132 +#: ../../whatsnew/3.12.rst:2405 msgid ":c:func:`!PyUnicode_AsUnicodeAndSize`" msgstr ":c:func:`!PyUnicode_AsUnicodeAndSize`" -#: ../../whatsnew/3.12.rst:2133 +#: ../../whatsnew/3.12.rst:2406 msgid ":c:func:`!PyUnicode_AS_DATA`" msgstr ":c:func:`!PyUnicode_AS_DATA`" -#: ../../whatsnew/3.12.rst:2134 +#: ../../whatsnew/3.12.rst:2407 msgid ":c:func:`!PyUnicode_FromUnicode`" msgstr ":c:func:`!PyUnicode_FromUnicode`" -#: ../../whatsnew/3.12.rst:2135 +#: ../../whatsnew/3.12.rst:2408 msgid ":c:func:`!PyUnicode_GET_SIZE`" msgstr ":c:func:`!PyUnicode_GET_SIZE`" -#: ../../whatsnew/3.12.rst:2136 +#: ../../whatsnew/3.12.rst:2409 msgid ":c:func:`!PyUnicode_GetSize`" msgstr ":c:func:`!PyUnicode_GetSize`" -#: ../../whatsnew/3.12.rst:2137 +#: ../../whatsnew/3.12.rst:2410 msgid ":c:func:`!PyUnicode_GET_DATA_SIZE`" msgstr ":c:func:`!PyUnicode_GET_DATA_SIZE`" -#: ../../whatsnew/3.12.rst:2139 +#: ../../whatsnew/3.12.rst:2412 msgid "" "Remove the ``PyUnicode_InternImmortal()`` function macro. (Contributed by " "Victor Stinner in :gh:`85858`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2142 +#: ../../whatsnew/3.12.rst:2415 msgid "" "Remove ``Jython`` compatibility hacks from several stdlib modules and tests. " "(Contributed by Nikita Sobolev in :gh:`99482`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2145 +#: ../../whatsnew/3.12.rst:2418 msgid "" "Remove ``_use_broken_old_ctypes_structure_semantics_`` flag from :mod:" "`ctypes` module. (Contributed by Nikita Sobolev in :gh:`99285`.)" msgstr "" - -#~ msgid ":const:`Py_TPFLAGS_HAVE_VECTORCALL`" -#~ msgstr ":const:`Py_TPFLAGS_HAVE_VECTORCALL`" - -#~ msgid ":const:`PY_VECTORCALL_ARGUMENTS_OFFSET`" -#~ msgstr ":const:`PY_VECTORCALL_ARGUMENTS_OFFSET`" - -#~ msgid "email" -#~ msgstr "email" diff --git a/whatsnew/3.3.po b/whatsnew/3.3.po index 7ba13abbd8..0914591a50 100644 --- a/whatsnew/3.3.po +++ b/whatsnew/3.3.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-27 18:15+0000\n" +"POT-Creation-Date: 2023-10-11 17:13+0000\n" "PO-Revision-Date: 2018-05-23 16:20+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -2773,6 +2773,8 @@ msgid "" "(https://en.wikipedia.org/wiki/Socketcan), on Linux (https://lwn.net/" "Articles/253425)." msgstr "" +":class:`~socket.socket` 類別現在支援 Linux (https://lwn.net/Articles/253425) " +"上的 PF_CAN 協議系列 (https://en.wikipedia.org/wiki/Socketcan)。" #: ../../whatsnew/3.3.rst:1892 msgid "" @@ -3072,12 +3074,12 @@ msgstr "其他新功能:" #: ../../whatsnew/3.3.rst:2069 msgid "" ":func:`~time.clock_getres`, :func:`~time.clock_gettime` and :func:`~time." -"clock_settime` functions with ``CLOCK_xxx`` constants. (Contributed by " +"clock_settime` functions with :samp:`CLOCK_{xxx}` constants. (Contributed by " "Victor Stinner in :issue:`10278`.)" msgstr "" ":func:`~time.clock_getres`、:func:`~time.clock_gettime` 和 :func:`~time." -"clock_settime` 函式帶有 ``CLOCK_xxx`` 常數。 (由 Victor Stinner 在 :issue:" -"`10278` 中貢獻。)" +"clock_settime` 函式帶有 :samp:`CLOCK_{xxx}` 常數。 (由 Victor Stinner 在 :" +"issue:`10278` 中貢獻。)" #: ../../whatsnew/3.3.rst:2073 msgid "" @@ -3943,10 +3945,3 @@ msgstr "yield" #: ../../whatsnew/3.3.rst:396 msgid "yield from (in What's New)" msgstr "yield from(在有什麼新功能中)" - -#~ msgid "" -#~ "The :class:`~socket.socket` class now supports the PF_CAN protocol family " -#~ "(https://en.wikipedia.org/wiki/Socketcan), on Linux ." -#~ msgstr "" -#~ "~socket.socket` 類別現在支援 Linux (https://lwn.net/Articles/253425) 上的 " -#~ "PF_CAN 協議系列 (https://en.wikipedia.org/wiki/Socketcan)。" diff --git a/whatsnew/3.4.po b/whatsnew/3.4.po index a0e58c3027..2c35922a63 100644 --- a/whatsnew/3.4.po +++ b/whatsnew/3.4.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-22 00:04+0000\n" +"POT-Creation-Date: 2023-10-11 17:13+0000\n" "PO-Revision-Date: 2018-05-23 16:20+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -495,7 +495,8 @@ msgid "" "(Contributed by Nick Coghlan in :issue:`7475`, :issue:`17827`, :issue:" "`17828` and :issue:`19619`.)" msgstr "" -"(由 Nick Coghlan 在 :issue:`7475`、:issue:`17827`、:issue:`17828` 和 :issue:`19619` 中貢獻。)" +"(由 Nick Coghlan 在 :issue:`7475`、:issue:`17827`、:issue:`17828` 和 :issue:" +"`19619` 中貢獻。)" #: ../../whatsnew/3.4.rst:381 msgid "PEP 451: A ModuleSpec Type for the Import System" @@ -1018,8 +1019,8 @@ msgid "" "(Contributed by Nick Coghlan, Ryan Kelly and Thomas Kluyver in :issue:" "`11816` and Claudiu Popa in :issue:`17916`.)" msgstr "" -"(由 Nick Coghlan、Ryan Kelly 和 Thomas Kluyver 在 :issue:`11816` 中以及 Claudiu " -"Popa 在 :issue:`17916` 中貢獻。)" +"(由 Nick Coghlan、Ryan Kelly 和 Thomas Kluyver 在 :issue:`11816` 中以及 " +"Claudiu Popa 在 :issue:`17916` 中貢獻。)" #: ../../whatsnew/3.4.rst:770 msgid "" @@ -2852,18 +2853,18 @@ msgid "" "find_spec`; :meth:`!importlib.abc.MetaPathFinder.find_module` is replaced " "by :meth:`importlib.abc.MetaPathFinder.find_spec`; :meth:`!importlib.abc." "PathEntryFinder.find_loader` and :meth:`!find_module` are replaced by :meth:" -"`importlib.abc.PathEntryFinder.find_spec`; all of the ``xxxLoader`` ABC " -"``load_module`` methods (:meth:`!importlib.abc.Loader.load_module`, :meth:`!" -"importlib.abc.InspectLoader.load_module`, :meth:`!importlib.abc.FileLoader." -"load_module`, :meth:`!importlib.abc.SourceLoader.load_module`) should no " -"longer be implemented, instead loaders should implement an ``exec_module`` " -"method (:meth:`importlib.abc.Loader.exec_module`, :meth:`importlib.abc." -"InspectLoader.exec_module` :meth:`importlib.abc.SourceLoader.exec_module`) " -"and let the import system take care of the rest; and :meth:`!importlib.abc." -"Loader.module_repr`, :meth:`!importlib.util.module_for_loader`, :meth:`!" -"importlib.util.set_loader`, and :meth:`!importlib.util.set_package` are no " -"longer needed because their functions are now handled automatically by the " -"import system." +"`importlib.abc.PathEntryFinder.find_spec`; all of the :samp:`{xxx}Loader` " +"ABC ``load_module`` methods (:meth:`!importlib.abc.Loader.load_module`, :" +"meth:`!importlib.abc.InspectLoader.load_module`, :meth:`!importlib.abc." +"FileLoader.load_module`, :meth:`!importlib.abc.SourceLoader.load_module`) " +"should no longer be implemented, instead loaders should implement an " +"``exec_module`` method (:meth:`importlib.abc.Loader.exec_module`, :meth:" +"`importlib.abc.InspectLoader.exec_module` :meth:`importlib.abc.SourceLoader." +"exec_module`) and let the import system take care of the rest; and :meth:`!" +"importlib.abc.Loader.module_repr`, :meth:`!importlib.util." +"module_for_loader`, :meth:`!importlib.util.set_loader`, and :meth:`!" +"importlib.util.set_package` are no longer needed because their functions are " +"now handled automatically by the import system." msgstr "" #: ../../whatsnew/3.4.rst:2104 diff --git a/whatsnew/3.7.po b/whatsnew/3.7.po index 1c567304b2..29981b965a 100644 --- a/whatsnew/3.7.po +++ b/whatsnew/3.7.po @@ -2251,8 +2251,8 @@ msgid "" "(Contributed by Nick Coghlan and Victor Stinner in :issue:`20361`, :issue:" "`32043`, and :issue:`32230`.)" msgstr "" -"(由 Nick Coghlan 和 Victor Stinner 在 :issue:`20361`、:issue:" -"`32043` 和 :issue:`32230` 中貢獻。)" +"(由 Nick Coghlan 和 Victor Stinner 在 :issue:`20361`、:issue:`32043` 和 :" +"issue:`32230` 中貢獻。)" #: ../../whatsnew/3.7.rst:1597 msgid "" diff --git a/whatsnew/3.8.po b/whatsnew/3.8.po index 876384f4a2..40a1f64f79 100644 --- a/whatsnew/3.8.po +++ b/whatsnew/3.8.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-23 00:03+0000\n" +"POT-Creation-Date: 2023-10-13 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-" @@ -106,8 +106,8 @@ msgid "" "There is a new function parameter syntax ``/`` to indicate that some " "function parameters must be specified positionally and cannot be used as " "keyword arguments. This is the same notation shown by ``help()`` for C " -"functions annotated with Larry Hastings' :ref:`Argument Clinic ` tool." +"functions annotated with Larry Hastings' `Argument Clinic `__ tool." msgstr "" #: ../../whatsnew/3.8.rst:128 @@ -550,7 +550,8 @@ msgstr "" #: ../../whatsnew/3.8.rst:407 msgid "" -"Added support of ``\\N{name}`` escapes in :mod:`regular expressions `::" +"Added support of :samp:`\\\\N\\\\{{name}\\\\}` escapes in :mod:`regular " +"expressions `::" msgstr "" #: ../../whatsnew/3.8.rst:414 @@ -1153,7 +1154,7 @@ msgstr "" #: ../../whatsnew/3.8.rst:950 msgid "" -"(Suggested by Raymond Hettinger, implemented by Dong-hee Na, and reviewed by " +"(Suggested by Raymond Hettinger, implemented by Donghee Na, and reviewed by " "Vinay Sajip in :issue:`33897`.)" msgstr "" @@ -2191,7 +2192,7 @@ msgstr "" #: ../../whatsnew/3.8.rst:1715 msgid "" "The :meth:`~threading.Thread.isAlive()` method of :class:`threading.Thread` " -"has been deprecated. (Contributed by Dong-hee Na in :issue:`35283`.)" +"has been deprecated. (Contributed by Donghee Na in :issue:`35283`.)" msgstr "" #: ../../whatsnew/3.8.rst:1719 diff --git a/whatsnew/3.9.po b/whatsnew/3.9.po index 05e821457f..08cc7c79e0 100644 --- a/whatsnew/3.9.po +++ b/whatsnew/3.9.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-23 00:03+0000\n" +"POT-Creation-Date: 2023-10-11 17:13+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -33,83 +33,80 @@ msgstr "Łukasz Langa" #: ../../whatsnew/3.9.rst:45 msgid "" "This article explains the new features in Python 3.9, compared to 3.8. " -"Python 3.9 was released on October 5, 2020." +"Python 3.9 was released on October 5, 2020. For full details, see the :ref:" +"`changelog `." msgstr "" -#: ../../whatsnew/3.9.rst:48 -msgid "For full details, see the :ref:`changelog `." -msgstr "" - -#: ../../whatsnew/3.9.rst:52 +#: ../../whatsnew/3.9.rst:51 msgid ":pep:`596` - Python 3.9 Release Schedule" msgstr "" -#: ../../whatsnew/3.9.rst:56 +#: ../../whatsnew/3.9.rst:55 msgid "Summary -- Release highlights" msgstr "" -#: ../../whatsnew/3.9.rst:61 +#: ../../whatsnew/3.9.rst:60 msgid "New syntax features:" msgstr "" -#: ../../whatsnew/3.9.rst:63 +#: ../../whatsnew/3.9.rst:62 msgid ":pep:`584`, union operators added to ``dict``;" msgstr "" -#: ../../whatsnew/3.9.rst:64 +#: ../../whatsnew/3.9.rst:63 msgid ":pep:`585`, type hinting generics in standard collections;" msgstr "" -#: ../../whatsnew/3.9.rst:65 +#: ../../whatsnew/3.9.rst:64 msgid ":pep:`614`, relaxed grammar restrictions on decorators." msgstr "" -#: ../../whatsnew/3.9.rst:67 +#: ../../whatsnew/3.9.rst:66 msgid "New built-in features:" msgstr "" -#: ../../whatsnew/3.9.rst:69 +#: ../../whatsnew/3.9.rst:68 msgid ":pep:`616`, string methods to remove prefixes and suffixes." msgstr "" -#: ../../whatsnew/3.9.rst:71 +#: ../../whatsnew/3.9.rst:70 msgid "New features in the standard library:" msgstr "" -#: ../../whatsnew/3.9.rst:73 +#: ../../whatsnew/3.9.rst:72 msgid ":pep:`593`, flexible function and variable annotations;" msgstr "" -#: ../../whatsnew/3.9.rst:74 +#: ../../whatsnew/3.9.rst:73 msgid "" ":func:`os.pidfd_open` added that allows process management without races and " "signals." msgstr "" -#: ../../whatsnew/3.9.rst:77 +#: ../../whatsnew/3.9.rst:76 msgid "Interpreter improvements:" msgstr "" -#: ../../whatsnew/3.9.rst:79 +#: ../../whatsnew/3.9.rst:78 msgid "" ":pep:`573`, fast access to module state from methods of C extension types;" msgstr "" -#: ../../whatsnew/3.9.rst:81 +#: ../../whatsnew/3.9.rst:80 msgid ":pep:`617`, CPython now uses a new parser based on PEG;" msgstr "" -#: ../../whatsnew/3.9.rst:82 +#: ../../whatsnew/3.9.rst:81 msgid "" "a number of Python builtins (range, tuple, set, frozenset, list, dict) are " "now sped up using :pep:`590` vectorcall;" msgstr "" -#: ../../whatsnew/3.9.rst:84 +#: ../../whatsnew/3.9.rst:83 msgid "garbage collection does not block on resurrected objects;" msgstr "" -#: ../../whatsnew/3.9.rst:85 +#: ../../whatsnew/3.9.rst:84 msgid "" "a number of Python modules (:mod:`_abc`, :mod:`audioop`, :mod:`_bz2`, :mod:" "`_codecs`, :mod:`_contextvars`, :mod:`_crypt`, :mod:`_functools`, :mod:" @@ -118,7 +115,7 @@ msgid "" "489;" msgstr "" -#: ../../whatsnew/3.9.rst:90 +#: ../../whatsnew/3.9.rst:89 msgid "" "a number of standard library modules (:mod:`audioop`, :mod:`ast`, :mod:" "`grp`, :mod:`_hashlib`, :mod:`pwd`, :mod:`_posixsubprocess`, :mod:`random`, :" @@ -126,35 +123,35 @@ msgid "" "stable ABI defined by PEP 384." msgstr "" -#: ../../whatsnew/3.9.rst:95 +#: ../../whatsnew/3.9.rst:94 msgid "New library modules:" msgstr "" -#: ../../whatsnew/3.9.rst:97 +#: ../../whatsnew/3.9.rst:96 msgid "" ":pep:`615`, the IANA Time Zone Database is now present in the standard " "library in the :mod:`zoneinfo` module;" msgstr "" -#: ../../whatsnew/3.9.rst:99 +#: ../../whatsnew/3.9.rst:98 msgid "" "an implementation of a topological sort of a graph is now provided in the " "new :mod:`graphlib` module." msgstr "" -#: ../../whatsnew/3.9.rst:102 +#: ../../whatsnew/3.9.rst:101 msgid "Release process changes:" msgstr "" -#: ../../whatsnew/3.9.rst:104 +#: ../../whatsnew/3.9.rst:103 msgid ":pep:`602`, CPython adopts an annual release cycle." msgstr "" -#: ../../whatsnew/3.9.rst:108 +#: ../../whatsnew/3.9.rst:107 msgid "You should check for DeprecationWarning in your code" msgstr "" -#: ../../whatsnew/3.9.rst:110 +#: ../../whatsnew/3.9.rst:109 msgid "" "When Python 2.7 was still supported, a lot of functionality in Python 3 was " "kept for backward compatibility with Python 2.7. With the end of Python 2 " @@ -165,7 +162,7 @@ msgid "" "3.3, released in 2012." msgstr "" -#: ../../whatsnew/3.9.rst:118 +#: ../../whatsnew/3.9.rst:117 msgid "" "Test your application with the :option:`-W` ``default`` command-line option " "to see :exc:`DeprecationWarning` and :exc:`PendingDeprecationWarning`, or " @@ -174,14 +171,14 @@ msgid "" "code." msgstr "" -#: ../../whatsnew/3.9.rst:123 +#: ../../whatsnew/3.9.rst:122 msgid "" "Python 3.9 is the last version providing those Python 2 backward " "compatibility layers, to give more time to Python projects maintainers to " "organize the removal of the Python 2 support and add support for Python 3.9." msgstr "" -#: ../../whatsnew/3.9.rst:127 +#: ../../whatsnew/3.9.rst:126 msgid "" "Aliases to :ref:`Abstract Base Classes ` " "in the :mod:`collections` module, like ``collections.Mapping`` alias to :" @@ -189,52 +186,52 @@ msgid "" "compatibility. They will be removed from Python 3.10." msgstr "" -#: ../../whatsnew/3.9.rst:132 +#: ../../whatsnew/3.9.rst:131 msgid "" "More generally, try to run your tests in the :ref:`Python Development Mode " "` which helps to prepare your code to make it compatible with the " "next Python version." msgstr "" -#: ../../whatsnew/3.9.rst:136 +#: ../../whatsnew/3.9.rst:135 msgid "" "Note: a number of pre-existing deprecations were removed in this version of " "Python as well. Consult the :ref:`removed-in-python-39` section." msgstr "" -#: ../../whatsnew/3.9.rst:141 ../../whatsnew/3.9.rst:1274 +#: ../../whatsnew/3.9.rst:140 ../../whatsnew/3.9.rst:1273 msgid "New Features" msgstr "" -#: ../../whatsnew/3.9.rst:144 +#: ../../whatsnew/3.9.rst:143 msgid "Dictionary Merge & Update Operators" msgstr "" -#: ../../whatsnew/3.9.rst:146 +#: ../../whatsnew/3.9.rst:145 msgid "" "Merge (``|``) and update (``|=``) operators have been added to the built-in :" "class:`dict` class. Those complement the existing ``dict.update`` and " "``{**d1, **d2}`` methods of merging dictionaries." msgstr "" -#: ../../whatsnew/3.9.rst:150 ../../whatsnew/3.9.rst:283 +#: ../../whatsnew/3.9.rst:149 ../../whatsnew/3.9.rst:282 msgid "Example::" msgstr "" "範例:\n" "\n" "::" -#: ../../whatsnew/3.9.rst:159 +#: ../../whatsnew/3.9.rst:158 msgid "" "See :pep:`584` for a full description. (Contributed by Brandt Bucher in :" "issue:`36144`.)" msgstr "" -#: ../../whatsnew/3.9.rst:163 +#: ../../whatsnew/3.9.rst:162 msgid "New String Methods to Remove Prefixes and Suffixes" msgstr "" -#: ../../whatsnew/3.9.rst:165 +#: ../../whatsnew/3.9.rst:164 msgid "" ":meth:`str.removeprefix(prefix)` and :meth:`str." "removesuffix(suffix)` have been added to easily remove an " @@ -244,11 +241,11 @@ msgid "" "issue:`39939`.)" msgstr "" -#: ../../whatsnew/3.9.rst:173 +#: ../../whatsnew/3.9.rst:172 msgid "Type Hinting Generics in Standard Collections" msgstr "" -#: ../../whatsnew/3.9.rst:175 +#: ../../whatsnew/3.9.rst:174 msgid "" "In type annotations you can now use built-in collection types such as " "``list`` and ``dict`` as generic types instead of importing the " @@ -257,21 +254,21 @@ msgid "" "for example ``queue.Queue``." msgstr "" -#: ../../whatsnew/3.9.rst:181 ../../whatsnew/3.9.rst:1162 +#: ../../whatsnew/3.9.rst:180 ../../whatsnew/3.9.rst:1161 msgid "Example:" msgstr "範例:" -#: ../../whatsnew/3.9.rst:189 +#: ../../whatsnew/3.9.rst:188 msgid "" "See :pep:`585` for more details. (Contributed by Guido van Rossum, Ethan " "Smith, and Batuhan Taşkaya in :issue:`39481`.)" msgstr "" -#: ../../whatsnew/3.9.rst:193 +#: ../../whatsnew/3.9.rst:192 msgid "New Parser" msgstr "" -#: ../../whatsnew/3.9.rst:195 +#: ../../whatsnew/3.9.rst:194 msgid "" "Python 3.9 uses a new parser, based on `PEG `_ instead of `LL(1) ` and in :ref:`debug build " "`, the *encoding* and *errors* arguments are now checked for " @@ -332,14 +329,14 @@ msgid "" "encode` and :meth:`bytes.decode`." msgstr "" -#: ../../whatsnew/3.9.rst:237 +#: ../../whatsnew/3.9.rst:236 msgid "" "By default, for best performance, the *errors* argument is only checked at " "the first encoding/decoding error and the *encoding* argument is sometimes " "ignored for empty strings. (Contributed by Victor Stinner in :issue:`37388`.)" msgstr "" -#: ../../whatsnew/3.9.rst:242 +#: ../../whatsnew/3.9.rst:241 msgid "" "``\"\".replace(\"\", s, n)`` now returns ``s`` instead of an empty string " "for all non-zero ``n``. It is now consistent with ``\"\".replace(\"\", " @@ -347,14 +344,14 @@ msgid "" "objects. (Contributed by Serhiy Storchaka in :issue:`28029`.)" msgstr "" -#: ../../whatsnew/3.9.rst:247 +#: ../../whatsnew/3.9.rst:246 msgid "" "Any valid expression can now be used as a :term:`decorator`. Previously, " "the grammar was much more restrictive. See :pep:`614` for details. " "(Contributed by Brandt Bucher in :issue:`39702`.)" msgstr "" -#: ../../whatsnew/3.9.rst:251 +#: ../../whatsnew/3.9.rst:250 msgid "" "Improved help for the :mod:`typing` module. Docstrings are now shown for all " "special forms and special generic aliases (like ``Union`` and ``List``). " @@ -363,7 +360,7 @@ msgid "" "Serhiy Storchaka in :issue:`40257`.)" msgstr "" -#: ../../whatsnew/3.9.rst:257 +#: ../../whatsnew/3.9.rst:256 msgid "" "Parallel running of :meth:`~agen.aclose` / :meth:`~agen.asend` / :meth:" "`~agen.athrow` is now prohibited, and ``ag_running`` now reflects the actual " @@ -371,7 +368,7 @@ msgid "" "issue:`30773`.)" msgstr "" -#: ../../whatsnew/3.9.rst:262 +#: ../../whatsnew/3.9.rst:261 msgid "" "Unexpected errors in calling the ``__iter__`` method are no longer masked by " "``TypeError`` in the :keyword:`in` operator and functions :func:`~operator." @@ -379,49 +376,49 @@ msgid "" "mod:`operator` module. (Contributed by Serhiy Storchaka in :issue:`40824`.)" msgstr "" -#: ../../whatsnew/3.9.rst:268 +#: ../../whatsnew/3.9.rst:267 msgid "" "Unparenthesized lambda expressions can no longer be the expression part in " "an ``if`` clause in comprehensions and generator expressions. See :issue:" "`41848` and :issue:`43755` for details." msgstr "" -#: ../../whatsnew/3.9.rst:274 +#: ../../whatsnew/3.9.rst:273 msgid "New Modules" msgstr "新模組" -#: ../../whatsnew/3.9.rst:277 +#: ../../whatsnew/3.9.rst:276 msgid "zoneinfo" msgstr "zoneinfo" -#: ../../whatsnew/3.9.rst:279 +#: ../../whatsnew/3.9.rst:278 msgid "" "The :mod:`zoneinfo` module brings support for the IANA time zone database to " "the standard library. It adds :class:`zoneinfo.ZoneInfo`, a concrete :class:" "`datetime.tzinfo` implementation backed by the system's time zone data." msgstr "" -#: ../../whatsnew/3.9.rst:303 +#: ../../whatsnew/3.9.rst:302 msgid "" "As a fall-back source of data for platforms that don't ship the IANA " "database, the |tzdata|_ module was released as a first-party package -- " "distributed via PyPI and maintained by the CPython core team." msgstr "" -#: ../../whatsnew/3.9.rst:312 +#: ../../whatsnew/3.9.rst:311 msgid "" ":pep:`615` -- Support for the IANA Time Zone Database in the Standard Library" msgstr "" -#: ../../whatsnew/3.9.rst:313 +#: ../../whatsnew/3.9.rst:312 msgid "PEP written and implemented by Paul Ganssle" msgstr "由 Paul Ganssle 撰寫 PEP 與實作" -#: ../../whatsnew/3.9.rst:317 +#: ../../whatsnew/3.9.rst:316 msgid "graphlib" msgstr "graphlib" -#: ../../whatsnew/3.9.rst:319 +#: ../../whatsnew/3.9.rst:318 msgid "" "A new module, :mod:`graphlib`, was added that contains the :class:`graphlib." "TopologicalSorter` class to offer functionality to perform topological " @@ -429,22 +426,22 @@ msgid "" "Hastings in :issue:`17005`.)" msgstr "" -#: ../../whatsnew/3.9.rst:326 +#: ../../whatsnew/3.9.rst:325 msgid "Improved Modules" msgstr "" -#: ../../whatsnew/3.9.rst:329 +#: ../../whatsnew/3.9.rst:328 msgid "ast" msgstr "ast" -#: ../../whatsnew/3.9.rst:331 +#: ../../whatsnew/3.9.rst:330 msgid "" "Added the *indent* option to :func:`~ast.dump` which allows it to produce a " "multiline indented output. (Contributed by Serhiy Storchaka in :issue:" "`37995`.)" msgstr "" -#: ../../whatsnew/3.9.rst:335 +#: ../../whatsnew/3.9.rst:334 msgid "" "Added :func:`ast.unparse` as a function in the :mod:`ast` module that can be " "used to unparse an :class:`ast.AST` object and produce a string with code " @@ -452,17 +449,17 @@ msgid "" "(Contributed by Pablo Galindo and Batuhan Taskaya in :issue:`38870`.)" msgstr "" -#: ../../whatsnew/3.9.rst:340 +#: ../../whatsnew/3.9.rst:339 msgid "" "Added docstrings to AST nodes that contains the ASDL signature used to " "construct that node. (Contributed by Batuhan Taskaya in :issue:`39638`.)" msgstr "" -#: ../../whatsnew/3.9.rst:344 +#: ../../whatsnew/3.9.rst:343 msgid "asyncio" msgstr "asyncio" -#: ../../whatsnew/3.9.rst:346 +#: ../../whatsnew/3.9.rst:345 msgid "" "Due to significant security concerns, the *reuse_address* parameter of :meth:" "`asyncio.loop.create_datagram_endpoint` is no longer supported. This is " @@ -472,7 +469,7 @@ msgid "" "`37228`.)" msgstr "" -#: ../../whatsnew/3.9.rst:353 +#: ../../whatsnew/3.9.rst:352 msgid "" "Added a new :term:`coroutine` :meth:`~asyncio.loop." "shutdown_default_executor` that schedules a shutdown for the default " @@ -481,13 +478,13 @@ msgid "" "new :term:`coroutine`. (Contributed by Kyle Stanley in :issue:`34037`.)" msgstr "" -#: ../../whatsnew/3.9.rst:359 +#: ../../whatsnew/3.9.rst:358 msgid "" "Added :class:`asyncio.PidfdChildWatcher`, a Linux-specific child watcher " "implementation that polls process file descriptors. (:issue:`38692`)" msgstr "" -#: ../../whatsnew/3.9.rst:362 +#: ../../whatsnew/3.9.rst:361 msgid "" "Added a new :term:`coroutine` :func:`asyncio.to_thread`. It is mainly used " "for running IO-bound functions in a separate thread to avoid blocking the " @@ -496,7 +493,7 @@ msgid "" "by Kyle Stanley and Yury Selivanov in :issue:`32309`.)" msgstr "" -#: ../../whatsnew/3.9.rst:368 +#: ../../whatsnew/3.9.rst:367 msgid "" "When cancelling the task due to a timeout, :meth:`asyncio.wait_for` will now " "wait until the cancellation is complete also in the case when *timeout* is " @@ -504,25 +501,25 @@ msgid "" "Pranskevichus in :issue:`32751`.)" msgstr "" -#: ../../whatsnew/3.9.rst:373 +#: ../../whatsnew/3.9.rst:372 msgid "" ":mod:`asyncio` now raises :exc:`TyperError` when calling incompatible " "methods with an :class:`ssl.SSLSocket` socket. (Contributed by Ido Michael " "in :issue:`37404`.)" msgstr "" -#: ../../whatsnew/3.9.rst:378 +#: ../../whatsnew/3.9.rst:377 msgid "compileall" msgstr "compileall" -#: ../../whatsnew/3.9.rst:380 +#: ../../whatsnew/3.9.rst:379 msgid "" "Added new possibility to use hardlinks for duplicated ``.pyc`` files: " "*hardlink_dupes* parameter and --hardlink-dupes command line option. " "(Contributed by Lumír 'Frenzy' Balhar in :issue:`40495`.)" msgstr "" -#: ../../whatsnew/3.9.rst:383 +#: ../../whatsnew/3.9.rst:382 msgid "" "Added new options for path manipulation in resulting ``.pyc`` files: " "*stripdir*, *prependdir*, *limit_sl_dest* parameters and -s, -p, -e command " @@ -531,11 +528,11 @@ msgid "" "issue:`38112`.)" msgstr "" -#: ../../whatsnew/3.9.rst:388 +#: ../../whatsnew/3.9.rst:387 msgid "concurrent.futures" msgstr "concurrent.futures" -#: ../../whatsnew/3.9.rst:390 +#: ../../whatsnew/3.9.rst:389 msgid "" "Added a new *cancel_futures* parameter to :meth:`concurrent.futures.Executor." "shutdown` that cancels all pending futures which have not started running, " @@ -543,7 +540,7 @@ msgid "" "(Contributed by Kyle Stanley in :issue:`39349`.)" msgstr "" -#: ../../whatsnew/3.9.rst:396 +#: ../../whatsnew/3.9.rst:395 msgid "" "Removed daemon threads from :class:`~concurrent.futures.ThreadPoolExecutor` " "and :class:`~concurrent.futures.ProcessPoolExecutor`. This improves " @@ -551,7 +548,7 @@ msgid "" "processes. (Contributed by Kyle Stanley in :issue:`39812`.)" msgstr "" -#: ../../whatsnew/3.9.rst:401 +#: ../../whatsnew/3.9.rst:400 msgid "" "Workers in :class:`~concurrent.futures.ProcessPoolExecutor` are now spawned " "on demand, only when there are no available idle workers to reuse. This " @@ -559,68 +556,68 @@ msgid "" "workers. (Contributed by Kyle Stanley in :issue:`39207`.)" msgstr "" -#: ../../whatsnew/3.9.rst:407 +#: ../../whatsnew/3.9.rst:406 msgid "curses" msgstr "curses" -#: ../../whatsnew/3.9.rst:409 +#: ../../whatsnew/3.9.rst:408 msgid "" "Added :func:`curses.get_escdelay`, :func:`curses.set_escdelay`, :func:" "`curses.get_tabsize`, and :func:`curses.set_tabsize` functions. (Contributed " "by Anthony Sottile in :issue:`38312`.)" msgstr "" -#: ../../whatsnew/3.9.rst:414 +#: ../../whatsnew/3.9.rst:413 msgid "datetime" msgstr "datetime" -#: ../../whatsnew/3.9.rst:415 +#: ../../whatsnew/3.9.rst:414 msgid "" "The :meth:`~datetime.date.isocalendar()` of :class:`datetime.date` and :meth:" "`~datetime.datetime.isocalendar()` of :class:`datetime.datetime` methods now " "returns a :func:`~collections.namedtuple` instead of a :class:`tuple`. " -"(Contributed by Dong-hee Na in :issue:`24416`.)" +"(Contributed by Donghee Na in :issue:`24416`.)" msgstr "" -#: ../../whatsnew/3.9.rst:421 +#: ../../whatsnew/3.9.rst:420 msgid "distutils" msgstr "distutils" -#: ../../whatsnew/3.9.rst:423 +#: ../../whatsnew/3.9.rst:422 msgid "" "The :command:`upload` command now creates SHA2-256 and Blake2b-256 hash " "digests. It skips MD5 on platforms that block MD5 digest. (Contributed by " "Christian Heimes in :issue:`40698`.)" msgstr "" -#: ../../whatsnew/3.9.rst:428 +#: ../../whatsnew/3.9.rst:427 msgid "fcntl" msgstr "fcntl" -#: ../../whatsnew/3.9.rst:430 +#: ../../whatsnew/3.9.rst:429 msgid "" "Added constants :const:`~fcntl.F_OFD_GETLK`, :const:`~fcntl.F_OFD_SETLK` " -"and :const:`~fcntl.F_OFD_SETLKW`. (Contributed by Dong-hee Na in :issue:" +"and :const:`~fcntl.F_OFD_SETLKW`. (Contributed by Donghee Na in :issue:" "`38602`.)" msgstr "" -#: ../../whatsnew/3.9.rst:435 +#: ../../whatsnew/3.9.rst:434 msgid "ftplib" msgstr "ftplib" -#: ../../whatsnew/3.9.rst:437 +#: ../../whatsnew/3.9.rst:436 msgid "" ":class:`~ftplib.FTP` and :class:`~ftplib.FTP_TLS` now raise a :class:" "`ValueError` if the given timeout for their constructor is zero to prevent " -"the creation of a non-blocking socket. (Contributed by Dong-hee Na in :issue:" +"the creation of a non-blocking socket. (Contributed by Donghee Na in :issue:" "`39259`.)" msgstr "" -#: ../../whatsnew/3.9.rst:442 +#: ../../whatsnew/3.9.rst:441 msgid "gc" msgstr "gc" -#: ../../whatsnew/3.9.rst:444 +#: ../../whatsnew/3.9.rst:443 msgid "" "When the garbage collector makes a collection in which some objects " "resurrect (they are reachable from outside the isolated cycles after the " @@ -629,24 +626,24 @@ msgid "" "issue:`38379`.)" msgstr "" -#: ../../whatsnew/3.9.rst:449 +#: ../../whatsnew/3.9.rst:448 msgid "" "Added a new function :func:`gc.is_finalized` to check if an object has been " "finalized by the garbage collector. (Contributed by Pablo Galindo in :issue:" "`39322`.)" msgstr "" -#: ../../whatsnew/3.9.rst:454 +#: ../../whatsnew/3.9.rst:453 msgid "hashlib" msgstr "hashlib" -#: ../../whatsnew/3.9.rst:456 +#: ../../whatsnew/3.9.rst:455 msgid "" "The :mod:`hashlib` module can now use SHA3 hashes and SHAKE XOF from OpenSSL " "when available. (Contributed by Christian Heimes in :issue:`37630`.)" msgstr "" -#: ../../whatsnew/3.9.rst:460 +#: ../../whatsnew/3.9.rst:459 msgid "" "Builtin hash modules can now be disabled with ``./configure --without-" "builtin-hashlib-hashes`` or selectively enabled with e.g. ``./configure --" @@ -654,55 +651,55 @@ msgid "" "implementation. (Contributed by Christian Heimes in :issue:`40479`)" msgstr "" -#: ../../whatsnew/3.9.rst:468 +#: ../../whatsnew/3.9.rst:467 msgid "http" msgstr "http" -#: ../../whatsnew/3.9.rst:470 +#: ../../whatsnew/3.9.rst:469 msgid "" "HTTP status codes ``103 EARLY_HINTS``, ``418 IM_A_TEAPOT`` and ``425 " -"TOO_EARLY`` are added to :class:`http.HTTPStatus`. (Contributed by Dong-hee " +"TOO_EARLY`` are added to :class:`http.HTTPStatus`. (Contributed by Donghee " "Na in :issue:`39509` and Ross Rhodes in :issue:`39507`.)" msgstr "" -#: ../../whatsnew/3.9.rst:474 +#: ../../whatsnew/3.9.rst:473 msgid "IDLE and idlelib" msgstr "" -#: ../../whatsnew/3.9.rst:476 +#: ../../whatsnew/3.9.rst:475 msgid "" "Added option to toggle cursor blink off. (Contributed by Zackery Spytz in :" "issue:`4603`.)" msgstr "" -#: ../../whatsnew/3.9.rst:479 +#: ../../whatsnew/3.9.rst:478 msgid "" "Escape key now closes IDLE completion windows. (Contributed by Johnny " "Najera in :issue:`38944`.)" msgstr "" -#: ../../whatsnew/3.9.rst:482 +#: ../../whatsnew/3.9.rst:481 msgid "" "Added keywords to module name completion list. (Contributed by Terry J. " "Reedy in :issue:`37765`.)" msgstr "" -#: ../../whatsnew/3.9.rst:485 +#: ../../whatsnew/3.9.rst:484 msgid "New in 3.9 maintenance releases" msgstr "" -#: ../../whatsnew/3.9.rst:487 +#: ../../whatsnew/3.9.rst:486 msgid "" "Make IDLE invoke :func:`sys.excepthook` (when started without '-n'). User " "hooks were previously ignored. (Contributed by Ken Hilton in :issue:" "`43008`.)" msgstr "" -#: ../../whatsnew/3.9.rst:491 +#: ../../whatsnew/3.9.rst:490 msgid "The changes above have been backported to 3.8 maintenance releases." msgstr "" -#: ../../whatsnew/3.9.rst:493 +#: ../../whatsnew/3.9.rst:492 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 " @@ -713,41 +710,41 @@ msgid "" "`33962`.)" msgstr "" -#: ../../whatsnew/3.9.rst:501 +#: ../../whatsnew/3.9.rst:500 msgid "" "Apply syntax highlighting to ``.pyi`` files. (Contributed by Alex Waygood " "and Terry Jan Reedy in :issue:`45447`.)" msgstr "" -#: ../../whatsnew/3.9.rst:505 +#: ../../whatsnew/3.9.rst:504 msgid "imaplib" msgstr "imaplib" -#: ../../whatsnew/3.9.rst:507 +#: ../../whatsnew/3.9.rst:506 msgid "" ":class:`~imaplib.IMAP4` and :class:`~imaplib.IMAP4_SSL` now have an optional " "*timeout* parameter for their constructors. Also, the :meth:`~imaplib.IMAP4." "open` method now has an optional *timeout* parameter with this change. The " "overridden methods of :class:`~imaplib.IMAP4_SSL` and :class:`~imaplib." -"IMAP4_stream` were applied to this change. (Contributed by Dong-hee Na in :" +"IMAP4_stream` were applied to this change. (Contributed by Donghee Na in :" "issue:`38615`.)" msgstr "" -#: ../../whatsnew/3.9.rst:514 +#: ../../whatsnew/3.9.rst:513 msgid "" ":meth:`imaplib.IMAP4.unselect` is added. :meth:`imaplib.IMAP4.unselect` " "frees server's resources associated with the selected mailbox and returns " "the server to the authenticated state. This command performs the same " "actions as :meth:`imaplib.IMAP4.close`, except that no messages are " "permanently removed from the currently selected mailbox. (Contributed by " -"Dong-hee Na in :issue:`40375`.)" +"Donghee Na in :issue:`40375`.)" msgstr "" -#: ../../whatsnew/3.9.rst:522 +#: ../../whatsnew/3.9.rst:521 msgid "importlib" msgstr "importlib" -#: ../../whatsnew/3.9.rst:524 +#: ../../whatsnew/3.9.rst:523 msgid "" "To improve consistency with import statements, :func:`importlib.util." "resolve_name` now raises :exc:`ImportError` instead of :exc:`ValueError` for " @@ -755,47 +752,47 @@ msgid "" "`37444`.)" msgstr "" -#: ../../whatsnew/3.9.rst:529 +#: ../../whatsnew/3.9.rst:528 msgid "" "Import loaders which publish immutable module objects can now publish " "immutable packages in addition to individual modules. (Contributed by Dino " "Viehland in :issue:`39336`.)" msgstr "" -#: ../../whatsnew/3.9.rst:533 +#: ../../whatsnew/3.9.rst:532 msgid "" "Added :func:`importlib.resources.files` function with support for " "subdirectories in package data, matching backport in ``importlib_resources`` " "version 1.5. (Contributed by Jason R. Coombs in :issue:`39791`.)" msgstr "" -#: ../../whatsnew/3.9.rst:538 +#: ../../whatsnew/3.9.rst:537 msgid "" "Refreshed ``importlib.metadata`` from ``importlib_metadata`` version 1.6.1." msgstr "" -#: ../../whatsnew/3.9.rst:541 +#: ../../whatsnew/3.9.rst:540 msgid "inspect" msgstr "inspect" -#: ../../whatsnew/3.9.rst:543 +#: ../../whatsnew/3.9.rst:542 msgid "" ":attr:`inspect.BoundArguments.arguments` is changed from ``OrderedDict`` to " "regular dict. (Contributed by Inada Naoki in :issue:`36350` and :issue:" "`39775`.)" msgstr "" -#: ../../whatsnew/3.9.rst:547 +#: ../../whatsnew/3.9.rst:546 msgid "ipaddress" msgstr "ipaddress" -#: ../../whatsnew/3.9.rst:549 +#: ../../whatsnew/3.9.rst:548 msgid "" ":mod:`ipaddress` now supports IPv6 Scoped Addresses (IPv6 address with " "suffix ``%``)." msgstr "" -#: ../../whatsnew/3.9.rst:551 +#: ../../whatsnew/3.9.rst:550 msgid "" "Scoped IPv6 addresses can be parsed using :class:`ipaddress.IPv6Address`. If " "present, scope zone ID is available through the :attr:`~ipaddress." @@ -803,221 +800,221 @@ msgid "" "`34788`.)" msgstr "" -#: ../../whatsnew/3.9.rst:555 +#: ../../whatsnew/3.9.rst:554 msgid "" "Starting with Python 3.9.5 the :mod:`ipaddress` module no longer accepts any " "leading zeros in IPv4 address strings. (Contributed by Christian Heimes in :" "issue:`36384`)." msgstr "" -#: ../../whatsnew/3.9.rst:560 +#: ../../whatsnew/3.9.rst:559 msgid "math" msgstr "math" -#: ../../whatsnew/3.9.rst:562 +#: ../../whatsnew/3.9.rst:561 msgid "" "Expanded the :func:`math.gcd` function to handle multiple arguments. " "Formerly, it only supported two arguments. (Contributed by Serhiy Storchaka " "in :issue:`39648`.)" msgstr "" -#: ../../whatsnew/3.9.rst:566 +#: ../../whatsnew/3.9.rst:565 msgid "" "Added :func:`math.lcm`: return the least common multiple of specified " "arguments. (Contributed by Mark Dickinson, Ananthakrishnan and Serhiy " "Storchaka in :issue:`39479` and :issue:`39648`.)" msgstr "" -#: ../../whatsnew/3.9.rst:570 +#: ../../whatsnew/3.9.rst:569 msgid "" "Added :func:`math.nextafter`: return the next floating-point value after *x* " "towards *y*. (Contributed by Victor Stinner in :issue:`39288`.)" msgstr "" -#: ../../whatsnew/3.9.rst:574 +#: ../../whatsnew/3.9.rst:573 msgid "" "Added :func:`math.ulp`: return the value of the least significant bit of a " "float. (Contributed by Victor Stinner in :issue:`39310`.)" msgstr "" -#: ../../whatsnew/3.9.rst:579 +#: ../../whatsnew/3.9.rst:578 msgid "multiprocessing" msgstr "multiprocessing" -#: ../../whatsnew/3.9.rst:581 +#: ../../whatsnew/3.9.rst:580 msgid "" "The :class:`multiprocessing.SimpleQueue` class has a new :meth:" "`~multiprocessing.SimpleQueue.close` method to explicitly close the queue. " "(Contributed by Victor Stinner in :issue:`30966`.)" msgstr "" -#: ../../whatsnew/3.9.rst:587 +#: ../../whatsnew/3.9.rst:586 msgid "nntplib" msgstr "nntplib" -#: ../../whatsnew/3.9.rst:589 +#: ../../whatsnew/3.9.rst:588 msgid "" ":class:`~nntplib.NNTP` and :class:`~nntplib.NNTP_SSL` now raise a :class:" "`ValueError` if the given timeout for their constructor is zero to prevent " -"the creation of a non-blocking socket. (Contributed by Dong-hee Na in :issue:" +"the creation of a non-blocking socket. (Contributed by Donghee Na in :issue:" "`39259`.)" msgstr "" -#: ../../whatsnew/3.9.rst:594 +#: ../../whatsnew/3.9.rst:593 msgid "os" msgstr "os" -#: ../../whatsnew/3.9.rst:596 +#: ../../whatsnew/3.9.rst:595 msgid "" "Added :const:`~os.CLD_KILLED` and :const:`~os.CLD_STOPPED` for :attr:" -"`si_code`. (Contributed by Dong-hee Na in :issue:`38493`.)" +"`si_code`. (Contributed by Donghee Na in :issue:`38493`.)" msgstr "" -#: ../../whatsnew/3.9.rst:599 +#: ../../whatsnew/3.9.rst:598 msgid "" "Exposed the Linux-specific :func:`os.pidfd_open` (:issue:`38692`) and :const:" "`os.P_PIDFD` (:issue:`38713`) for process management with file descriptors." msgstr "" -#: ../../whatsnew/3.9.rst:603 +#: ../../whatsnew/3.9.rst:602 msgid "" "The :func:`os.unsetenv` function is now also available on Windows. " "(Contributed by Victor Stinner in :issue:`39413`.)" msgstr "" -#: ../../whatsnew/3.9.rst:606 +#: ../../whatsnew/3.9.rst:605 msgid "" "The :func:`os.putenv` and :func:`os.unsetenv` functions are now always " "available. (Contributed by Victor Stinner in :issue:`39395`.)" msgstr "" -#: ../../whatsnew/3.9.rst:610 +#: ../../whatsnew/3.9.rst:609 msgid "" "Added :func:`os.waitstatus_to_exitcode` function: convert a wait status to " "an exit code. (Contributed by Victor Stinner in :issue:`40094`.)" msgstr "" -#: ../../whatsnew/3.9.rst:615 +#: ../../whatsnew/3.9.rst:614 msgid "pathlib" msgstr "pathlib" -#: ../../whatsnew/3.9.rst:617 +#: ../../whatsnew/3.9.rst:616 msgid "" "Added :meth:`pathlib.Path.readlink()` which acts similarly to :func:`os." "readlink`. (Contributed by Girts Folkmanis in :issue:`30618`)" msgstr "" -#: ../../whatsnew/3.9.rst:622 +#: ../../whatsnew/3.9.rst:621 msgid "pdb" msgstr "pdb" -#: ../../whatsnew/3.9.rst:624 +#: ../../whatsnew/3.9.rst:623 msgid "" "On Windows now :class:`~pdb.Pdb` supports ``~/.pdbrc``. (Contributed by Tim " "Hopper and Dan Lidral-Porter in :issue:`20523`.)" msgstr "" -#: ../../whatsnew/3.9.rst:628 +#: ../../whatsnew/3.9.rst:627 msgid "poplib" msgstr "poplib" -#: ../../whatsnew/3.9.rst:630 +#: ../../whatsnew/3.9.rst:629 msgid "" ":class:`~poplib.POP3` and :class:`~poplib.POP3_SSL` now raise a :class:" "`ValueError` if the given timeout for their constructor is zero to prevent " -"the creation of a non-blocking socket. (Contributed by Dong-hee Na in :issue:" +"the creation of a non-blocking socket. (Contributed by Donghee Na in :issue:" "`39259`.)" msgstr "" -#: ../../whatsnew/3.9.rst:635 +#: ../../whatsnew/3.9.rst:634 msgid "pprint" msgstr "pprint" -#: ../../whatsnew/3.9.rst:637 +#: ../../whatsnew/3.9.rst:636 msgid "" ":mod:`pprint` can now pretty-print :class:`types.SimpleNamespace`. " "(Contributed by Carl Bordum Hansen in :issue:`37376`.)" msgstr "" -#: ../../whatsnew/3.9.rst:641 +#: ../../whatsnew/3.9.rst:640 msgid "pydoc" msgstr "pydoc" -#: ../../whatsnew/3.9.rst:643 +#: ../../whatsnew/3.9.rst:642 msgid "" "The documentation string is now shown not only for class, function, method " "etc, but for any object that has its own ``__doc__`` attribute. (Contributed " "by Serhiy Storchaka in :issue:`40257`.)" msgstr "" -#: ../../whatsnew/3.9.rst:648 +#: ../../whatsnew/3.9.rst:647 msgid "random" msgstr "random" -#: ../../whatsnew/3.9.rst:650 +#: ../../whatsnew/3.9.rst:649 msgid "" "Added a new :attr:`random.Random.randbytes` method: generate random bytes. " "(Contributed by Victor Stinner in :issue:`40286`.)" msgstr "" -#: ../../whatsnew/3.9.rst:654 +#: ../../whatsnew/3.9.rst:653 msgid "signal" msgstr "signal" -#: ../../whatsnew/3.9.rst:656 +#: ../../whatsnew/3.9.rst:655 msgid "" "Exposed the Linux-specific :func:`signal.pidfd_send_signal` for sending to " "signals to a process using a file descriptor instead of a pid. (:issue:" "`38712`)" msgstr "" -#: ../../whatsnew/3.9.rst:660 +#: ../../whatsnew/3.9.rst:659 msgid "smtplib" msgstr "smtplib" -#: ../../whatsnew/3.9.rst:662 +#: ../../whatsnew/3.9.rst:661 msgid "" ":class:`~smtplib.SMTP` and :class:`~smtplib.SMTP_SSL` now raise a :class:" "`ValueError` if the given timeout for their constructor is zero to prevent " -"the creation of a non-blocking socket. (Contributed by Dong-hee Na in :issue:" +"the creation of a non-blocking socket. (Contributed by Donghee Na in :issue:" "`39259`.)" msgstr "" -#: ../../whatsnew/3.9.rst:666 +#: ../../whatsnew/3.9.rst:665 msgid "" ":class:`~smtplib.LMTP` constructor now has an optional *timeout* parameter. " -"(Contributed by Dong-hee Na in :issue:`39329`.)" +"(Contributed by Donghee Na in :issue:`39329`.)" msgstr "" -#: ../../whatsnew/3.9.rst:670 +#: ../../whatsnew/3.9.rst:669 msgid "socket" msgstr "socket" -#: ../../whatsnew/3.9.rst:672 +#: ../../whatsnew/3.9.rst:671 msgid "" "The :mod:`socket` module now exports the :const:`~socket." "CAN_RAW_JOIN_FILTERS` constant on Linux 4.1 and greater. (Contributed by " "Stefan Tatschner and Zackery Spytz in :issue:`25780`.)" msgstr "" -#: ../../whatsnew/3.9.rst:676 +#: ../../whatsnew/3.9.rst:675 msgid "" "The socket module now supports the :const:`~socket.CAN_J1939` protocol on " "platforms that support it. (Contributed by Karl Ding in :issue:`40291`.)" msgstr "" -#: ../../whatsnew/3.9.rst:679 +#: ../../whatsnew/3.9.rst:678 msgid "" "The socket module now has the :func:`socket.send_fds` and :func:`socket." "recv_fds` functions. (Contributed by Joannah Nanjekye, Shinya Okano and " "Victor Stinner in :issue:`28724`.)" msgstr "" -#: ../../whatsnew/3.9.rst:685 +#: ../../whatsnew/3.9.rst:684 msgid "time" msgstr "time" -#: ../../whatsnew/3.9.rst:687 +#: ../../whatsnew/3.9.rst:686 msgid "" "On AIX, :func:`~time.thread_time` is now implemented with " "``thread_cputime()`` which has nanosecond resolution, rather than " @@ -1025,11 +1022,11 @@ msgid "" "milliseconds. (Contributed by Batuhan Taskaya in :issue:`40192`)" msgstr "" -#: ../../whatsnew/3.9.rst:693 +#: ../../whatsnew/3.9.rst:692 msgid "sys" msgstr "sys" -#: ../../whatsnew/3.9.rst:695 +#: ../../whatsnew/3.9.rst:694 msgid "" "Added a new :data:`sys.platlibdir` attribute: name of the platform-specific " "library directory. It is used to build the path of standard library and the " @@ -1039,29 +1036,29 @@ msgid "" "and Victor Stinner in :issue:`1294959`.)" msgstr "" -#: ../../whatsnew/3.9.rst:701 +#: ../../whatsnew/3.9.rst:700 msgid "" "Previously, :data:`sys.stderr` was block-buffered when non-interactive. Now " "``stderr`` defaults to always being line-buffered. (Contributed by Jendrik " "Seipp in :issue:`13601`.)" msgstr "" -#: ../../whatsnew/3.9.rst:706 +#: ../../whatsnew/3.9.rst:705 msgid "tracemalloc" msgstr "tracemalloc" -#: ../../whatsnew/3.9.rst:708 +#: ../../whatsnew/3.9.rst:707 msgid "" "Added :func:`tracemalloc.reset_peak` to set the peak size of traced memory " "blocks to the current size, to measure the peak of specific pieces of code. " "(Contributed by Huon Wilson in :issue:`40630`.)" msgstr "" -#: ../../whatsnew/3.9.rst:713 ../../whatsnew/3.9.rst:1496 +#: ../../whatsnew/3.9.rst:712 ../../whatsnew/3.9.rst:1495 msgid "typing" msgstr "typing" -#: ../../whatsnew/3.9.rst:715 +#: ../../whatsnew/3.9.rst:714 msgid "" ":pep:`593` introduced an :data:`typing.Annotated` type to decorate existing " "types with context-specific metadata and new ``include_extras`` parameter " @@ -1069,20 +1066,20 @@ msgid "" "(Contributed by Till Varoquaux and Konstantin Kashin.)" msgstr "" -#: ../../whatsnew/3.9.rst:721 +#: ../../whatsnew/3.9.rst:720 msgid "unicodedata" msgstr "unicodedata" -#: ../../whatsnew/3.9.rst:723 +#: ../../whatsnew/3.9.rst:722 msgid "" "The Unicode database has been updated to version 13.0.0. (:issue:`39926`)." msgstr "" -#: ../../whatsnew/3.9.rst:726 +#: ../../whatsnew/3.9.rst:725 msgid "venv" msgstr "venv" -#: ../../whatsnew/3.9.rst:728 +#: ../../whatsnew/3.9.rst:727 msgid "" "The activation scripts provided by :mod:`venv` now all specify their prompt " "customization consistently by always using the value specified by " @@ -1092,11 +1089,11 @@ msgid "" "Cannon in :issue:`37663`.)" msgstr "" -#: ../../whatsnew/3.9.rst:736 +#: ../../whatsnew/3.9.rst:735 msgid "xml" msgstr "xml" -#: ../../whatsnew/3.9.rst:738 +#: ../../whatsnew/3.9.rst:737 msgid "" "White space characters within attributes are now preserved when serializing :" "mod:`xml.etree.ElementTree` to XML file. EOLNs are no longer normalized to " @@ -1104,32 +1101,32 @@ msgid "" "2.11 of XML spec. (Contributed by Mefistotelis in :issue:`39011`.)" msgstr "" -#: ../../whatsnew/3.9.rst:746 +#: ../../whatsnew/3.9.rst:745 msgid "Optimizations" msgstr "最佳化" -#: ../../whatsnew/3.9.rst:748 +#: ../../whatsnew/3.9.rst:747 msgid "" "Optimized the idiom for assignment a temporary variable in comprehensions. " "Now ``for y in [expr]`` in comprehensions is as fast as a simple assignment " "``y = expr``. For example:" msgstr "" -#: ../../whatsnew/3.9.rst:752 +#: ../../whatsnew/3.9.rst:751 msgid "sums = [s for s in [0] for x in data for s in [s + x]]" -msgstr "" +msgstr "sums = [s for s in [0] for x in data for s in [s + x]]" -#: ../../whatsnew/3.9.rst:754 +#: ../../whatsnew/3.9.rst:753 msgid "" "Unlike the ``:=`` operator this idiom does not leak a variable to the outer " "scope." msgstr "" -#: ../../whatsnew/3.9.rst:757 +#: ../../whatsnew/3.9.rst:756 msgid "(Contributed by Serhiy Storchaka in :issue:`32856`.)" msgstr "(由 Serhiy Storchaka 在 :issue:`32856` 中貢獻。)" -#: ../../whatsnew/3.9.rst:759 +#: ../../whatsnew/3.9.rst:758 msgid "" "Optimized signal handling in multithreaded applications. If a thread " "different than the main thread gets a signal, the bytecode evaluation loop " @@ -1138,42 +1135,42 @@ msgid "" "interpreter can handle signals." msgstr "" -#: ../../whatsnew/3.9.rst:765 +#: ../../whatsnew/3.9.rst:764 msgid "" "Previously, the bytecode evaluation loop was interrupted at each instruction " "until the main thread handles signals. (Contributed by Victor Stinner in :" "issue:`40010`.)" msgstr "" -#: ../../whatsnew/3.9.rst:769 +#: ../../whatsnew/3.9.rst:768 msgid "" "Optimized the :mod:`subprocess` module on FreeBSD using ``closefrom()``. " "(Contributed by Ed Maste, Conrad Meyer, Kyle Evans, Kubilay Kocak and Victor " "Stinner in :issue:`38061`.)" msgstr "" -#: ../../whatsnew/3.9.rst:773 +#: ../../whatsnew/3.9.rst:772 msgid "" ":c:func:`PyLong_FromDouble` is now up to 1.87x faster for values that fit " "into :c:expr:`long`. (Contributed by Sergey Fedoseev in :issue:`37986`.)" msgstr "" -#: ../../whatsnew/3.9.rst:777 +#: ../../whatsnew/3.9.rst:776 msgid "" "A number of Python builtins (:class:`range`, :class:`tuple`, :class:`set`, :" "class:`frozenset`, :class:`list`, :class:`dict`) are now sped up by using :" -"pep:`590` vectorcall protocol. (Contributed by Dong-hee Na, Mark Shannon, " +"pep:`590` vectorcall protocol. (Contributed by Donghee Na, Mark Shannon, " "Jeroen Demeyer and Petr Viktorin in :issue:`37207`.)" msgstr "" -#: ../../whatsnew/3.9.rst:782 +#: ../../whatsnew/3.9.rst:781 msgid "" "Optimized :func:`~set.difference_update` for the case when the other set is " "much larger than the base set. (Suggested by Evgeny Kapun with code " "contributed by Michele Orrù in :issue:`8425`.)" msgstr "" -#: ../../whatsnew/3.9.rst:786 +#: ../../whatsnew/3.9.rst:785 msgid "" "Python's small object allocator (``obmalloc.c``) now allows (no more than) " "one empty arena to remain available for immediate reuse, without returning " @@ -1182,26 +1179,26 @@ msgid "" "in :issue:`37257`.)" msgstr "" -#: ../../whatsnew/3.9.rst:792 +#: ../../whatsnew/3.9.rst:791 msgid "" ":term:`floor division` of float operation now has a better performance. Also " "the message of :exc:`ZeroDivisionError` for this operation is updated. " -"(Contributed by Dong-hee Na in :issue:`39434`.)" +"(Contributed by Donghee Na in :issue:`39434`.)" msgstr "" -#: ../../whatsnew/3.9.rst:796 +#: ../../whatsnew/3.9.rst:795 msgid "" "Decoding short ASCII strings with UTF-8 and ascii codecs is now about 15% " "faster. (Contributed by Inada Naoki in :issue:`37348`.)" msgstr "" -#: ../../whatsnew/3.9.rst:799 +#: ../../whatsnew/3.9.rst:798 msgid "" "Here's a summary of performance improvements from Python 3.4 through Python " "3.9:" msgstr "" -#: ../../whatsnew/3.9.rst:846 +#: ../../whatsnew/3.9.rst:845 msgid "" "These results were generated from the variable access benchmark script at: " "``Tools/scripts/var_access_benchmark.py``. The benchmark script displays " @@ -1212,18 +1209,18 @@ msgid "" "python.org/downloads/macos/>`_." msgstr "" -#: ../../whatsnew/3.9.rst:856 +#: ../../whatsnew/3.9.rst:855 msgid "Deprecated" msgstr "已棄用" -#: ../../whatsnew/3.9.rst:858 +#: ../../whatsnew/3.9.rst:857 msgid "" "The distutils ``bdist_msi`` command is now deprecated, use ``bdist_wheel`` " "(wheel packages) instead. (Contributed by Hugo van Kemenade in :issue:" "`39586`.)" msgstr "" -#: ../../whatsnew/3.9.rst:862 +#: ../../whatsnew/3.9.rst:861 msgid "" "Currently :func:`math.factorial` accepts :class:`float` instances with non-" "negative integer values (like ``5.0``). It raises a :exc:`ValueError` for " @@ -1232,7 +1229,7 @@ msgid "" "Serhiy Storchaka in :issue:`37315`.)" msgstr "" -#: ../../whatsnew/3.9.rst:868 +#: ../../whatsnew/3.9.rst:867 msgid "" "The :mod:`parser` and :mod:`symbol` modules are deprecated and will be " "removed in future versions of Python. For the majority of use cases, users " @@ -1240,7 +1237,7 @@ msgid "" "stage, using the :mod:`ast` module." msgstr "" -#: ../../whatsnew/3.9.rst:873 +#: ../../whatsnew/3.9.rst:872 msgid "" "The Public C API functions :c:func:`!PyParser_SimpleParseStringFlags`, :c:" "func:`!PyParser_SimpleParseStringFlagsFilename`, :c:func:`!" @@ -1248,7 +1245,7 @@ msgid "" "and will be removed in Python 3.10 together with the old parser." msgstr "" -#: ../../whatsnew/3.9.rst:878 +#: ../../whatsnew/3.9.rst:877 msgid "" "Using :data:`NotImplemented` in a boolean context has been deprecated, as it " "is almost exclusively the result of incorrect rich comparator " @@ -1256,7 +1253,7 @@ msgid "" "Python. (Contributed by Josh Rosenberg in :issue:`35712`.)" msgstr "" -#: ../../whatsnew/3.9.rst:884 +#: ../../whatsnew/3.9.rst:883 msgid "" "The :mod:`random` module currently accepts any hashable type as a possible " "seed value. Unfortunately, some of those types are not guaranteed to have a " @@ -1265,7 +1262,7 @@ msgid "" "`bytes`, and :class:`bytearray`." msgstr "" -#: ../../whatsnew/3.9.rst:890 +#: ../../whatsnew/3.9.rst:889 msgid "" "Opening the :class:`~gzip.GzipFile` file for writing without specifying the " "*mode* argument is deprecated. In future Python versions it will always be " @@ -1274,39 +1271,39 @@ msgid "" "issue:`28286`.)" msgstr "" -#: ../../whatsnew/3.9.rst:896 +#: ../../whatsnew/3.9.rst:895 msgid "" "Deprecated the ``split()`` method of :class:`_tkinter.TkappType` in favour " "of the ``splitlist()`` method which has more consistent and predicable " "behavior. (Contributed by Serhiy Storchaka in :issue:`38371`.)" msgstr "" -#: ../../whatsnew/3.9.rst:901 +#: ../../whatsnew/3.9.rst:900 msgid "" "The explicit passing of coroutine objects to :func:`asyncio.wait` has been " "deprecated and will be removed in version 3.11. (Contributed by Yury " "Selivanov and Kyle Stanley in :issue:`34790`.)" msgstr "" -#: ../../whatsnew/3.9.rst:905 +#: ../../whatsnew/3.9.rst:904 msgid "" "binhex4 and hexbin4 standards are now deprecated. The :mod:`binhex` module " "and the following :mod:`binascii` functions are now deprecated:" msgstr "" -#: ../../whatsnew/3.9.rst:908 +#: ../../whatsnew/3.9.rst:907 msgid ":func:`~binascii.b2a_hqx`, :func:`~binascii.a2b_hqx`" msgstr ":func:`~binascii.b2a_hqx`\\ 、\\ :func:`~binascii.a2b_hqx`" -#: ../../whatsnew/3.9.rst:909 +#: ../../whatsnew/3.9.rst:908 msgid ":func:`~binascii.rlecode_hqx`, :func:`~binascii.rledecode_hqx`" msgstr ":func:`~binascii.rlecode_hqx`\\ 、\\ :func:`~binascii.rledecode_hqx`" -#: ../../whatsnew/3.9.rst:911 +#: ../../whatsnew/3.9.rst:910 msgid "(Contributed by Victor Stinner in :issue:`39353`.)" msgstr "(由 Victor Stinner 在 :issue:`39353` 中貢獻。)" -#: ../../whatsnew/3.9.rst:913 +#: ../../whatsnew/3.9.rst:912 msgid "" ":mod:`ast` classes ``slice``, ``Index`` and ``ExtSlice`` are considered " "deprecated and will be removed in future Python versions. ``value`` itself " @@ -1315,7 +1312,7 @@ msgid "" "Storchaka in :issue:`34822`.)" msgstr "" -#: ../../whatsnew/3.9.rst:919 +#: ../../whatsnew/3.9.rst:918 msgid "" ":mod:`ast` classes ``Suite``, ``Param``, ``AugLoad`` and ``AugStore`` are " "considered deprecated and will be removed in future Python versions. They " @@ -1324,7 +1321,7 @@ msgid "" "`39969` and Serhiy Storchaka in :issue:`39988`.)" msgstr "" -#: ../../whatsnew/3.9.rst:926 +#: ../../whatsnew/3.9.rst:925 msgid "" "The :c:func:`!PyEval_InitThreads` and :c:func:`!PyEval_ThreadsInitialized` " "functions are now deprecated and will be removed in Python 3.11. Calling :c:" @@ -1333,20 +1330,20 @@ msgid "" "in :issue:`39877`.)" msgstr "" -#: ../../whatsnew/3.9.rst:932 +#: ../../whatsnew/3.9.rst:931 msgid "" "Passing ``None`` as the first argument to the :func:`shlex.split` function " "has been deprecated. (Contributed by Zackery Spytz in :issue:`33262`.)" msgstr "" -#: ../../whatsnew/3.9.rst:935 +#: ../../whatsnew/3.9.rst:934 msgid "" ":func:`smtpd.MailmanProxy` is now deprecated as it is unusable without an " "external module, ``mailman``. (Contributed by Samuel Colvin in :issue:" "`35800`.)" msgstr "" -#: ../../whatsnew/3.9.rst:938 +#: ../../whatsnew/3.9.rst:937 msgid "" "The :mod:`lib2to3` module now emits a :exc:`PendingDeprecationWarning`. " "Python 3.9 switched to a PEG parser (see :pep:`617`), and Python 3.10 may " @@ -1356,39 +1353,39 @@ msgid "" "`parso`_. (Contributed by Carl Meyer in :issue:`40360`.)" msgstr "" -#: ../../whatsnew/3.9.rst:946 +#: ../../whatsnew/3.9.rst:945 msgid "" "The *random* parameter of :func:`random.shuffle` has been deprecated. " "(Contributed by Raymond Hettinger in :issue:`40465`)" msgstr "" -#: ../../whatsnew/3.9.rst:955 ../../whatsnew/3.9.rst:1410 +#: ../../whatsnew/3.9.rst:954 ../../whatsnew/3.9.rst:1409 msgid "Removed" msgstr "已移除" -#: ../../whatsnew/3.9.rst:957 +#: ../../whatsnew/3.9.rst:956 msgid "" "The erroneous version at :data:`unittest.mock.__version__` has been removed." msgstr "" -#: ../../whatsnew/3.9.rst:959 +#: ../../whatsnew/3.9.rst:958 msgid "" ":class:`nntplib.NNTP`: ``xpath()`` and ``xgtitle()`` methods have been " "removed. These methods are deprecated since Python 3.3. Generally, these " "extensions are not supported or not enabled by NNTP server administrators. " "For ``xgtitle()``, please use :meth:`nntplib.NNTP.descriptions` or :meth:" -"`nntplib.NNTP.description` instead. (Contributed by Dong-hee Na in :issue:" +"`nntplib.NNTP.description` instead. (Contributed by Donghee Na in :issue:" "`39366`.)" msgstr "" -#: ../../whatsnew/3.9.rst:966 +#: ../../whatsnew/3.9.rst:965 msgid "" ":class:`array.array`: ``tostring()`` and ``fromstring()`` methods have been " "removed. They were aliases to ``tobytes()`` and ``frombytes()``, deprecated " "since Python 3.2. (Contributed by Victor Stinner in :issue:`38916`.)" msgstr "" -#: ../../whatsnew/3.9.rst:971 +#: ../../whatsnew/3.9.rst:970 msgid "" "The undocumented ``sys.callstats()`` function has been removed. Since Python " "3.7, it was deprecated and always returned :const:`None`. It required a " @@ -1396,7 +1393,7 @@ msgid "" "3.7. (Contributed by Victor Stinner in :issue:`37414`.)" msgstr "" -#: ../../whatsnew/3.9.rst:976 +#: ../../whatsnew/3.9.rst:975 msgid "" "The ``sys.getcheckinterval()`` and ``sys.setcheckinterval()`` functions have " "been removed. They were deprecated since Python 3.2. Use :func:`sys." @@ -1404,21 +1401,21 @@ msgid "" "by Victor Stinner in :issue:`37392`.)" msgstr "" -#: ../../whatsnew/3.9.rst:981 +#: ../../whatsnew/3.9.rst:980 msgid "" "The C function ``PyImport_Cleanup()`` has been removed. It was documented " "as: \"Empty the module table. For internal use only.\" (Contributed by " "Victor Stinner in :issue:`36710`.)" msgstr "" -#: ../../whatsnew/3.9.rst:985 +#: ../../whatsnew/3.9.rst:984 msgid "" "``_dummy_thread`` and ``dummy_threading`` modules have been removed. These " "modules were deprecated since Python 3.7 which requires threading support. " "(Contributed by Victor Stinner in :issue:`37312`.)" msgstr "" -#: ../../whatsnew/3.9.rst:989 +#: ../../whatsnew/3.9.rst:988 msgid "" "``aifc.openfp()`` alias to ``aifc.open()``, ``sunau.openfp()`` alias to " "``sunau.open()``, and ``wave.openfp()`` alias to :func:`wave.open()` have " @@ -1426,14 +1423,14 @@ msgid "" "Stinner in :issue:`37320`.)" msgstr "" -#: ../../whatsnew/3.9.rst:994 +#: ../../whatsnew/3.9.rst:993 msgid "" "The :meth:`~threading.Thread.isAlive()` method of :class:`threading.Thread` " "has been removed. It was deprecated since Python 3.8. Use :meth:`~threading." -"Thread.is_alive()` instead. (Contributed by Dong-hee Na in :issue:`37804`.)" +"Thread.is_alive()` instead. (Contributed by Donghee Na in :issue:`37804`.)" msgstr "" -#: ../../whatsnew/3.9.rst:999 +#: ../../whatsnew/3.9.rst:998 msgid "" "Methods ``getchildren()`` and ``getiterator()`` of classes :class:`~xml." "etree.ElementTree.ElementTree` and :class:`~xml.etree.ElementTree.Element` " @@ -1443,7 +1440,7 @@ msgid "" "getiterator()``. (Contributed by Serhiy Storchaka in :issue:`36543`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1007 +#: ../../whatsnew/3.9.rst:1006 msgid "" "The old :mod:`plistlib` API has been removed, it was deprecated since Python " "3.4. Use the :func:`~plistlib.load`, :func:`~plistlib.loads`, :func:" @@ -1452,7 +1449,7 @@ msgid "" "are always used instead. (Contributed by Jon Janzen in :issue:`36409`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1013 +#: ../../whatsnew/3.9.rst:1012 msgid "" "The C function ``PyGen_NeedsFinalizing`` has been removed. It was not " "documented, tested, or used anywhere within CPython after the implementation " @@ -1460,7 +1457,7 @@ msgid "" "in :issue:`15088`)" msgstr "" -#: ../../whatsnew/3.9.rst:1018 +#: ../../whatsnew/3.9.rst:1017 msgid "" "``base64.encodestring()`` and ``base64.decodestring()``, aliases deprecated " "since Python 3.1, have been removed: use :func:`base64.encodebytes` and :" @@ -1468,14 +1465,14 @@ msgid "" "`39351`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1023 +#: ../../whatsnew/3.9.rst:1022 msgid "" "``fractions.gcd()`` function has been removed, it was deprecated since " "Python 3.5 (:issue:`22486`): use :func:`math.gcd` instead. (Contributed by " "Victor Stinner in :issue:`39350`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1027 +#: ../../whatsnew/3.9.rst:1026 msgid "" "The *buffering* parameter of :class:`bz2.BZ2File` has been removed. Since " "Python 3.0, it was ignored and using it emitted a :exc:`DeprecationWarning`. " @@ -1483,7 +1480,7 @@ msgid "" "Victor Stinner in :issue:`39357`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1032 +#: ../../whatsnew/3.9.rst:1031 msgid "" "The *encoding* parameter of :func:`json.loads` has been removed. As of " "Python 3.1, it was deprecated and ignored; using it has emitted a :exc:" @@ -1491,7 +1488,7 @@ msgid "" "`39377`)" msgstr "" -#: ../../whatsnew/3.9.rst:1037 +#: ../../whatsnew/3.9.rst:1036 msgid "" "``with (await asyncio.lock):`` and ``with (yield from asyncio.lock):`` " "statements are not longer supported, use ``async with lock`` instead. The " @@ -1499,7 +1496,7 @@ msgid "" "(Contributed by Andrew Svetlov in :issue:`34793`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1042 +#: ../../whatsnew/3.9.rst:1041 msgid "" "The :func:`sys.getcounts` function, the ``-X showalloccount`` command line " "option and the ``show_alloc_count`` field of the C structure :c:type:" @@ -1508,7 +1505,7 @@ msgid "" "`39489`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1048 +#: ../../whatsnew/3.9.rst:1047 msgid "" "The ``_field_types`` attribute of the :class:`typing.NamedTuple` class has " "been removed. It was deprecated since Python 3.8. Use the " @@ -1516,14 +1513,14 @@ msgid "" "issue:`40182`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1053 +#: ../../whatsnew/3.9.rst:1052 msgid "" "The :meth:`symtable.SymbolTable.has_exec` method has been removed. It was " "deprecated since 2006, and only returning ``False`` when it's called. " "(Contributed by Batuhan Taskaya in :issue:`40208`)" msgstr "" -#: ../../whatsnew/3.9.rst:1057 +#: ../../whatsnew/3.9.rst:1056 msgid "" "The :meth:`asyncio.Task.current_task` and :meth:`asyncio.Task.all_tasks` " "have been removed. They were deprecated since Python 3.7 and you can use :" @@ -1531,7 +1528,7 @@ msgid "" "(Contributed by Rémi Lapeyre in :issue:`40967`)" msgstr "" -#: ../../whatsnew/3.9.rst:1062 +#: ../../whatsnew/3.9.rst:1061 msgid "" "The ``unescape()`` method in the :class:`html.parser.HTMLParser` class has " "been removed (it was deprecated since Python 3.4). :func:`html.unescape` " @@ -1539,21 +1536,21 @@ msgid "" "unicode characters." msgstr "" -#: ../../whatsnew/3.9.rst:1069 ../../whatsnew/3.9.rst:1336 +#: ../../whatsnew/3.9.rst:1068 ../../whatsnew/3.9.rst:1335 msgid "Porting to Python 3.9" msgstr "" -#: ../../whatsnew/3.9.rst:1071 +#: ../../whatsnew/3.9.rst:1070 msgid "" "This section lists previously described changes and other bugfixes that may " "require changes to your code." msgstr "" -#: ../../whatsnew/3.9.rst:1076 +#: ../../whatsnew/3.9.rst:1075 msgid "Changes in the Python API" msgstr "" -#: ../../whatsnew/3.9.rst:1078 +#: ../../whatsnew/3.9.rst:1077 msgid "" ":func:`__import__` and :func:`importlib.util.resolve_name` now raise :exc:" "`ImportError` where it previously raised :exc:`ValueError`. Callers catching " @@ -1561,26 +1558,26 @@ msgid "" "versions will need to catch both using ``except (ImportError, ValueError):``." msgstr "" -#: ../../whatsnew/3.9.rst:1083 +#: ../../whatsnew/3.9.rst:1082 msgid "" "The :mod:`venv` activation scripts no longer special-case when " "``__VENV_PROMPT__`` is set to ``\"\"``." msgstr "" -#: ../../whatsnew/3.9.rst:1086 +#: ../../whatsnew/3.9.rst:1085 msgid "" "The :meth:`select.epoll.unregister` method no longer ignores the :const:" "`~errno.EBADF` error. (Contributed by Victor Stinner in :issue:`39239`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1090 +#: ../../whatsnew/3.9.rst:1089 msgid "" "The *compresslevel* parameter of :class:`bz2.BZ2File` became keyword-only, " "since the *buffering* parameter has been removed. (Contributed by Victor " "Stinner in :issue:`39357`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1094 +#: ../../whatsnew/3.9.rst:1093 msgid "" "Simplified AST for subscription. Simple indices will be represented by their " "value, extended slices will be represented as tuples. ``Index(value)`` will " @@ -1588,21 +1585,21 @@ msgid "" "Load())``. (Contributed by Serhiy Storchaka in :issue:`34822`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1100 +#: ../../whatsnew/3.9.rst:1099 msgid "" "The :mod:`importlib` module now ignores the :envvar:`PYTHONCASEOK` " "environment variable when the :option:`-E` or :option:`-I` command line " "options are being used." msgstr "" -#: ../../whatsnew/3.9.rst:1104 +#: ../../whatsnew/3.9.rst:1103 msgid "" "The *encoding* parameter has been added to the classes :class:`ftplib.FTP` " "and :class:`ftplib.FTP_TLS` as a keyword-only parameter, and the default " "encoding is changed from Latin-1 to UTF-8 to follow :rfc:`2640`." msgstr "" -#: ../../whatsnew/3.9.rst:1108 +#: ../../whatsnew/3.9.rst:1107 msgid "" ":meth:`asyncio.loop.shutdown_default_executor` has been added to :class:" "`~asyncio.AbstractEventLoop`, meaning alternative event loops that inherit " @@ -1610,7 +1607,7 @@ msgid "" "issue:`34037`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1113 +#: ../../whatsnew/3.9.rst:1112 msgid "" "The constant values of future flags in the :mod:`__future__` module is " "updated in order to prevent collision with compiler flags. Previously " @@ -1618,7 +1615,7 @@ msgid "" "(Contributed by Batuhan Taskaya in :issue:`39562`)" msgstr "" -#: ../../whatsnew/3.9.rst:1118 +#: ../../whatsnew/3.9.rst:1117 msgid "" "``array('u')`` now uses :c:type:`wchar_t` as C type instead of " "``Py_UNICODE``. This change doesn't affect to its behavior because " @@ -1626,7 +1623,7 @@ msgid "" "by Inada Naoki in :issue:`34538`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1123 +#: ../../whatsnew/3.9.rst:1122 msgid "" "The :func:`logging.getLogger` API now returns the root logger when passed " "the name ``'root'``, whereas previously it returned a non-root logger named " @@ -1636,7 +1633,7 @@ msgid "" "(Contributed by Vinay Sajip in :issue:`37742`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1130 +#: ../../whatsnew/3.9.rst:1129 msgid "" "Division handling of :class:`~pathlib.PurePath` now returns " "``NotImplemented`` instead of raising a :exc:`TypeError` when passed " @@ -1645,7 +1642,7 @@ msgid "" "mentioned types. (Contributed by Roger Aiudi in :issue:`34775`)." msgstr "" -#: ../../whatsnew/3.9.rst:1136 +#: ../../whatsnew/3.9.rst:1135 msgid "" "Starting with Python 3.9.5 the :mod:`ipaddress` module no longer accepts any " "leading zeros in IPv4 address strings. Leading zeros are ambiguous and " @@ -1655,7 +1652,7 @@ msgid "" "leading zeros. (Contributed by Christian Heimes in :issue:`36384`)." msgstr "" -#: ../../whatsnew/3.9.rst:1144 +#: ../../whatsnew/3.9.rst:1143 msgid "" ":func:`codecs.lookup` now normalizes the encoding name the same way as :func:" "`encodings.normalize_encoding`, except that :func:`codecs.lookup` also " @@ -1664,11 +1661,11 @@ msgid "" "in :issue:`37751`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1152 +#: ../../whatsnew/3.9.rst:1151 msgid "Changes in the C API" msgstr "C API 中的改動" -#: ../../whatsnew/3.9.rst:1154 +#: ../../whatsnew/3.9.rst:1153 msgid "" "Instances of :ref:`heap-allocated types ` (such as those created " "with :c:func:`PyType_FromSpec` and similar APIs) hold a reference to their " @@ -1679,7 +1676,7 @@ msgid "" "heap-allocated types visit the object's type." msgstr "" -#: ../../whatsnew/3.9.rst:1175 +#: ../../whatsnew/3.9.rst:1174 msgid "" "If your traverse function delegates to ``tp_traverse`` of its base class (or " "another type), ensure that ``Py_TYPE(self)`` is visited only once. Note that " @@ -1687,19 +1684,19 @@ msgid "" "``tp_traverse``." msgstr "" -#: ../../whatsnew/3.9.rst:1180 +#: ../../whatsnew/3.9.rst:1179 msgid "For example, if your ``tp_traverse`` function includes:" msgstr "" -#: ../../whatsnew/3.9.rst:1186 +#: ../../whatsnew/3.9.rst:1185 msgid "then add:" msgstr "" -#: ../../whatsnew/3.9.rst:1199 +#: ../../whatsnew/3.9.rst:1198 msgid "(See :issue:`35810` and :issue:`40217` for more information.)" msgstr "(更多資訊請見 :issue:`35810` 與 :issue:`40217`\\ 。)" -#: ../../whatsnew/3.9.rst:1201 +#: ../../whatsnew/3.9.rst:1200 msgid "" "The functions ``PyEval_CallObject``, ``PyEval_CallFunction``, " "``PyEval_CallMethod`` and ``PyEval_CallObjectWithKeywords`` are deprecated. " @@ -1707,11 +1704,11 @@ msgid "" "issue:`29548`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1207 +#: ../../whatsnew/3.9.rst:1206 msgid "CPython bytecode changes" msgstr "" -#: ../../whatsnew/3.9.rst:1209 +#: ../../whatsnew/3.9.rst:1208 msgid "" "The :opcode:`LOAD_ASSERTION_ERROR` opcode was added for handling the :" "keyword:`assert` statement. Previously, the assert statement would not work " @@ -1719,37 +1716,37 @@ msgid "" "(Contributed by Zackery Spytz in :issue:`34880`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1214 +#: ../../whatsnew/3.9.rst:1213 msgid "" "The :opcode:`COMPARE_OP` opcode was split into four distinct instructions:" msgstr "" -#: ../../whatsnew/3.9.rst:1216 +#: ../../whatsnew/3.9.rst:1215 msgid "``COMPARE_OP`` for rich comparisons" msgstr "" -#: ../../whatsnew/3.9.rst:1217 +#: ../../whatsnew/3.9.rst:1216 msgid "``IS_OP`` for 'is' and 'is not' tests" msgstr "" -#: ../../whatsnew/3.9.rst:1218 +#: ../../whatsnew/3.9.rst:1217 msgid "``CONTAINS_OP`` for 'in' and 'not in' tests" msgstr "" -#: ../../whatsnew/3.9.rst:1219 +#: ../../whatsnew/3.9.rst:1218 msgid "" "``JUMP_IF_NOT_EXC_MATCH`` for checking exceptions in 'try-except' statements." msgstr "" -#: ../../whatsnew/3.9.rst:1222 +#: ../../whatsnew/3.9.rst:1221 msgid "(Contributed by Mark Shannon in :issue:`39156`.)" msgstr "(由 Mark Shannon 在 :issue:`39156` 中貢獻。)" -#: ../../whatsnew/3.9.rst:1226 +#: ../../whatsnew/3.9.rst:1225 msgid "Build Changes" msgstr "" -#: ../../whatsnew/3.9.rst:1228 +#: ../../whatsnew/3.9.rst:1227 msgid "" "Added ``--with-platlibdir`` option to the ``configure`` script: name of the " "platform-specific library directory, stored in the new :data:`sys." @@ -1758,26 +1755,26 @@ msgid "" "and Victor Stinner in :issue:`1294959`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1234 +#: ../../whatsnew/3.9.rst:1233 msgid "" "The ``COUNT_ALLOCS`` special build macro has been removed. (Contributed by " "Victor Stinner in :issue:`39489`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1237 +#: ../../whatsnew/3.9.rst:1236 msgid "" "On non-Windows platforms, the :c:func:`setenv` and :c:func:`unsetenv` " "functions are now required to build Python. (Contributed by Victor Stinner " "in :issue:`39395`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1241 +#: ../../whatsnew/3.9.rst:1240 msgid "" "On non-Windows platforms, creating ``bdist_wininst`` installers is now " "officially unsupported. (See :issue:`10945` for more details.)" msgstr "" -#: ../../whatsnew/3.9.rst:1244 +#: ../../whatsnew/3.9.rst:1243 msgid "" "When building Python on macOS from source, ``_tkinter`` now links with non-" "system Tcl and Tk frameworks if they are installed in ``/Library/" @@ -1788,13 +1785,13 @@ msgid "" "(Contributed by Ned Deily in :issue:`34956`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1253 +#: ../../whatsnew/3.9.rst:1252 msgid "" "Python can now be built for Windows 10 ARM64. (Contributed by Steve Dower " "in :issue:`33125`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1256 +#: ../../whatsnew/3.9.rst:1255 msgid "" "Some individual tests are now skipped when ``--pgo`` is used. The tests in " "question increased the PGO task time significantly and likely didn't help " @@ -1810,11 +1807,11 @@ msgid "" "details.)" msgstr "" -#: ../../whatsnew/3.9.rst:1271 +#: ../../whatsnew/3.9.rst:1270 msgid "C API Changes" msgstr "" -#: ../../whatsnew/3.9.rst:1276 +#: ../../whatsnew/3.9.rst:1275 msgid "" ":pep:`573`: Added :c:func:`PyType_FromModuleAndSpec` to associate a module " "with a class; :c:func:`PyType_GetModule` and :c:func:`PyType_GetModuleState` " @@ -1823,20 +1820,20 @@ msgid "" "(Contributed by Marcel Plch and Petr Viktorin in :issue:`38787`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1283 +#: ../../whatsnew/3.9.rst:1282 msgid "" "Added :c:func:`PyFrame_GetCode` function: get a frame code. Added :c:func:" "`PyFrame_GetBack` function: get the frame next outer frame. (Contributed by " "Victor Stinner in :issue:`40421`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1287 +#: ../../whatsnew/3.9.rst:1286 msgid "" "Added :c:func:`PyFrame_GetLineNumber` to the limited C API. (Contributed by " "Victor Stinner in :issue:`40421`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1290 +#: ../../whatsnew/3.9.rst:1289 msgid "" "Added :c:func:`PyThreadState_GetInterpreter` and :c:func:" "`PyInterpreterState_Get` functions to get the interpreter. Added :c:func:" @@ -1846,7 +1843,7 @@ msgid "" "issue:`39947`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1298 +#: ../../whatsnew/3.9.rst:1297 msgid "" "Added a new public :c:func:`PyObject_CallNoArgs` function to the C API, " "which calls a callable Python object without any arguments. It is the most " @@ -1854,11 +1851,11 @@ msgid "" "(Contributed by Victor Stinner in :issue:`37194`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1303 ../../whatsnew/3.9.rst:1421 +#: ../../whatsnew/3.9.rst:1302 ../../whatsnew/3.9.rst:1420 msgid "Changes in the limited C API (if ``Py_LIMITED_API`` macro is defined):" msgstr "" -#: ../../whatsnew/3.9.rst:1305 +#: ../../whatsnew/3.9.rst:1304 msgid "" "Provide :c:func:`Py_EnterRecursiveCall` and :c:func:`Py_LeaveRecursiveCall` " "as regular functions for the limited API. Previously, there were defined as " @@ -1867,23 +1864,23 @@ msgid "" "the limited C API)." msgstr "" -#: ../../whatsnew/3.9.rst:1311 +#: ../../whatsnew/3.9.rst:1310 msgid "" "``PyObject_INIT()`` and ``PyObject_INIT_VAR()`` become regular \"opaque\" " "function to hide implementation details." msgstr "" -#: ../../whatsnew/3.9.rst:1314 ../../whatsnew/3.9.rst:1448 +#: ../../whatsnew/3.9.rst:1313 ../../whatsnew/3.9.rst:1447 msgid "(Contributed by Victor Stinner in :issue:`38644` and :issue:`39542`.)" msgstr "(由 Victor Stinner 在 38644 和 39542 中貢獻。)" -#: ../../whatsnew/3.9.rst:1316 +#: ../../whatsnew/3.9.rst:1315 msgid "" "The :c:func:`PyModule_AddType` function is added to help adding a type to a " -"module. (Contributed by Dong-hee Na in :issue:`40024`.)" +"module. (Contributed by Donghee Na in :issue:`40024`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1320 +#: ../../whatsnew/3.9.rst:1319 msgid "" "Added the functions :c:func:`PyObject_GC_IsTracked` and :c:func:" "`PyObject_GC_IsFinalized` to the public API to allow to query if Python " @@ -1892,27 +1889,27 @@ msgid "" "issue:`40241`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1326 +#: ../../whatsnew/3.9.rst:1325 msgid "" "Added :c:func:`_PyObject_FunctionStr` to get a user-friendly string " "representation of a function-like object. (Patch by Jeroen Demeyer in :issue:" "`37645`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1330 +#: ../../whatsnew/3.9.rst:1329 msgid "" "Added :c:func:`PyObject_CallOneArg` for calling an object with one " "positional argument (Patch by Jeroen Demeyer in :issue:`37483`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1338 +#: ../../whatsnew/3.9.rst:1337 msgid "" "``PyInterpreterState.eval_frame`` (:pep:`523`) now requires a new mandatory " "*tstate* parameter (``PyThreadState*``). (Contributed by Victor Stinner in :" "issue:`38500`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1342 +#: ../../whatsnew/3.9.rst:1341 msgid "" "Extension modules: :c:member:`~PyModuleDef.m_traverse`, :c:member:" "`~PyModuleDef.m_clear` and :c:member:`~PyModuleDef.m_free` functions of :c:" @@ -1924,12 +1921,12 @@ msgid "" "`PyModule_GetState`) is ``NULL``." msgstr "" -#: ../../whatsnew/3.9.rst:1351 +#: ../../whatsnew/3.9.rst:1350 msgid "" "Extension modules without module state (``m_size <= 0``) are not affected." msgstr "" -#: ../../whatsnew/3.9.rst:1353 +#: ../../whatsnew/3.9.rst:1352 msgid "" "If :c:func:`Py_AddPendingCall` is called in a subinterpreter, the function " "is now scheduled to be called from the subinterpreter, rather than being " @@ -1937,7 +1934,7 @@ msgid "" "of scheduled calls. (Contributed by Victor Stinner in :issue:`39984`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1359 +#: ../../whatsnew/3.9.rst:1358 msgid "" "The Windows registry is no longer used to initialize :data:`sys.path` when " "the ``-E`` option is used (if :c:member:`PyConfig.use_environment` is set to " @@ -1945,21 +1942,21 @@ msgid "" "by Zackery Spytz in :issue:`8901`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1364 +#: ../../whatsnew/3.9.rst:1363 msgid "" "The global variable :c:data:`PyStructSequence_UnnamedField` is now a " "constant and refers to a constant string. (Contributed by Serhiy Storchaka " "in :issue:`38650`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1368 +#: ../../whatsnew/3.9.rst:1367 msgid "" "The :c:type:`PyGC_Head` structure is now opaque. It is only defined in the " "internal C API (``pycore_gc.h``). (Contributed by Victor Stinner in :issue:" "`40241`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1372 +#: ../../whatsnew/3.9.rst:1371 msgid "" "The ``Py_UNICODE_COPY``, ``Py_UNICODE_FILL``, ``PyUnicode_WSTR_LENGTH``, :c:" "func:`!PyUnicode_FromUnicode`, :c:func:`!PyUnicode_AsUnicode`, " @@ -1968,7 +1965,7 @@ msgid "" "Python 3.3. (Contributed by Inada Naoki in :issue:`36346`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1379 +#: ../../whatsnew/3.9.rst:1378 msgid "" "The :c:func:`Py_FatalError` function is replaced with a macro which logs " "automatically the name of the current function, unless the " @@ -1976,22 +1973,22 @@ msgid "" "issue:`39882`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1384 +#: ../../whatsnew/3.9.rst:1383 msgid "" "The vectorcall protocol now requires that the caller passes only strings as " "keyword names. (See :issue:`37540` for more information.)" msgstr "" -#: ../../whatsnew/3.9.rst:1387 +#: ../../whatsnew/3.9.rst:1386 msgid "" "Implementation details of a number of macros and functions are now hidden:" msgstr "" -#: ../../whatsnew/3.9.rst:1389 +#: ../../whatsnew/3.9.rst:1388 msgid ":c:func:`PyObject_IS_GC` macro was converted to a function." msgstr "" -#: ../../whatsnew/3.9.rst:1391 +#: ../../whatsnew/3.9.rst:1390 msgid "" "The :c:func:`PyObject_NEW` macro becomes an alias to the :c:macro:" "`PyObject_New` macro, and the :c:func:`PyObject_NEW_VAR` macro becomes an " @@ -1999,38 +1996,38 @@ msgid "" "directly the :c:member:`PyTypeObject.tp_basicsize` member." msgstr "" -#: ../../whatsnew/3.9.rst:1396 +#: ../../whatsnew/3.9.rst:1395 msgid "" ":c:func:`PyObject_GET_WEAKREFS_LISTPTR` macro was converted to a function: " "the macro accessed directly the :c:member:`PyTypeObject.tp_weaklistoffset` " "member." msgstr "" -#: ../../whatsnew/3.9.rst:1400 +#: ../../whatsnew/3.9.rst:1399 msgid "" ":c:func:`PyObject_CheckBuffer` macro was converted to a function: the macro " "accessed directly the :c:member:`PyTypeObject.tp_as_buffer` member." msgstr "" -#: ../../whatsnew/3.9.rst:1403 +#: ../../whatsnew/3.9.rst:1402 msgid "" ":c:func:`PyIndex_Check` is now always declared as an opaque function to hide " "implementation details: removed the ``PyIndex_Check()`` macro. The macro " "accessed directly the :c:member:`PyTypeObject.tp_as_number` member." msgstr "" -#: ../../whatsnew/3.9.rst:1407 +#: ../../whatsnew/3.9.rst:1406 msgid "(See :issue:`40170` for more details.)" msgstr "(更多資訊請見 :issue:`40170`\\ 。)" -#: ../../whatsnew/3.9.rst:1412 +#: ../../whatsnew/3.9.rst:1411 msgid "" "Excluded ``PyFPE_START_PROTECT()`` and ``PyFPE_END_PROTECT()`` macros of " "``pyfpe.h`` from the limited C API. (Contributed by Victor Stinner in :issue:" "`38835`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1416 +#: ../../whatsnew/3.9.rst:1415 msgid "" "The ``tp_print`` slot of :ref:`PyTypeObject ` has been " "removed. It was used for printing objects to files in Python 2.7 and before. " @@ -2038,89 +2035,89 @@ msgid "" "Demeyer in :issue:`36974`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1423 +#: ../../whatsnew/3.9.rst:1422 msgid "Excluded the following functions from the limited C API:" msgstr "" -#: ../../whatsnew/3.9.rst:1425 +#: ../../whatsnew/3.9.rst:1424 msgid "" "``PyThreadState_DeleteCurrent()`` (Contributed by Joannah Nanjekye in :issue:" "`37878`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1427 +#: ../../whatsnew/3.9.rst:1426 msgid "``_Py_CheckRecursionLimit``" msgstr "``_Py_CheckRecursionLimit``" -#: ../../whatsnew/3.9.rst:1428 +#: ../../whatsnew/3.9.rst:1427 msgid "``_Py_NewReference()``" msgstr "``_Py_NewReference()``" -#: ../../whatsnew/3.9.rst:1429 +#: ../../whatsnew/3.9.rst:1428 msgid "``_Py_ForgetReference()``" msgstr "``_Py_ForgetReference()``" -#: ../../whatsnew/3.9.rst:1430 +#: ../../whatsnew/3.9.rst:1429 msgid "``_PyTraceMalloc_NewReference()``" msgstr "``_PyTraceMalloc_NewReference()``" -#: ../../whatsnew/3.9.rst:1431 +#: ../../whatsnew/3.9.rst:1430 msgid "``_Py_GetRefTotal()``" msgstr "``_Py_GetRefTotal()``" -#: ../../whatsnew/3.9.rst:1432 +#: ../../whatsnew/3.9.rst:1431 msgid "The trashcan mechanism which never worked in the limited C API." msgstr "" -#: ../../whatsnew/3.9.rst:1433 +#: ../../whatsnew/3.9.rst:1432 msgid "``PyTrash_UNWIND_LEVEL``" msgstr "``PyTrash_UNWIND_LEVEL``" -#: ../../whatsnew/3.9.rst:1434 +#: ../../whatsnew/3.9.rst:1433 msgid "``Py_TRASHCAN_BEGIN_CONDITION``" msgstr "``Py_TRASHCAN_BEGIN_CONDITION``" -#: ../../whatsnew/3.9.rst:1435 +#: ../../whatsnew/3.9.rst:1434 msgid "``Py_TRASHCAN_BEGIN``" msgstr "``Py_TRASHCAN_BEGIN``" -#: ../../whatsnew/3.9.rst:1436 +#: ../../whatsnew/3.9.rst:1435 msgid "``Py_TRASHCAN_END``" msgstr "``Py_TRASHCAN_END``" -#: ../../whatsnew/3.9.rst:1437 +#: ../../whatsnew/3.9.rst:1436 msgid "``Py_TRASHCAN_SAFE_BEGIN``" msgstr "``Py_TRASHCAN_SAFE_BEGIN``" -#: ../../whatsnew/3.9.rst:1438 +#: ../../whatsnew/3.9.rst:1437 msgid "``Py_TRASHCAN_SAFE_END``" msgstr "``Py_TRASHCAN_SAFE_END``" -#: ../../whatsnew/3.9.rst:1440 +#: ../../whatsnew/3.9.rst:1439 msgid "Moved following functions and definitions to the internal C API:" msgstr "" -#: ../../whatsnew/3.9.rst:1442 +#: ../../whatsnew/3.9.rst:1441 msgid "``_PyDebug_PrintTotalRefs()``" msgstr "``_PyDebug_PrintTotalRefs()``" -#: ../../whatsnew/3.9.rst:1443 +#: ../../whatsnew/3.9.rst:1442 msgid "``_Py_PrintReferences()``" msgstr "``_Py_PrintReferences()``" -#: ../../whatsnew/3.9.rst:1444 +#: ../../whatsnew/3.9.rst:1443 msgid "``_Py_PrintReferenceAddresses()``" msgstr "``_Py_PrintReferenceAddresses()``" -#: ../../whatsnew/3.9.rst:1445 +#: ../../whatsnew/3.9.rst:1444 msgid "``_Py_tracemalloc_config``" msgstr "``_Py_tracemalloc_config``" -#: ../../whatsnew/3.9.rst:1446 +#: ../../whatsnew/3.9.rst:1445 msgid "``_Py_AddToAllObjects()`` (specific to ``Py_TRACE_REFS`` build)" msgstr "" -#: ../../whatsnew/3.9.rst:1450 +#: ../../whatsnew/3.9.rst:1449 msgid "" "Removed ``_PyRuntime.getframe`` hook and removed ``_PyThreadState_GetFrame`` " "macro which was an alias to ``_PyRuntime.getframe``. They were only exposed " @@ -2128,72 +2125,72 @@ msgid "" "(Contributed by Victor Stinner in :issue:`39946`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1455 +#: ../../whatsnew/3.9.rst:1454 msgid "" "Removed the following functions from the C API. Call :c:func:`PyGC_Collect` " "explicitly to clear all free lists. (Contributed by Inada Naoki and Victor " "Stinner in :issue:`37340`, :issue:`38896` and :issue:`40428`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1460 +#: ../../whatsnew/3.9.rst:1459 msgid "``PyAsyncGen_ClearFreeLists()``" msgstr "``PyAsyncGen_ClearFreeLists()``" -#: ../../whatsnew/3.9.rst:1461 +#: ../../whatsnew/3.9.rst:1460 msgid "``PyContext_ClearFreeList()``" msgstr "``PyContext_ClearFreeList()``" -#: ../../whatsnew/3.9.rst:1462 +#: ../../whatsnew/3.9.rst:1461 msgid "``PyDict_ClearFreeList()``" msgstr "``PyDict_ClearFreeList()``" -#: ../../whatsnew/3.9.rst:1463 +#: ../../whatsnew/3.9.rst:1462 msgid "``PyFloat_ClearFreeList()``" msgstr "``PyFloat_ClearFreeList()``" -#: ../../whatsnew/3.9.rst:1464 +#: ../../whatsnew/3.9.rst:1463 msgid "``PyFrame_ClearFreeList()``" msgstr "``PyFrame_ClearFreeList()``" -#: ../../whatsnew/3.9.rst:1465 +#: ../../whatsnew/3.9.rst:1464 msgid "``PyList_ClearFreeList()``" msgstr "``PyList_ClearFreeList()``" -#: ../../whatsnew/3.9.rst:1466 +#: ../../whatsnew/3.9.rst:1465 msgid "" "``PyMethod_ClearFreeList()`` and ``PyCFunction_ClearFreeList()``: the free " "lists of bound method objects have been removed." msgstr "" -#: ../../whatsnew/3.9.rst:1468 +#: ../../whatsnew/3.9.rst:1467 msgid "" "``PySet_ClearFreeList()``: the set free list has been removed in Python 3.4." msgstr "" -#: ../../whatsnew/3.9.rst:1470 +#: ../../whatsnew/3.9.rst:1469 msgid "``PyTuple_ClearFreeList()``" msgstr "``PyTuple_ClearFreeList()``" -#: ../../whatsnew/3.9.rst:1471 +#: ../../whatsnew/3.9.rst:1470 msgid "" "``PyUnicode_ClearFreeList()``: the Unicode free list has been removed in " "Python 3.3." msgstr "" -#: ../../whatsnew/3.9.rst:1474 +#: ../../whatsnew/3.9.rst:1473 msgid "" "Removed ``_PyUnicode_ClearStaticStrings()`` function. (Contributed by Victor " "Stinner in :issue:`39465`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1477 +#: ../../whatsnew/3.9.rst:1476 msgid "" "Removed ``Py_UNICODE_MATCH``. It has been deprecated by :pep:`393`, and " "broken since Python 3.3. The :c:func:`PyUnicode_Tailmatch` function can be " "used instead. (Contributed by Inada Naoki in :issue:`36346`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1482 +#: ../../whatsnew/3.9.rst:1481 msgid "" "Cleaned header files of interfaces defined but with no implementation. The " "public API symbols being removed are: " @@ -2206,26 +2203,26 @@ msgid "" "`39372`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1493 +#: ../../whatsnew/3.9.rst:1492 msgid "Notable changes in Python 3.9.1" msgstr "" -#: ../../whatsnew/3.9.rst:1498 +#: ../../whatsnew/3.9.rst:1497 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." msgstr "" -#: ../../whatsnew/3.9.rst:1501 +#: ../../whatsnew/3.9.rst:1500 msgid "``Literal`` now de-duplicates parameters." msgstr "" -#: ../../whatsnew/3.9.rst:1502 +#: ../../whatsnew/3.9.rst:1501 msgid "" "Equality comparisons between ``Literal`` objects are now order independent." msgstr "" -#: ../../whatsnew/3.9.rst:1503 +#: ../../whatsnew/3.9.rst:1502 msgid "" "``Literal`` comparisons now respect types. For example, ``Literal[0] == " "Literal[False]`` previously evaluated to ``True``. It is now ``False``. To " @@ -2233,7 +2230,7 @@ msgid "" "differentiating types." msgstr "" -#: ../../whatsnew/3.9.rst:1507 +#: ../../whatsnew/3.9.rst:1506 msgid "" "``Literal`` objects will now raise a :exc:`TypeError` exception during " "equality comparisons if any of their parameters are not :term:`hashable`. " @@ -2241,15 +2238,15 @@ msgid "" "error::" msgstr "" -#: ../../whatsnew/3.9.rst:1519 +#: ../../whatsnew/3.9.rst:1518 msgid "(Contributed by Yurii Karabas in :issue:`42345`.)" msgstr "(由 Yurii Karabas 在 :issue:`42345` 中貢獻。)" -#: ../../whatsnew/3.9.rst:1522 +#: ../../whatsnew/3.9.rst:1521 msgid "macOS 11.0 (Big Sur) and Apple Silicon Mac support" msgstr "" -#: ../../whatsnew/3.9.rst:1524 +#: ../../whatsnew/3.9.rst:1523 msgid "" "As of 3.9.1, Python now fully supports building and running on macOS 11.0 " "(Big Sur) and on Apple Silicon Macs (based on the ``ARM64`` architecture). A " @@ -2261,19 +2258,19 @@ msgid "" "version in use at runtime (\"weaklinking\")." msgstr "" -#: ../../whatsnew/3.9.rst:1533 +#: ../../whatsnew/3.9.rst:1532 msgid "(Contributed by Ronald Oussoren and Lawrence D'Anna in :issue:`41100`.)" msgstr "(由 Ronald Oussoren 和 Lawrence D'Anna 在 :issue:`41100` 中貢獻。)" -#: ../../whatsnew/3.9.rst:1536 +#: ../../whatsnew/3.9.rst:1535 msgid "Notable changes in Python 3.9.2" msgstr "" -#: ../../whatsnew/3.9.rst:1539 +#: ../../whatsnew/3.9.rst:1538 msgid "collections.abc" msgstr "collections.abc" -#: ../../whatsnew/3.9.rst:1541 +#: ../../whatsnew/3.9.rst:1540 msgid "" ":class:`collections.abc.Callable` generic now flattens type parameters, " "similar to what :data:`typing.Callable` currently does. This means that " @@ -2289,11 +2286,11 @@ msgid "" "Python 3.10. (Contributed by Ken Jin in :issue:`42195`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1555 +#: ../../whatsnew/3.9.rst:1554 msgid "urllib.parse" msgstr "urllib.parse" -#: ../../whatsnew/3.9.rst:1557 +#: ../../whatsnew/3.9.rst:1556 msgid "" "Earlier Python versions allowed using both ``;`` and ``&`` as query " "parameter separators in :func:`urllib.parse.parse_qs` and :func:`urllib." @@ -2304,15 +2301,3 @@ msgid "" "For more details, please see their respective documentation. (Contributed by " "Adam Goldschmidt, Senthil Kumaran and Ken Jin in :issue:`42967`.)" msgstr "" - -#~ msgid "Release" -#~ msgstr "發行版本" - -#~ msgid "|release|" -#~ msgstr "|release|" - -#~ msgid "Date" -#~ msgstr "日期" - -#~ msgid "|today|" -#~ msgstr "|today|"