diff --git a/faq/extending.po b/faq/extending.po index 0b69f6a4d4..56fb2ca08e 100644 --- a/faq/extending.po +++ b/faq/extending.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-08-05 00:19+0000\n" +"POT-Creation-Date: 2022-09-28 00:27+0000\n" "PO-Revision-Date: 2018-05-23 14:35+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -77,7 +77,7 @@ msgid "" "If you need to interface to some C or C++ library for which no Python " "extension currently exists, you can try wrapping the library's data types " "and functions with a tool such as `SWIG `_. `SIP " -"`__, `CXX `__, `CXX `_ `Boost `_, or `Weave `_ are also alternatives " "for wrapping C++ libraries." diff --git a/faq/general.po b/faq/general.po index f7b0a64383..e5e2ed15bb 100644 --- a/faq/general.po +++ b/faq/general.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-10-26 16:47+0000\n" +"POT-Creation-Date: 2022-09-28 00:27+0000\n" "PO-Revision-Date: 2022-09-01 12:06+0800\n" "Last-Translator: Steven Hsu \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -365,10 +365,11 @@ msgstr "" #: ../../faq/general.rst:184 msgid "" "The documentation is written in reStructuredText and processed by `the " -"Sphinx documentation tool `__. The reStructuredText " -"source for the documentation is part of the Python source distribution." +"Sphinx documentation tool `__. The " +"reStructuredText source for the documentation is part of the Python source " +"distribution." msgstr "" -"說明文件是以 reStructuredText 格式編寫,並由 `Sphinx 說明文件工具 `__\\ 處理。說明文件的 reStructuredText 原始碼是 Python 原始" "碼發行版的一部分。" @@ -539,11 +540,11 @@ msgstr "www.python.org 的真實位置在哪裡?" #: ../../faq/general.rst:272 msgid "" "The Python project's infrastructure is located all over the world and is " -"managed by the Python Infrastructure Team. Details `here `__." msgstr "" "Python 專案的基礎建設遍佈世界各地,由 Python 基礎建設團隊管理。詳細資訊\\ `在" -"此 `__。" +"此 `__。" #: ../../faq/general.rst:277 msgid "Why is it called Python?" @@ -659,15 +660,16 @@ msgstr "" ">`_\\ 可以看見來自許多不同公司和組織的貢獻。" #: ../../faq/general.rst:337 +#, fuzzy msgid "" "High-profile Python projects include `the Mailman mailing list manager " -"`_ and `the Zope application server `_ and `the Zope application server `_. Several Linux distributions, most notably `Red Hat `_, have written part or all of their installer and system " "administration software in Python. Companies that use Python internally " "include Google, Yahoo, and Lucasfilm Ltd." msgstr "" -"備受矚目的 Python 專案包括 `Mailman 郵件討論群管理員 `_" +"備受矚目的 Python 專案包括 `Mailman 郵件討論群管理員 `_" "\\ 和 `Zope 應用程式伺服器 `_。有一些 Linux 發行版,最" "著名的是 `Red Hat `_,已經用 Python 編寫了部分或全部" "的安裝程式及系統管理軟體。內部使用 Python 的公司包括 Google、Yahoo 和 " diff --git a/faq/gui.po b/faq/gui.po index 9d9b19f47c..a11ee23e42 100644 --- a/faq/gui.po +++ b/faq/gui.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-24 00:11+0000\n" +"POT-Creation-Date: 2022-09-28 00:27+0000\n" "PO-Revision-Date: 2022-07-02 17:41+0800\n" "Last-Translator: Steven Hsu \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -89,19 +89,19 @@ msgid "" "point to them at run-time using the :envvar:`TCL_LIBRARY` and :envvar:" "`TK_LIBRARY` environment variables." msgstr "" -"將應用程式與 Tcl 和 Tk 函式庫一併發送是一種解決方法,並在運行時使用 :" -"envvar:`TCL_LIBRARY` 和 :envvar:`TK_LIBRARY` 環境變數來指向該函式庫。" +"將應用程式與 Tcl 和 Tk 函式庫一併發送是一種解決方法,並在運行時使用 :envvar:" +"`TCL_LIBRARY` 和 :envvar:`TK_LIBRARY` 環境變數來指向該函式庫。" #: ../../faq/gui.rst:49 msgid "" "To get truly stand-alone applications, the Tcl scripts that form the library " "have to be integrated into the application as well. One tool supporting that " -"is SAM (stand-alone modules), which is part of the Tix distribution (http://" +"is SAM (stand-alone modules), which is part of the Tix distribution (https://" "tix.sourceforge.net/)." msgstr "" "要得到真正獨立的應用程式,必須將構成函式庫的 Tcl 腳本也整合到應用程式中。一個" "可支援該方法的工具是 SAM(stand-alone modules,獨立模組),它是 Tix 發行版的" -"一部分 (http://tix.sourceforge.net/)。" +"一部分 (https://tix.sourceforge.net/)。" #: ../../faq/gui.rst:54 msgid "" @@ -151,6 +151,6 @@ msgid "" "focus command. Usually a widget is given the keyboard focus by clicking in " "it (but not for labels; see the takefocus option)." msgstr "" -"最常見的原因是,繫結到的小工具並沒有「鍵盤焦點 (keyboard focus)」。請查看 Tk 說明文件中" -"關於焦點命令的敘述。通常,點擊一個小工具,會讓它得到鍵盤焦點(但不適用於標" -"籤;請參閱 takefocus 選項)。" +"最常見的原因是,繫結到的小工具並沒有「鍵盤焦點 (keyboard focus)」。請查看 Tk " +"說明文件中關於焦點命令的敘述。通常,點擊一個小工具,會讓它得到鍵盤焦點(但不" +"適用於標籤;請參閱 takefocus 選項)。" diff --git a/faq/library.po b/faq/library.po index 37ae4d8a24..5657834901 100644 --- a/faq/library.po +++ b/faq/library.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-06-22 00:18+0000\n" +"POT-Creation-Date: 2022-09-28 00:27+0000\n" "PO-Revision-Date: 2018-05-23 14:35+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -261,8 +261,8 @@ msgstr "" msgid "" "The :mod:`pydoc` module can create HTML from the doc strings in your Python " "source code. An alternative for creating API documentation purely from " -"docstrings is `epydoc `_. `Sphinx `_ can also include docstring content." +"docstrings is `epydoc `_. `Sphinx `_ can also include docstring content." msgstr "" #: ../../faq/library.rst:188 diff --git a/faq/programming.po b/faq/programming.po index a9619f17d1..745185a7b2 100644 --- a/faq/programming.po +++ b/faq/programming.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-08-05 00:19+0000\n" +"POT-Creation-Date: 2022-09-28 00:27+0000\n" "PO-Revision-Date: 2018-05-23 14:35+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -76,7 +76,7 @@ msgstr "" #: ../../faq/programming.rst:38 msgid "" -"`Eric `_ is an IDE built on PyQt and " +"`Eric `_ is an IDE built on PyQt and " "the Scintilla editing component." msgstr "" @@ -193,8 +193,8 @@ msgid "`py2app `_ (macOS only)" msgstr "`py2app `_\\ (僅限 macOS)" #: ../../faq/programming.rst:102 -msgid "`py2exe `_ (Windows only)" -msgstr "`py2exe `_\\ (僅限 Windows)" +msgid "`py2exe `_ (Windows only)" +msgstr "`py2exe `_\\ (僅限 Windows)" #: ../../faq/programming.rst:105 msgid "Are there coding standards or a style guide for Python programs?" @@ -1435,8 +1435,8 @@ msgstr "" #: ../../faq/programming.rst:1272 msgid "" -"Or, you can use an extension that provides a matrix datatype; `NumPy `_ is the best known." +"Or, you can use an extension that provides a matrix datatype; `NumPy " +"`_ is the best known." msgstr "" #: ../../faq/programming.rst:1277 diff --git a/glossary.po b/glossary.po index 0e88fa8dbb..e04963072a 100644 --- a/glossary.po +++ b/glossary.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-08-12 00:15+0000\n" +"POT-Creation-Date: 2022-09-30 00:28+0000\n" "PO-Revision-Date: 2022-09-01 12:05+0800\n" "Last-Translator: Steven Hsu \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -317,19 +317,29 @@ msgid "attribute" msgstr "attribute(屬性)" #: ../../glossary.rst:139 +#, fuzzy msgid "" -"A value associated with an object which is referenced by name using dotted " -"expressions. For example, if an object *o* has an attribute *a* it would be " -"referenced as *o.a*." +"A value associated with an object which is usually referenced by name using " +"dotted expressions. For example, if an object *o* has an attribute *a* it " +"would be referenced as *o.a*." msgstr "" "一個與某物件相關聯的值,該值能透過使用點分隔運算式 (dotted expression) 的名稱" "被參照。例如,如果物件 *o* 有一個屬性 *a*,則該屬性能以 *o.a* 被參照。" -#: ../../glossary.rst:142 +#: ../../glossary.rst:144 +msgid "" +"It is possible to give an object an attribute whose name is not an " +"identifier as defined by :ref:`identifiers`, for example using :func:" +"`setattr`, if the object allows it. Such an attribute will not be accessible " +"using a dotted expression, and would instead need to be retrieved with :func:" +"`getattr`." +msgstr "" + +#: ../../glossary.rst:149 msgid "awaitable" msgstr "awaitable(可等待物件)" -#: ../../glossary.rst:144 +#: ../../glossary.rst:151 msgid "" "An object that can be used in an :keyword:`await` expression. Can be a :" "term:`coroutine` or an object with an :meth:`__await__` method. See also :" @@ -339,11 +349,11 @@ msgstr "" "`coroutine`\\ (協程),或是一個有 :meth:`__await__` method 的物件。另請參" "閱 :pep:`492`。" -#: ../../glossary.rst:147 +#: ../../glossary.rst:154 msgid "BDFL" msgstr "BDFL" -#: ../../glossary.rst:149 +#: ../../glossary.rst:156 msgid "" "Benevolent Dictator For Life, a.k.a. `Guido van Rossum `_, Python's creator." @@ -351,11 +361,11 @@ msgstr "" "Benevolent Dictator For Life(終身仁慈獨裁者),又名 `Guido van Rossum " "`_\\ ,Python 的創造者。" -#: ../../glossary.rst:151 +#: ../../glossary.rst:158 msgid "binary file" msgstr "binary file(二進制檔案)" -#: ../../glossary.rst:153 +#: ../../glossary.rst:160 msgid "" "A :term:`file object` able to read and write :term:`bytes-like objects " "`. Examples of binary files are files opened in binary " @@ -369,7 +379,7 @@ msgstr "" "buffer`、\\ :data:`sys.stdout.buffer`,以及 :class:`io.BytesIO` 和 :class:" "`gzip.GzipFile` 實例。" -#: ../../glossary.rst:160 +#: ../../glossary.rst:167 msgid "" "See also :term:`text file` for a file object able to read and write :class:" "`str` objects." @@ -377,11 +387,11 @@ msgstr "" "另請參閱 :term:`text file`\\ (文字檔案),它是一個能夠讀取和寫入 :class:" "`str` 物件的檔案物件。" -#: ../../glossary.rst:162 +#: ../../glossary.rst:169 msgid "borrowed reference" msgstr "borrowed reference(借用參照)" -#: ../../glossary.rst:164 +#: ../../glossary.rst:171 msgid "" "In Python's C API, a borrowed reference is a reference to an object. It does " "not modify the object reference count. It becomes a dangling pointer if the " @@ -393,7 +403,7 @@ msgstr "" "pointer)。例如,一次垃圾回收 (garbage collection) 可以移除對物件的最後一個 :" "term:`strong reference`\\ (強參照),而將該物件銷毀。" -#: ../../glossary.rst:169 +#: ../../glossary.rst:176 msgid "" "Calling :c:func:`Py_INCREF` on the :term:`borrowed reference` is recommended " "to convert it to a :term:`strong reference` in-place, except when the object " @@ -406,11 +416,11 @@ msgstr "" "借用參照之前被銷毀。\\ :c:func:`Py_NewRef` 函式可用於建立一個新的 :term:" "`strong reference`。" -#: ../../glossary.rst:174 +#: ../../glossary.rst:181 msgid "bytes-like object" msgstr "bytes-like object(類位元組串物件)" -#: ../../glossary.rst:176 +#: ../../glossary.rst:183 msgid "" "An object that supports the :ref:`bufferobjects` and can export a C-:term:" "`contiguous` buffer. This includes all :class:`bytes`, :class:`bytearray`, " @@ -425,7 +435,7 @@ msgstr "" "理二進制資料的各種運算;這些運算包括壓縮、儲存至二進制檔案和透過 socket(插" "座)發送。" -#: ../../glossary.rst:183 +#: ../../glossary.rst:190 msgid "" "Some operations need the binary data to be mutable. The documentation often " "refers to these as \"read-write bytes-like objects\". Example mutable " @@ -440,11 +450,11 @@ msgstr "" "的類位元組串物件」)中;這些物件包括 :class:`bytes`,以及 :class:`bytes` 物件" "的 :class:`memoryview`。" -#: ../../glossary.rst:191 +#: ../../glossary.rst:198 msgid "bytecode" msgstr "bytecode(位元組碼)" -#: ../../glossary.rst:193 +#: ../../glossary.rst:200 msgid "" "Python source code is compiled into bytecode, the internal representation of " "a Python program in the CPython interpreter. The bytecode is also cached in " @@ -463,29 +473,29 @@ msgstr "" "上是無法在不同的 Python 虛擬機器之間運作的,也不能在不同版本的 Python 之間保" "持穩定。" -#: ../../glossary.rst:203 +#: ../../glossary.rst:210 msgid "" "A list of bytecode instructions can be found in the documentation for :ref:" "`the dis module `." msgstr "" "位元組碼的指令列表可以在 :ref:`dis 模組 `\\ 的說明文件中找到。" -#: ../../glossary.rst:205 +#: ../../glossary.rst:212 msgid "callback" msgstr "callback(回呼)" -#: ../../glossary.rst:207 +#: ../../glossary.rst:214 msgid "" "A subroutine function which is passed as an argument to be executed at some " "point in the future." msgstr "" "作為引數被傳遞的一個副程式 (subroutine) 函式,會在未來的某個時間點被執行。" -#: ../../glossary.rst:209 +#: ../../glossary.rst:216 msgid "class" msgstr "class(類別)" -#: ../../glossary.rst:211 +#: ../../glossary.rst:218 msgid "" "A template for creating user-defined objects. Class definitions normally " "contain method definitions which operate on instances of the class." @@ -493,11 +503,11 @@ msgstr "" "一個用於建立使用者定義物件的模板。Class 的定義通常會包含 method 的定義,這些 " "method 可以在 class 的實例上進行操作。" -#: ../../glossary.rst:214 +#: ../../glossary.rst:221 msgid "class variable" msgstr "class variable(類別變數)" -#: ../../glossary.rst:216 +#: ../../glossary.rst:223 msgid "" "A variable defined in a class and intended to be modified only at class " "level (i.e., not in an instance of the class)." @@ -505,11 +515,11 @@ msgstr "" "一個在 class 中被定義,且應該只能在 class 層次(意即不是在 class 的實例中)被" "修改的變數。" -#: ../../glossary.rst:218 +#: ../../glossary.rst:225 msgid "coercion" msgstr "coercion(強制轉型)" -#: ../../glossary.rst:220 +#: ../../glossary.rst:227 msgid "" "The implicit conversion of an instance of one type to another during an " "operation which involves two arguments of the same type. For example, " @@ -527,11 +537,11 @@ msgstr "" "\\ 。如果沒有強制轉型,即使所有的引數型別皆相容,它們都必須要由程式設計師正規" "化 (normalize) 為相同的值,例如,要用 ``float(3)+4.5`` 而不能只是 ``3+4.5``。" -#: ../../glossary.rst:228 +#: ../../glossary.rst:235 msgid "complex number" msgstr "complex number(複數)" -#: ../../glossary.rst:230 +#: ../../glossary.rst:237 msgid "" "An extension of the familiar real number system in which all numbers are " "expressed as a sum of a real part and an imaginary part. Imaginary numbers " @@ -551,11 +561,11 @@ msgstr "" "相當進階的數學功能。如果你沒有察覺到對它們的需求,那麼幾乎能確定你可以安全地" "忽略它們。" -#: ../../glossary.rst:240 +#: ../../glossary.rst:247 msgid "context manager" msgstr "context manager(情境管理器)" -#: ../../glossary.rst:242 +#: ../../glossary.rst:249 msgid "" "An object which controls the environment seen in a :keyword:`with` statement " "by defining :meth:`__enter__` and :meth:`__exit__` methods. See :pep:`343`." @@ -563,11 +573,11 @@ msgstr "" "一個可以控制 :keyword:`with` 陳述式中所見環境的物件,而它是透過定義 :meth:" "`__enter__` 和 :meth:`__exit__` method 來控制的。請參閱 :pep:`343`\\ 。" -#: ../../glossary.rst:245 +#: ../../glossary.rst:252 msgid "context variable" msgstr "context variable(情境變數)" -#: ../../glossary.rst:247 +#: ../../glossary.rst:254 msgid "" "A variable which can have different values depending on its context. This is " "similar to Thread-Local Storage in which each execution thread may have a " @@ -582,11 +592,11 @@ msgstr "" "任務 (concurrent asynchronous task) 中,對於變數狀態的追蹤。請參閱 :mod:" "`contextvars`\\ 。" -#: ../../glossary.rst:254 +#: ../../glossary.rst:261 msgid "contiguous" msgstr "contiguous(連續的)" -#: ../../glossary.rst:258 +#: ../../glossary.rst:265 msgid "" "A buffer is considered contiguous exactly if it is either *C-contiguous* or " "*Fortran contiguous*. Zero-dimensional buffers are C and Fortran " @@ -603,11 +613,11 @@ msgstr "" "的順序訪問各個項目時,最後一個索引的變化最快。然而,在 Fortran contiguous 陣" "列中,第一個索引的變化最快。" -#: ../../glossary.rst:266 +#: ../../glossary.rst:273 msgid "coroutine" msgstr "coroutine(協程)" -#: ../../glossary.rst:268 +#: ../../glossary.rst:275 msgid "" "Coroutines are a more generalized form of subroutines. Subroutines are " "entered at one point and exited at another point. Coroutines can be " @@ -618,11 +628,11 @@ msgstr "" "在另一個時間點被退出。協程可以在許多不同的時間點被進入、退出和回復。它們能夠" "以 :keyword:`async def` 陳述式被實作。另請參閱 :pep:`492`\\ 。" -#: ../../glossary.rst:273 +#: ../../glossary.rst:280 msgid "coroutine function" msgstr "coroutine function(協程函式)" -#: ../../glossary.rst:275 +#: ../../glossary.rst:282 msgid "" "A function which returns a :term:`coroutine` object. A coroutine function " "may be defined with the :keyword:`async def` statement, and may contain :" @@ -633,11 +643,11 @@ msgstr "" "`async def` 陳述式被定義,並可能會包含 :keyword:`await`\\ 、\\ :keyword:" "`async for` 和 :keyword:`async with` 關鍵字。這些關鍵字由 :pep:`492` 引入。" -#: ../../glossary.rst:280 +#: ../../glossary.rst:287 msgid "CPython" msgstr "CPython" -#: ../../glossary.rst:282 +#: ../../glossary.rst:289 msgid "" "The canonical implementation of the Python programming language, as " "distributed on `python.org `_. The term \"CPython\" " @@ -648,11 +658,11 @@ msgstr "" "`_ 上。「CPython」這個術語在必要時被使用,以區分此實" "作與其它語言的實作,例如 Jython 或 IronPython。" -#: ../../glossary.rst:286 +#: ../../glossary.rst:293 msgid "decorator" msgstr "decorator(裝飾器)" -#: ../../glossary.rst:288 +#: ../../glossary.rst:295 msgid "" "A function returning another function, usually applied as a function " "transformation using the ``@wrapper`` syntax. Common examples for " @@ -662,7 +672,7 @@ msgstr "" "式的變換 (function transformation)。裝飾器的常見範例是 :func:`classmethod` " "和 :func:`staticmethod`\\ 。" -#: ../../glossary.rst:292 +#: ../../glossary.rst:299 msgid "" "The decorator syntax is merely syntactic sugar, the following two function " "definitions are semantically equivalent::" @@ -671,7 +681,7 @@ msgstr "" "\n" "::" -#: ../../glossary.rst:303 +#: ../../glossary.rst:310 msgid "" "The same concept exists for classes, but is less commonly used there. See " "the documentation for :ref:`function definitions ` and :ref:`class " @@ -680,11 +690,11 @@ msgstr "" "Class 也存在相同的概念,但在那裡比較不常用。關於裝飾器的更多內容,請參閱\\ :" "ref:`函式定義 `\\ 和 :ref:`class 定義 `\\ 的說明文件。" -#: ../../glossary.rst:306 +#: ../../glossary.rst:313 msgid "descriptor" msgstr "descriptor(描述器)" -#: ../../glossary.rst:308 +#: ../../glossary.rst:315 msgid "" "Any object which defines the methods :meth:`__get__`, :meth:`__set__`, or :" "meth:`__delete__`. When a class attribute is a descriptor, its special " @@ -704,7 +714,7 @@ msgstr "" "這些功能包括函式、method、屬性 (property)、class method、靜態 method,以及對 " "super class(父類別)的參照。" -#: ../../glossary.rst:318 +#: ../../glossary.rst:325 msgid "" "For more information about descriptors' methods, see :ref:`descriptors` or " "the :ref:`Descriptor How To Guide `." @@ -712,11 +722,11 @@ msgstr "" "關於描述器 method 的更多資訊,請參閱\\ :ref:`descriptors`\\ 或\\ :ref:`描述器" "使用指南 `\\ 。" -#: ../../glossary.rst:320 +#: ../../glossary.rst:327 msgid "dictionary" msgstr "dictionary(字典)" -#: ../../glossary.rst:322 +#: ../../glossary.rst:329 msgid "" "An associative array, where arbitrary keys are mapped to values. The keys " "can be any object with :meth:`__hash__` and :meth:`__eq__` methods. Called a " @@ -726,11 +736,11 @@ msgstr "" "有 :meth:`__hash__` 和 :meth:`__eq__` method 的物件。在 Perl 中被稱為雜湊 " "(hash)。" -#: ../../glossary.rst:325 +#: ../../glossary.rst:332 msgid "dictionary comprehension" msgstr "dictionary comprehension(字典綜合運算)" -#: ../../glossary.rst:327 +#: ../../glossary.rst:334 msgid "" "A compact way to process all or part of the elements in an iterable and " "return a dictionary with the results. ``results = {n: n ** 2 for n in " @@ -741,11 +751,11 @@ msgstr "" "字典回傳。``results = {n: n ** 2 for n in range(10)}`` 會產生一個字典,它包含" "了鍵 ``n`` 映射到值 ``n ** 2``。請參閱\\ :ref:`comprehensions`\\ 。" -#: ../../glossary.rst:331 +#: ../../glossary.rst:338 msgid "dictionary view" msgstr "dictionary view(字典檢視)" -#: ../../glossary.rst:333 +#: ../../glossary.rst:340 msgid "" "The objects returned from :meth:`dict.keys`, :meth:`dict.values`, and :meth:" "`dict.items` are called dictionary views. They provide a dynamic view on the " @@ -758,11 +768,11 @@ msgstr "" "檢視會反映這些變動。若要強制將字典檢視轉為完整的 list(串列),須使用 " "``list(dictview)``。請參閱\\ :ref:`dict-views`\\ 。" -#: ../../glossary.rst:339 +#: ../../glossary.rst:346 msgid "docstring" msgstr "docstring(說明字串)" -#: ../../glossary.rst:341 +#: ../../glossary.rst:348 msgid "" "A string literal which appears as the first expression in a class, function " "or module. While ignored when the suite is executed, it is recognized by " @@ -775,11 +785,11 @@ msgstr "" "`__doc__` 屬性中。由於說明字串可以透過內省 (introspection) 來瀏覽,因此它是物" "件的說明文件存放的標準位置。" -#: ../../glossary.rst:347 +#: ../../glossary.rst:354 msgid "duck-typing" msgstr "duck-typing(鴨子型別)" -#: ../../glossary.rst:349 +#: ../../glossary.rst:356 msgid "" "A programming style which does not look at an object's type to determine if " "it has the right interface; instead, the method or attribute is simply " @@ -800,11 +810,11 @@ msgstr "" "來補充。)然而,它通常會採用 :func:`hasattr` 測試,或是 :term:`EAFP` 程式設計" "風格。" -#: ../../glossary.rst:358 +#: ../../glossary.rst:365 msgid "EAFP" msgstr "EAFP" -#: ../../glossary.rst:360 +#: ../../glossary.rst:367 msgid "" "Easier to ask for forgiveness than permission. This common Python coding " "style assumes the existence of valid keys or attributes and catches " @@ -819,11 +829,11 @@ msgstr "" "keyword:`except` 陳述式。該技術與許多其他語言(例如 C)常見的 :term:`LBYL` 風" "格形成了對比。" -#: ../../glossary.rst:366 +#: ../../glossary.rst:373 msgid "expression" msgstr "expression(運算式)" -#: ../../glossary.rst:368 +#: ../../glossary.rst:375 msgid "" "A piece of syntax which can be evaluated to some value. In other words, an " "expression is an accumulation of expression elements like literals, names, " @@ -839,11 +849,11 @@ msgstr "" "(陳述式)不能被用作運算式,例如 :keyword:`while`\\ 。賦值 (assignment) 也是" "陳述式,而不是運算式。" -#: ../../glossary.rst:375 +#: ../../glossary.rst:382 msgid "extension module" msgstr "extension module(擴充模組)" -#: ../../glossary.rst:377 +#: ../../glossary.rst:384 msgid "" "A module written in C or C++, using Python's C API to interact with the core " "and with user code." @@ -851,11 +861,11 @@ msgstr "" "一個以 C 或 C++ 編寫的模組,它使用 Python 的 C API 來與核心及使用者程式碼進行" "互動。" -#: ../../glossary.rst:379 +#: ../../glossary.rst:386 msgid "f-string" msgstr "f-string(f 字串)" -#: ../../glossary.rst:381 +#: ../../glossary.rst:388 msgid "" "String literals prefixed with ``'f'`` or ``'F'`` are commonly called \"f-" "strings\" which is short for :ref:`formatted string literals `. " @@ -864,11 +874,11 @@ msgstr "" "以 ``'f'`` 或 ``'F'`` 為前綴的字串文本通常被稱為「f 字串」,它是\\ :ref:`格式" "化的字串文本 `\\ 的縮寫。另請參閱 :pep:`498`\\ 。" -#: ../../glossary.rst:384 +#: ../../glossary.rst:391 msgid "file object" msgstr "file object(檔案物件)" -#: ../../glossary.rst:386 +#: ../../glossary.rst:393 msgid "" "An object exposing a file-oriented API (with methods such as :meth:`read()` " "or :meth:`write()`) to an underlying resource. Depending on the way it was " @@ -883,7 +893,7 @@ msgstr "" "緩衝區、socket(插座)、管線 (pipe) 等)的存取。檔案物件也被稱為\\ :dfn:`類檔" "案物件 (file-like object)` 或\\ :dfn:`串流 (stream)`\\ 。" -#: ../../glossary.rst:394 +#: ../../glossary.rst:401 msgid "" "There are actually three categories of file objects: raw :term:`binary files " "`, buffered :term:`binary files ` and :term:`text " @@ -896,19 +906,19 @@ msgstr "" "它們的介面在 :mod:`io` 模組中被定義。建立檔案物件的標準方法是使用 :func:" "`open` 函式。" -#: ../../glossary.rst:399 +#: ../../glossary.rst:406 msgid "file-like object" msgstr "file-like object(類檔案物件)" -#: ../../glossary.rst:401 +#: ../../glossary.rst:408 msgid "A synonym for :term:`file object`." msgstr ":term:`file object`\\ (檔案物件)的同義字。" -#: ../../glossary.rst:402 +#: ../../glossary.rst:409 msgid "filesystem encoding and error handler" msgstr "filesystem encoding and error handler(檔案系統編碼和錯誤處理函式)" -#: ../../glossary.rst:404 +#: ../../glossary.rst:411 msgid "" "Encoding and error handler used by Python to decode bytes from the operating " "system and encode Unicode to the operating system." @@ -916,7 +926,7 @@ msgstr "" "Python 所使用的一種編碼和錯誤處理函式,用來解碼來自作業系統的位元組,以及將 " "Unicode 編碼到作業系統。" -#: ../../glossary.rst:407 +#: ../../glossary.rst:414 msgid "" "The filesystem encoding must guarantee to successfully decode all bytes " "below 128. If the file system encoding fails to provide this guarantee, API " @@ -925,7 +935,7 @@ msgstr "" "檔案系統編碼必須保證能成功解碼所有小於 128 的位元組。如果檔案系統編碼無法提供" "此保證,則 API 函式會引發 :exc:`UnicodeError`\\ 。" -#: ../../glossary.rst:411 +#: ../../glossary.rst:418 msgid "" "The :func:`sys.getfilesystemencoding` and :func:`sys." "getfilesystemencodeerrors` functions can be used to get the filesystem " @@ -934,7 +944,7 @@ msgstr "" ":func:`sys.getfilesystemencoding` 和 :func:`sys.getfilesystemencodeerrors` 函" "式可用於取得檔案系統編碼和錯誤處理函式。" -#: ../../glossary.rst:415 +#: ../../glossary.rst:422 msgid "" "The :term:`filesystem encoding and error handler` are configured at Python " "startup by the :c:func:`PyConfig_Read` function: see :c:member:`~PyConfig." @@ -946,22 +956,22 @@ msgstr "" "member:`~PyConfig.filesystem_encoding`\\ ,以及 :c:type:`PyConfig` 的成員 :c:" "member:`~PyConfig.filesystem_errors`\\ 。" -#: ../../glossary.rst:420 +#: ../../glossary.rst:427 msgid "See also the :term:`locale encoding`." msgstr "另請參閱 :term:`locale encoding`\\ (區域編碼)。" -#: ../../glossary.rst:421 +#: ../../glossary.rst:428 msgid "finder" msgstr "finder(尋檢器)" -#: ../../glossary.rst:423 +#: ../../glossary.rst:430 msgid "" "An object that tries to find the :term:`loader` for a module that is being " "imported." msgstr "" "一個物件,它會嘗試為正在被 import 的模組尋找 :term:`loader`\\ (載入器)。" -#: ../../glossary.rst:426 +#: ../../glossary.rst:433 msgid "" "Since Python 3.3, there are two types of finder: :term:`meta path finders " "` for use with :data:`sys.meta_path`, and :term:`path " @@ -972,15 +982,15 @@ msgstr "" "項目尋檢器 (path entry finder) ` 會使用 :data:`sys." "path_hooks`\\ 。" -#: ../../glossary.rst:430 +#: ../../glossary.rst:437 msgid "See :pep:`302`, :pep:`420` and :pep:`451` for much more detail." msgstr "請參閱 :pep:`302`\\ 、\\ :pep:`420` 和 :pep:`451` 以了解更多細節。" -#: ../../glossary.rst:431 +#: ../../glossary.rst:438 msgid "floor division" msgstr "floor division(向下取整除法)" -#: ../../glossary.rst:433 +#: ../../glossary.rst:440 msgid "" "Mathematical division that rounds down to nearest integer. The floor " "division operator is ``//``. For example, the expression ``11 // 4`` " @@ -993,11 +1003,11 @@ msgstr "" "``2.75`` 不同。請注意,``(-11) // 4`` 的結果是 ``-3``,因為是 ``-2.75`` 被\\ " "*向下*\\ 無條件捨去。請參閱 :pep:`238`\\ 。" -#: ../../glossary.rst:438 +#: ../../glossary.rst:445 msgid "function" msgstr "function(函式)" -#: ../../glossary.rst:440 +#: ../../glossary.rst:447 msgid "" "A series of statements which returns some value to a caller. It can also be " "passed zero or more :term:`arguments ` which may be used in the " @@ -1009,15 +1019,15 @@ msgstr "" "`parameter`\\ (參數)、\\ :term:`method`\\ (方法),以及\\ :ref:`function`" "\\ 章節。" -#: ../../glossary.rst:444 +#: ../../glossary.rst:451 msgid "function annotation" msgstr "function annotation(函式註釋)" -#: ../../glossary.rst:446 +#: ../../glossary.rst:453 msgid "An :term:`annotation` of a function parameter or return value." msgstr "函式參數或回傳值的一個 :term:`annotation`\\ (註釋)。" -#: ../../glossary.rst:448 +#: ../../glossary.rst:455 msgid "" "Function annotations are usually used for :term:`type hints `: " "for example, this function is expected to take two :class:`int` arguments " @@ -1028,11 +1038,11 @@ msgstr "" "\n" "::" -#: ../../glossary.rst:456 +#: ../../glossary.rst:463 msgid "Function annotation syntax is explained in section :ref:`function`." msgstr "函式註釋的語法在\\ :ref:`function`\\ 章節有詳細解釋。" -#: ../../glossary.rst:458 +#: ../../glossary.rst:465 msgid "" "See :term:`variable annotation` and :pep:`484`, which describe this " "functionality. Also see :ref:`annotations-howto` for best practices on " @@ -1041,11 +1051,11 @@ msgstr "" "請參閱 :term:`variable annotation` 和 :pep:`484`\\ ,皆有此功能的描述。關於註" "釋的最佳實踐方法,另請參閱 :ref:`annotations-howto`\\ 。" -#: ../../glossary.rst:462 +#: ../../glossary.rst:469 msgid "__future__" msgstr "__future__" -#: ../../glossary.rst:464 +#: ../../glossary.rst:471 msgid "" "A :ref:`future statement `, ``from __future__ import ``, " "directs the compiler to compile the current module using syntax or semantics " @@ -1063,11 +1073,11 @@ msgstr "" "\n" "::" -#: ../../glossary.rst:475 +#: ../../glossary.rst:482 msgid "garbage collection" msgstr "garbage collection(垃圾回收)" -#: ../../glossary.rst:477 +#: ../../glossary.rst:484 msgid "" "The process of freeing memory when it is not used anymore. Python performs " "garbage collection via reference counting and a cyclic garbage collector " @@ -1079,11 +1089,11 @@ msgstr "" "垃圾回收器 (cyclic garbage collector) 來完成。垃圾回收器可以使用 :mod:`gc` 模" "組對其進行控制。" -#: ../../glossary.rst:483 +#: ../../glossary.rst:490 msgid "generator" msgstr "generator(產生器)" -#: ../../glossary.rst:485 +#: ../../glossary.rst:492 msgid "" "A function which returns a :term:`generator iterator`. It looks like a " "normal function except that it contains :keyword:`yield` expressions for " @@ -1094,7 +1104,7 @@ msgstr "" "個正常的函式,但不同的是它包含了 :keyword:`yield` 運算式,能產生一系列的值," "這些值可用於 for 迴圈,或是以 :func:`next` 函式,每次檢索其中的一個值。" -#: ../../glossary.rst:490 +#: ../../glossary.rst:497 msgid "" "Usually refers to a generator function, but may refer to a *generator " "iterator* in some contexts. In cases where the intended meaning isn't " @@ -1103,15 +1113,15 @@ msgstr "" "這個術語通常用來表示一個產生器函式,但在某些情境中,也可能是表示\\ *產生器疊" "代器*\\ 。萬一想表達的意思不夠清楚,那就使用完整的術語,以避免歧義。" -#: ../../glossary.rst:493 +#: ../../glossary.rst:500 msgid "generator iterator" msgstr "generator iterator(產生器疊代器)" -#: ../../glossary.rst:495 +#: ../../glossary.rst:502 msgid "An object created by a :term:`generator` function." msgstr "一個由 :term:`generator`\\ (產生器)函式所建立的物件。" -#: ../../glossary.rst:497 +#: ../../glossary.rst:504 msgid "" "Each :keyword:`yield` temporarily suspends processing, remembering the " "location execution state (including local variables and pending try-" @@ -1122,11 +1132,11 @@ msgstr "" "中的 try 陳述式)。當\\ *產生器疊代器*\\ 回復時,它會從停止的地方繼續執行(與" "那些每次調用時都要重新開始的函式有所不同)。" -#: ../../glossary.rst:504 +#: ../../glossary.rst:511 msgid "generator expression" msgstr "generator expression(產生器運算式)" -#: ../../glossary.rst:506 +#: ../../glossary.rst:513 msgid "" "An expression that returns an iterator. It looks like a normal expression " "followed by a :keyword:`!for` clause defining a loop variable, range, and an " @@ -1139,11 +1149,11 @@ msgstr "" "\n" "::" -#: ../../glossary.rst:513 +#: ../../glossary.rst:520 msgid "generic function" msgstr "generic function(泛型函式)" -#: ../../glossary.rst:515 +#: ../../glossary.rst:522 msgid "" "A function composed of multiple functions implementing the same operation " "for different types. Which implementation should be used during a call is " @@ -1152,7 +1162,7 @@ msgstr "" "一個由多個函式組成的函式,該函式會對不同的型別實作相同的運算。呼叫期間應該使" "用哪種實作,是由調度演算法 (dispatch algorithm) 來決定。" -#: ../../glossary.rst:519 +#: ../../glossary.rst:526 msgid "" "See also the :term:`single dispatch` glossary entry, the :func:`functools." "singledispatch` decorator, and :pep:`443`." @@ -1160,11 +1170,11 @@ msgstr "" "另請參閱 :term:`single dispatch`\\ (單一調度)術語表條目、\\ :func:" "`functools.singledispatch` 裝飾器和 :pep:`443`\\ 。" -#: ../../glossary.rst:521 +#: ../../glossary.rst:528 msgid "generic type" msgstr "generic type(泛型型別)" -#: ../../glossary.rst:523 +#: ../../glossary.rst:530 msgid "" "A :term:`type` that can be parameterized; typically a :ref:`container " "class` such as :class:`list` or :class:`dict`. Used for :" @@ -1174,7 +1184,7 @@ msgstr "" "`容器型別 `\\ ,像是 :class:`list` 和 :class:`dict`。它被用於" "\\ :term:`型別提示 `\\ 和\\ :term:`註釋 `\\ 。" -#: ../../glossary.rst:528 +#: ../../glossary.rst:535 msgid "" "For more details, see :ref:`generic alias types`, :pep:" "`483`, :pep:`484`, :pep:`585`, and the :mod:`typing` module." @@ -1182,19 +1192,19 @@ msgstr "" "詳情請參閱\\ :ref:`泛型別名型別 `\\ 、\\ :pep:`483`" "\\ 、\\ :pep:`484`\\ 、\\ :pep:`585` 和 :mod:`typing` 模組。" -#: ../../glossary.rst:530 +#: ../../glossary.rst:537 msgid "GIL" msgstr "GIL" -#: ../../glossary.rst:532 +#: ../../glossary.rst:539 msgid "See :term:`global interpreter lock`." msgstr "請參閱 :term:`global interpreter lock`\\ (全域直譯器鎖)。" -#: ../../glossary.rst:533 +#: ../../glossary.rst:540 msgid "global interpreter lock" msgstr "global interpreter lock(全域直譯器鎖)" -#: ../../glossary.rst:535 +#: ../../glossary.rst:542 msgid "" "The mechanism used by the :term:`CPython` interpreter to assure that only " "one thread executes Python :term:`bytecode` at a time. This simplifies the " @@ -1211,7 +1221,7 @@ msgstr "" "(multi-threaded),但代價是會犧牲掉多處理器的機器能夠提供的一大部分平行性 " "(parallelism)。" -#: ../../glossary.rst:544 +#: ../../glossary.rst:551 msgid "" "However, some extension modules, either standard or third-party, are " "designed so as to release the GIL when doing computationally intensive tasks " @@ -1222,7 +1232,7 @@ msgstr "" "計算密集 (computationally intensive) 的任務時,可以解除 GIL。另外,在執行 I/" "O 時,GIL 總是會被解除。" -#: ../../glossary.rst:549 +#: ../../glossary.rst:556 msgid "" "Past efforts to create a \"free-threaded\" interpreter (one which locks " "shared data at a much finer granularity) have not been successful because " @@ -1234,11 +1244,11 @@ msgstr "" "力並未成功,因為在一般的單一處理器情況下,效能會有所損失。一般認為,若要克服" "這個效能問題,會使實作變得複雜許多,進而付出更高的維護成本。" -#: ../../glossary.rst:555 +#: ../../glossary.rst:562 msgid "hash-based pyc" msgstr "hash-based pyc(雜湊架構的 pyc)" -#: ../../glossary.rst:557 +#: ../../glossary.rst:564 msgid "" "A bytecode cache file that uses the hash rather than the last-modified time " "of the corresponding source file to determine its validity. See :ref:`pyc-" @@ -1247,11 +1257,11 @@ msgstr "" "一個位元組碼 (bytecode) 暫存檔,它使用雜湊值而不是對應原始檔案的最後修改時" "間,來確定其有效性。請參閱\\ :ref:`pyc-invalidation`\\ 。" -#: ../../glossary.rst:560 +#: ../../glossary.rst:567 msgid "hashable" msgstr "hashable(可雜湊的)" -#: ../../glossary.rst:562 +#: ../../glossary.rst:569 msgid "" "An object is *hashable* if it has a hash value which never changes during " "its lifetime (it needs a :meth:`__hash__` method), and can be compared to " @@ -1263,7 +1273,7 @@ msgstr "" "method),那麼它就是一個\\ *可雜湊*\\ 物件。比較結果為相等的多個可雜湊物件," "它們必須擁有相同的雜湊值。" -#: ../../glossary.rst:567 +#: ../../glossary.rst:574 msgid "" "Hashability makes an object usable as a dictionary key and a set member, " "because these data structures use the hash value internally." @@ -1271,7 +1281,7 @@ msgstr "" "可雜湊性 (hashability) 使一個物件可用作 dictionary(字典)的鍵和 set(集合)" "的成員,因為這些資料結構都在其內部使用了雜湊值。" -#: ../../glossary.rst:570 +#: ../../glossary.rst:577 msgid "" "Most of Python's immutable built-in objects are hashable; mutable containers " "(such as lists or dictionaries) are not; immutable containers (such as " @@ -1286,11 +1296,11 @@ msgstr "" "則這些物件會被預設為可雜湊的。它們在互相比較時都是不相等的(除非它們與自己比" "較),而它們的雜湊值則是衍生自它們的 :func:`id`\\ 。" -#: ../../glossary.rst:577 +#: ../../glossary.rst:584 msgid "IDLE" msgstr "IDLE" -#: ../../glossary.rst:579 +#: ../../glossary.rst:586 msgid "" "An Integrated Development and Learning Environment for Python. :ref:`idle` " "is a basic editor and interpreter environment which ships with the standard " @@ -1300,11 +1310,11 @@ msgstr "" "境)。:ref:`idle` 是一個基本的編輯器和直譯器環境,它和 Python 的標準發行版本" "一起被提供。" -#: ../../glossary.rst:582 +#: ../../glossary.rst:589 msgid "immutable" msgstr "immutable(不可變物件)" -#: ../../glossary.rst:584 +#: ../../glossary.rst:591 msgid "" "An object with a fixed value. Immutable objects include numbers, strings " "and tuples. Such an object cannot be altered. A new object has to be " @@ -1316,11 +1326,11 @@ msgstr "" "能被改變的。如果一個不同的值必須被儲存,則必須建立一個新的物件。它們在需要恆" "定雜湊值的地方,扮演重要的角色,例如 dictionary(字典)中的一個鍵。" -#: ../../glossary.rst:589 +#: ../../glossary.rst:596 msgid "import path" msgstr "import path(匯入路徑)" -#: ../../glossary.rst:591 +#: ../../glossary.rst:598 msgid "" "A list of locations (or :term:`path entries `) that are searched " "by the :term:`path based finder` for modules to import. During import, this " @@ -1332,11 +1342,11 @@ msgstr "" "的位置。在 import 期間,此位置列表通常是來自 :data:`sys.path`\\ ,但對於子套" "件 (subpackage) 而言,它也可能是來自父套件的 ``__path__`` 屬性。" -#: ../../glossary.rst:596 +#: ../../glossary.rst:603 msgid "importing" msgstr "importing(匯入)" -#: ../../glossary.rst:598 +#: ../../glossary.rst:605 msgid "" "The process by which Python code in one module is made available to Python " "code in another module." @@ -1344,11 +1354,11 @@ msgstr "" "一個過程。一個模組中的 Python 程式碼可以透過此過程,被另一個模組中的 Python " "程式碼使用。" -#: ../../glossary.rst:600 +#: ../../glossary.rst:607 msgid "importer" msgstr "importer(匯入器)" -#: ../../glossary.rst:602 +#: ../../glossary.rst:609 msgid "" "An object that both finds and loads a module; both a :term:`finder` and :" "term:`loader` object." @@ -1356,11 +1366,11 @@ msgstr "" "一個能夠尋找及載入模組的物件;它既是 :term:`finder`\\ (尋檢器)也是 :term:" "`loader`\\ (載入器)物件。" -#: ../../glossary.rst:604 +#: ../../glossary.rst:611 msgid "interactive" msgstr "interactive(互動的)" -#: ../../glossary.rst:606 +#: ../../glossary.rst:613 msgid "" "Python has an interactive interpreter which means you can enter statements " "and expressions at the interpreter prompt, immediately execute them and see " @@ -1373,11 +1383,11 @@ msgstr "" "從你的電腦的主選單選擇它)。這是測試新想法或檢查模塊和包的非常強大的方法(請" "記住help(x))。" -#: ../../glossary.rst:612 +#: ../../glossary.rst:619 msgid "interpreted" msgstr "interpreted(直譯的)" -#: ../../glossary.rst:614 +#: ../../glossary.rst:621 msgid "" "Python is an interpreted language, as opposed to a compiled one, though the " "distinction can be blurry because of the presence of the bytecode compiler. " @@ -1391,11 +1401,11 @@ msgstr "" "一個執行檔,然後再執行它。直譯語言通常比編譯語言有更短的開發/除錯週期,不過" "它們的程式通常也運行得較慢。另請參閱 :term:`interactive`\\ (互動的)。" -#: ../../glossary.rst:621 +#: ../../glossary.rst:628 msgid "interpreter shutdown" msgstr "interpreter shutdown(直譯器關閉)" -#: ../../glossary.rst:623 +#: ../../glossary.rst:630 msgid "" "When asked to shut down, the Python interpreter enters a special phase where " "it gradually releases all allocated resources, such as modules and various " @@ -1413,18 +1423,18 @@ msgstr "" "段被執行的程式碼會遇到各種例外,因為它所依賴的資源可能不再有作用了(常見的例" "子是函式庫模組或是警告機制)。" -#: ../../glossary.rst:632 +#: ../../glossary.rst:639 msgid "" "The main reason for interpreter shutdown is that the ``__main__`` module or " "the script being run has finished executing." msgstr "" "直譯器關閉的主要原因,是 ``__main__`` 模組或正被運行的腳本已經執行完成。" -#: ../../glossary.rst:634 +#: ../../glossary.rst:641 msgid "iterable" msgstr "iterable(可疊代物件)" -#: ../../glossary.rst:636 +#: ../../glossary.rst:643 msgid "" "An object capable of returning its members one at a time. Examples of " "iterables include all sequence types (such as :class:`list`, :class:`str`, " @@ -1440,7 +1450,7 @@ msgstr "" "`Sequence `\\ (序列)語意的 :meth:`__getitem__` method,該物件就是" "可疊代物件。" -#: ../../glossary.rst:643 +#: ../../glossary.rst:650 msgid "" "Iterables can be used in a :keyword:`for` loop and in many other places " "where a sequence is needed (:func:`zip`, :func:`map`, ...). When an " @@ -1460,11 +1470,11 @@ msgstr "" "於在迴圈期間保有該疊代器。另請參閱 :term:`iterator`\\ (疊代器)、\\ :term:" "`sequence`\\ (序列)和 :term:`generator`\\ (產生器)。" -#: ../../glossary.rst:653 +#: ../../glossary.rst:660 msgid "iterator" msgstr "iterator(疊代器)" -#: ../../glossary.rst:655 +#: ../../glossary.rst:662 msgid "" "An object representing a stream of data. Repeated calls to the iterator's :" "meth:`~iterator.__next__` method (or passing it to the built-in function :" @@ -1493,11 +1503,11 @@ msgstr "" "事(多遍疊代)時,只會回傳在前一遍疊代中被用過的、同一個已被用盡的疊代器物" "件,使其看起來就像一個空的容器。" -#: ../../glossary.rst:670 +#: ../../glossary.rst:677 msgid "More information can be found in :ref:`typeiter`." msgstr "在\\ :ref:`typeiter`\\ 文中可以找到更多資訊。" -#: ../../glossary.rst:674 +#: ../../glossary.rst:681 msgid "" "CPython does not consistently apply the requirement that an iterator define :" "meth:`__iter__`." @@ -1505,11 +1515,11 @@ msgstr "" "CPython 並不是始終如一地都會檢查「疊代器有定義 :meth:`__iter__`\\ 」這個規" "定。" -#: ../../glossary.rst:676 +#: ../../glossary.rst:683 msgid "key function" msgstr "key function(鍵函式)" -#: ../../glossary.rst:678 +#: ../../glossary.rst:685 msgid "" "A key function or collation function is a callable that returns a value used " "for sorting or ordering. For example, :func:`locale.strxfrm` is used to " @@ -1519,7 +1529,7 @@ msgstr "" "一個用於排序 (sorting) 或定序 (ordering) 的值。例如,\\ :func:`locale." "strxfrm` 被用來產生一個了解區域特定排序慣例的排序鍵。" -#: ../../glossary.rst:683 +#: ../../glossary.rst:690 msgid "" "A number of tools in Python accept key functions to control how elements are " "ordered or grouped. They include :func:`min`, :func:`max`, :func:`sorted`, :" @@ -1531,7 +1541,7 @@ msgstr "" "\\ 、\\ :func:`heapq.merge`\\ 、\\ :func:`heapq.nsmallest`\\ 、\\ :func:" "`heapq.nlargest` 和 :func:`itertools.groupby`\\ 。" -#: ../../glossary.rst:689 +#: ../../glossary.rst:696 msgid "" "There are several ways to create a key function. For example. the :meth:" "`str.lower` method can serve as a key function for case insensitive sorts. " @@ -1549,19 +1559,19 @@ msgstr "" "`~operator.itemgetter` 和 :func:`~operator.methodcaller`\\ 。關於如何建立和使" "用鍵函式的範例,請參閱\\ :ref:`如何排序 `\\ 。" -#: ../../glossary.rst:697 +#: ../../glossary.rst:704 msgid "keyword argument" msgstr "keyword argument(關鍵字引數)" -#: ../../glossary.rst:699 ../../glossary.rst:988 +#: ../../glossary.rst:706 ../../glossary.rst:995 msgid "See :term:`argument`." msgstr "請參閱 :term:`argument`\\ (引數)。" -#: ../../glossary.rst:700 +#: ../../glossary.rst:707 msgid "lambda" msgstr "lambda" -#: ../../glossary.rst:702 +#: ../../glossary.rst:709 msgid "" "An anonymous inline function consisting of a single :term:`expression` which " "is evaluated when the function is called. The syntax to create a lambda " @@ -1571,11 +1581,11 @@ msgstr "" "function),於該函式被呼叫時求值。建立 lambda 函式的語法是 ``lambda " "[parameters]: expression``" -#: ../../glossary.rst:705 +#: ../../glossary.rst:712 msgid "LBYL" msgstr "LBYL" -#: ../../glossary.rst:707 +#: ../../glossary.rst:714 msgid "" "Look before you leap. This coding style explicitly tests for pre-conditions " "before making calls or lookups. This style contrasts with the :term:`EAFP` " @@ -1586,7 +1596,7 @@ msgstr "" "地測試先決條件。這種風格與 :term:`EAFP` 方式形成對比,且它的特色是會有許多 :" "keyword:`if` 陳述式的存在。" -#: ../../glossary.rst:712 +#: ../../glossary.rst:719 msgid "" "In a multi-threaded environment, the LBYL approach can risk introducing a " "race condition between \"the looking\" and \"the leaping\". For example, " @@ -1600,11 +1610,11 @@ msgstr "" "了 *key*,則該程式碼就會失效。這個問題可以用鎖 (lock) 或使用 EAFP 編碼方式來" "解決。" -#: ../../glossary.rst:717 +#: ../../glossary.rst:724 msgid "locale encoding" msgstr "locale encoding(區域編碼)" -#: ../../glossary.rst:719 +#: ../../glossary.rst:726 msgid "" "On Unix, it is the encoding of the LC_CTYPE locale. It can be set with " "``locale.setlocale(locale.LC_CTYPE, new_locale)``." @@ -1612,17 +1622,17 @@ msgstr "" "在 Unix 上,它是 LC_CTYPE 區域設定的編碼。它可以用 ``locale.setlocale(locale." "LC_CTYPE, new_locale)`` 來設定。" -#: ../../glossary.rst:722 +#: ../../glossary.rst:729 msgid "On Windows, it is the ANSI code page (ex: ``cp1252``)." msgstr "在 Windows 上,它是 ANSI 代碼頁(code page,例如 ``cp1252``\\ )。" -#: ../../glossary.rst:724 +#: ../../glossary.rst:731 msgid "" "``locale.getpreferredencoding(False)`` can be used to get the locale " "encoding." msgstr "``locale.getpreferredencoding(False)`` 可以用來取得區域編碼。" -#: ../../glossary.rst:727 +#: ../../glossary.rst:734 msgid "" "Python uses the :term:`filesystem encoding and error handler` to convert " "between Unicode filenames and bytes filenames." @@ -1630,11 +1640,11 @@ msgstr "" "Python 使用 :term:`filesystem encoding and error handler`\\ (檔案系統編碼和" "錯誤處理函式)在 Unicode 檔案名稱和位元組檔案名稱之間進行轉換。" -#: ../../glossary.rst:729 +#: ../../glossary.rst:736 msgid "list" msgstr "list(串列)" -#: ../../glossary.rst:731 +#: ../../glossary.rst:738 msgid "" "A built-in Python :term:`sequence`. Despite its name it is more akin to an " "array in other languages than to a linked list since access to elements is " @@ -1644,11 +1654,11 @@ msgstr "" "似其他語言中的一個陣列 (array) 而較不像一個鏈結串列 (linked list),因為存取元" "素的時間複雜度是 O(1)。" -#: ../../glossary.rst:734 +#: ../../glossary.rst:741 msgid "list comprehension" msgstr "list comprehension(串列綜合運算)" -#: ../../glossary.rst:736 +#: ../../glossary.rst:743 msgid "" "A compact way to process all or part of the elements in a sequence and " "return a list with the results. ``result = ['{:#04x}'.format(x) for x in " @@ -1662,11 +1672,11 @@ msgstr "" "keyword:`if` 子句是選擇性的。如果省略它,則 ``range(256)`` 中的所有元素都會被" "處理。" -#: ../../glossary.rst:742 +#: ../../glossary.rst:749 msgid "loader" msgstr "loader(載入器)" -#: ../../glossary.rst:744 +#: ../../glossary.rst:751 msgid "" "An object that loads a module. It must define a method named :meth:" "`load_module`. A loader is typically returned by a :term:`finder`. See :pep:" @@ -1678,19 +1688,19 @@ msgstr "" "`302`,關於 :term:`abstract base class`\\ (抽象基底類別),請參閱 :class:" "`importlib.abc.Loader`\\ 。" -#: ../../glossary.rst:748 +#: ../../glossary.rst:755 msgid "magic method" msgstr "magic method(魔術方法)" -#: ../../glossary.rst:752 +#: ../../glossary.rst:759 msgid "An informal synonym for :term:`special method`." msgstr ":term:`special method`\\ (特殊方法)的一個非正式同義詞。" -#: ../../glossary.rst:753 +#: ../../glossary.rst:760 msgid "mapping" msgstr "mapping(對映)" -#: ../../glossary.rst:755 +#: ../../glossary.rst:762 msgid "" "A container object that supports arbitrary key lookups and implements the " "methods specified in the :class:`~collections.abc.Mapping` or :class:" @@ -1705,11 +1715,11 @@ msgstr "" "的 method。範例包括 :class:`dict`\\ 、\\ :class:`collections.defaultdict`" "\\ 、\\ :class:`collections.OrderedDict` 和 :class:`collections.Counter`\\ 。" -#: ../../glossary.rst:761 +#: ../../glossary.rst:768 msgid "meta path finder" msgstr "meta path finder(元路徑尋檢器)" -#: ../../glossary.rst:763 +#: ../../glossary.rst:770 msgid "" "A :term:`finder` returned by a search of :data:`sys.meta_path`. Meta path " "finders are related to, but different from :term:`path entry finders ` " "相關但是不同。" -#: ../../glossary.rst:767 +#: ../../glossary.rst:774 msgid "" "See :class:`importlib.abc.MetaPathFinder` for the methods that meta path " "finders implement." @@ -1727,11 +1737,11 @@ msgstr "" "關於元路徑尋檢器實作的 method,請參閱 :class:`importlib.abc.MetaPathFinder`" "\\ 。" -#: ../../glossary.rst:769 +#: ../../glossary.rst:776 msgid "metaclass" msgstr "metaclass(元類別)" -#: ../../glossary.rst:771 +#: ../../glossary.rst:778 msgid "" "The class of a class. Class definitions create a class name, a class " "dictionary, and a list of base classes. The metaclass is responsible for " @@ -1751,15 +1761,15 @@ msgstr "" "性存取、增加執行緒安全性、追蹤物件建立、實作單例模式 (singleton),以及許多其" "他的任務。" -#: ../../glossary.rst:781 +#: ../../glossary.rst:788 msgid "More information can be found in :ref:`metaclasses`." msgstr "更多資訊可以在\\ :ref:`metaclasses`\\ 章節中找到。" -#: ../../glossary.rst:782 +#: ../../glossary.rst:789 msgid "method" msgstr "method(方法)" -#: ../../glossary.rst:784 +#: ../../glossary.rst:791 msgid "" "A function which is defined inside a class body. If called as an attribute " "of an instance of that class, the method will get the instance object as its " @@ -1771,11 +1781,11 @@ msgstr "" "通常被稱為 ``self``)。請參閱 :term:`function`\\ (函式)和 :term:`nested " "scope`\\ (巢狀作用域)。" -#: ../../glossary.rst:788 +#: ../../glossary.rst:795 msgid "method resolution order" msgstr "method resolution order(方法解析順序)" -#: ../../glossary.rst:790 +#: ../../glossary.rst:797 msgid "" "Method Resolution Order is the order in which base classes are searched for " "a member during lookup. See `The Python 2.3 Method Resolution Order `_\\ 。" -#: ../../glossary.rst:794 +#: ../../glossary.rst:801 msgid "module" msgstr "module(模組)" -#: ../../glossary.rst:796 +#: ../../glossary.rst:803 msgid "" "An object that serves as an organizational unit of Python code. Modules " "have a namespace containing arbitrary Python objects. Modules are loaded " @@ -1800,15 +1810,15 @@ msgstr "" "空間,它包含任意的 Python 物件。模組是藉由 :term:`importing` 的過程,被載入" "至 Python。" -#: ../../glossary.rst:800 +#: ../../glossary.rst:807 msgid "See also :term:`package`." msgstr "另請參閱 :term:`package`\\ (套件)。" -#: ../../glossary.rst:801 +#: ../../glossary.rst:808 msgid "module spec" msgstr "module spec(模組規格)" -#: ../../glossary.rst:803 +#: ../../glossary.rst:810 msgid "" "A namespace containing the import-related information used to load a module. " "An instance of :class:`importlib.machinery.ModuleSpec`." @@ -1816,19 +1826,19 @@ msgstr "" "一個命名空間,它包含用於載入模組的 import 相關資訊。它是 :class:`importlib." "machinery.ModuleSpec` 的一個實例。" -#: ../../glossary.rst:805 +#: ../../glossary.rst:812 msgid "MRO" msgstr "MRO" -#: ../../glossary.rst:807 +#: ../../glossary.rst:814 msgid "See :term:`method resolution order`." msgstr "請參閱 :term:`method resolution order`\\ (方法解析順序)。" -#: ../../glossary.rst:808 +#: ../../glossary.rst:815 msgid "mutable" msgstr "mutable(可變物件)" -#: ../../glossary.rst:810 +#: ../../glossary.rst:817 msgid "" "Mutable objects can change their value but keep their :func:`id`. See also :" "term:`immutable`." @@ -1836,11 +1846,11 @@ msgstr "" "可變物件可以改變它們的值,但維持它們的 :func:`id`\\ 。另請參閱 :term:" "`immutable`\\ (不可變物件)。" -#: ../../glossary.rst:812 +#: ../../glossary.rst:819 msgid "named tuple" msgstr "named tuple(附名元組)" -#: ../../glossary.rst:814 +#: ../../glossary.rst:821 msgid "" "The term \"named tuple\" applies to any type or class that inherits from " "tuple and whose indexable elements are also accessible using named " @@ -1850,7 +1860,7 @@ msgstr "" "索引 (indexable) 元素也可以用附名屬性來存取。這些型別或 class 也可以具有其他" "的特性。" -#: ../../glossary.rst:818 +#: ../../glossary.rst:825 msgid "" "Several built-in types are named tuples, including the values returned by :" "func:`time.localtime` and :func:`os.stat`. Another example is :data:`sys." @@ -1861,7 +1871,7 @@ msgstr "" "\n" "::" -#: ../../glossary.rst:829 +#: ../../glossary.rst:836 msgid "" "Some named tuples are built-in types (such as the above examples). " "Alternatively, a named tuple can be created from a regular class definition " @@ -1877,11 +1887,11 @@ msgstr "" "些額外的 method,這些 method 可能是在手寫或內建的 named tuple 中,無法找到" "的。" -#: ../../glossary.rst:836 +#: ../../glossary.rst:843 msgid "namespace" msgstr "namespace(命名空間)" -#: ../../glossary.rst:838 +#: ../../glossary.rst:845 msgid "" "The place where a variable is stored. Namespaces are implemented as " "dictionaries. There are the local, global and built-in namespaces as well " @@ -1901,11 +1911,11 @@ msgstr "" "func:`itertools.islice` 明確地表示,這些函式分別是由 :mod:`random` 和 :mod:" "`itertools` 模組在實作。" -#: ../../glossary.rst:848 +#: ../../glossary.rst:855 msgid "namespace package" msgstr "namespace package(命名空間套件)" -#: ../../glossary.rst:850 +#: ../../glossary.rst:857 msgid "" "A :pep:`420` :term:`package` which serves only as a container for " "subpackages. Namespace packages may have no physical representation, and " @@ -1916,15 +1926,15 @@ msgstr "" "一個容器。命名空間套件可能沒有實體的表示法,而且具體來說它們不像是一個 :term:" "`regular package`\\ (正規套件),因為它們並沒有 ``__init__.py`` 這個檔案。" -#: ../../glossary.rst:855 +#: ../../glossary.rst:862 msgid "See also :term:`module`." msgstr "另請參閱 :term:`module`\\ (模組)。" -#: ../../glossary.rst:856 +#: ../../glossary.rst:863 msgid "nested scope" msgstr "nested scope(巢狀作用域)" -#: ../../glossary.rst:858 +#: ../../glossary.rst:865 msgid "" "The ability to refer to a variable in an enclosing definition. For " "instance, a function defined inside another function can refer to variables " @@ -1939,11 +1949,11 @@ msgstr "" "寫入。同樣地,全域變數是在全域命名空間中讀取及寫入。\\ :keyword:`nonlocal` 容" "許對外層作用域進行寫入。" -#: ../../glossary.rst:865 +#: ../../glossary.rst:872 msgid "new-style class" msgstr "new-style class(新式類別)" -#: ../../glossary.rst:867 +#: ../../glossary.rst:874 msgid "" "Old name for the flavor of classes now used for all class objects. In " "earlier Python versions, only new-style classes could use Python's newer, " @@ -1955,11 +1965,11 @@ msgstr "" "__slots__`\\ 、描述器 (descriptor)、屬性 (property)、\\ :meth:" "`__getattribute__`\\ 、class method(類別方法)和 static method(靜態方法)。" -#: ../../glossary.rst:871 +#: ../../glossary.rst:878 msgid "object" msgstr "object(物件)" -#: ../../glossary.rst:873 +#: ../../glossary.rst:880 msgid "" "Any data with state (attributes or value) and defined behavior (methods). " "Also the ultimate base class of any :term:`new-style class`." @@ -1967,11 +1977,11 @@ msgstr "" "具有狀態(屬性或值)及被定義的行為(method)的任何資料。它也是任何 :term:" "`new-style class`\\ (新式類別)的最終 base class(基底類別)。" -#: ../../glossary.rst:876 +#: ../../glossary.rst:883 msgid "package" msgstr "package(套件)" -#: ../../glossary.rst:878 +#: ../../glossary.rst:885 msgid "" "A Python :term:`module` which can contain submodules or recursively, " "subpackages. Technically, a package is a Python module with an ``__path__`` " @@ -1981,17 +1991,17 @@ msgstr "" "迴的子套件 (subpackage)。技術上而言,套件就是具有 ``__path__`` 屬性的一個 " "Python 模組。" -#: ../../glossary.rst:882 +#: ../../glossary.rst:889 msgid "See also :term:`regular package` and :term:`namespace package`." msgstr "" "另請參閱 :term:`regular package`\\ (正規套件)和 :term:`namespace package`" "\\ (命名空間套件)。" -#: ../../glossary.rst:883 +#: ../../glossary.rst:890 msgid "parameter" msgstr "parameter(參數)" -#: ../../glossary.rst:885 +#: ../../glossary.rst:892 msgid "" "A named entity in a :term:`function` (or method) definition that specifies " "an :term:`argument` (or in some cases, arguments) that the function can " @@ -2001,7 +2011,7 @@ msgstr "" "它指明該函式能夠接受的一個 :term:`argument`\\ (引數),或在某些情況下指示多" "個引數。共有有五種不同的參數類型:" -#: ../../glossary.rst:889 +#: ../../glossary.rst:896 msgid "" ":dfn:`positional-or-keyword`: specifies an argument that can be passed " "either :term:`positionally ` or as a :term:`keyword argument " @@ -2014,7 +2024,7 @@ msgstr "" "\n" "::" -#: ../../glossary.rst:898 +#: ../../glossary.rst:905 msgid "" ":dfn:`positional-only`: specifies an argument that can be supplied only by " "position. Positional-only parameters can be defined by including a ``/`` " @@ -2027,7 +2037,7 @@ msgstr "" "\n" "::" -#: ../../glossary.rst:907 +#: ../../glossary.rst:914 msgid "" ":dfn:`keyword-only`: specifies an argument that can be supplied only by " "keyword. Keyword-only parameters can be defined by including a single var-" @@ -2042,7 +2052,7 @@ msgstr "" "\n" "::" -#: ../../glossary.rst:915 +#: ../../glossary.rst:922 msgid "" ":dfn:`var-positional`: specifies that an arbitrary sequence of positional " "arguments can be provided (in addition to any positional arguments already " @@ -2056,7 +2066,7 @@ msgstr "" "\n" "::" -#: ../../glossary.rst:923 +#: ../../glossary.rst:930 msgid "" ":dfn:`var-keyword`: specifies that arbitrarily many keyword arguments can be " "provided (in addition to any keyword arguments already accepted by other " @@ -2067,14 +2077,14 @@ msgstr "" "已被其他參數接受的任何關鍵字引數之外)。這類參數是透過在其參數名稱字首加上 " "``**`` 來定義的,例如上面範例中的 *kwargs*。" -#: ../../glossary.rst:929 +#: ../../glossary.rst:936 msgid "" "Parameters can specify both optional and required arguments, as well as " "default values for some optional arguments." msgstr "" "參數可以指明引數是選擇性的或必需的,也可以為一些選擇性的引數指定預設值。" -#: ../../glossary.rst:932 +#: ../../glossary.rst:939 msgid "" "See also the :term:`argument` glossary entry, the FAQ question on :ref:`the " "difference between arguments and parameters `, " @@ -2085,11 +2095,11 @@ msgstr "" "參數之間的差異 `\\ 、\\ :class:`inspect." "Parameter` class、\\ :ref:`function`\\ 章節,以及 :pep:`362`\\ 。" -#: ../../glossary.rst:936 +#: ../../glossary.rst:943 msgid "path entry" msgstr "path entry(路徑項目)" -#: ../../glossary.rst:938 +#: ../../glossary.rst:945 msgid "" "A single location on the :term:`import path` which the :term:`path based " "finder` consults to find modules for importing." @@ -2097,11 +2107,11 @@ msgstr "" "在 :term:`import path`\\ (匯入路徑)中的一個位置,而 :term:`path based " "finder` (基於路徑的尋檢器)會參考該位置來尋找要 import 的模組。" -#: ../../glossary.rst:940 +#: ../../glossary.rst:947 msgid "path entry finder" msgstr "path entry finder(路徑項目尋檢器)" -#: ../../glossary.rst:942 +#: ../../glossary.rst:949 msgid "" "A :term:`finder` returned by a callable on :data:`sys.path_hooks` (i.e. a :" "term:`path entry hook`) which knows how to locate modules given a :term:" @@ -2111,7 +2121,7 @@ msgstr "" "`path entry hook`\\ )所回傳的一種 :term:`finder`\\ ,它知道如何以一個 :term:" "`path entry`\\ 定位模組。" -#: ../../glossary.rst:946 +#: ../../glossary.rst:953 msgid "" "See :class:`importlib.abc.PathEntryFinder` for the methods that path entry " "finders implement." @@ -2119,11 +2129,11 @@ msgstr "" "關於路徑項目尋檢器實作的 method,請參閱 :class:`importlib.abc." "PathEntryFinder`\\ 。" -#: ../../glossary.rst:948 +#: ../../glossary.rst:955 msgid "path entry hook" msgstr "path entry hook(路徑項目鉤)" -#: ../../glossary.rst:950 +#: ../../glossary.rst:957 msgid "" "A callable on the :data:`sys.path_hook` list which returns a :term:`path " "entry finder` if it knows how to find modules on a specific :term:`path " @@ -2133,11 +2143,11 @@ msgstr "" "個特定的 :term:`path entry` 中尋找模組,則會回傳一個 :term:`path entry " "finder`\\ (路徑項目尋檢器)。" -#: ../../glossary.rst:953 +#: ../../glossary.rst:960 msgid "path based finder" msgstr "path based finder(基於路徑的尋檢器)" -#: ../../glossary.rst:955 +#: ../../glossary.rst:962 msgid "" "One of the default :term:`meta path finders ` which " "searches an :term:`import path` for modules." @@ -2145,11 +2155,11 @@ msgstr "" "預設的\\ :term:`元路徑尋檢器 (meta path finder) ` 之一,它" "會在一個 :term:`import path` 中搜尋模組。" -#: ../../glossary.rst:957 +#: ../../glossary.rst:964 msgid "path-like object" msgstr "path-like object(類路徑物件)" -#: ../../glossary.rst:959 +#: ../../glossary.rst:966 msgid "" "An object representing a file system path. A path-like object is either a :" "class:`str` or :class:`bytes` object representing a path, or an object " @@ -2167,11 +2177,11 @@ msgstr "" "`os.fsencode` 則分別可用於確保 :class:`str` 及 :class:`bytes` 的結果。由 :" "pep:`519` 引入。" -#: ../../glossary.rst:967 +#: ../../glossary.rst:974 msgid "PEP" msgstr "PEP" -#: ../../glossary.rst:969 +#: ../../glossary.rst:976 msgid "" "Python Enhancement Proposal. A PEP is a design document providing " "information to the Python community, or describing a new feature for Python " @@ -2182,7 +2192,7 @@ msgstr "" "為 Python 社群提供資訊,或是描述 Python 的一個新功能或該功能的程序和環境。" "PEP 應該要提供簡潔的技術規範以及被提案功能的運作原理。" -#: ../../glossary.rst:975 +#: ../../glossary.rst:982 msgid "" "PEPs are intended to be the primary mechanisms for proposing major new " "features, for collecting community input on an issue, and for documenting " @@ -2194,15 +2204,15 @@ msgstr "" "已納入 Python 的設計決策的記錄,這些過程的主要機制。PEP 的作者要負責在社群內" "建立共識並記錄反對意見。" -#: ../../glossary.rst:981 +#: ../../glossary.rst:988 msgid "See :pep:`1`." msgstr "請參閱 :pep:`1`\\ 。" -#: ../../glossary.rst:982 +#: ../../glossary.rst:989 msgid "portion" msgstr "portion(部分)" -#: ../../glossary.rst:984 +#: ../../glossary.rst:991 msgid "" "A set of files in a single directory (possibly stored in a zip file) that " "contribute to a namespace package, as defined in :pep:`420`." @@ -2210,15 +2220,15 @@ msgstr "" "在單一目錄中的一組檔案(也可能儲存在一個 zip 檔中),這些檔案能對一個命名空間" "套件 (namespace package) 有所貢獻,如同 :pep:`420` 中的定義。" -#: ../../glossary.rst:986 +#: ../../glossary.rst:993 msgid "positional argument" msgstr "positional argument(位置引數)" -#: ../../glossary.rst:989 +#: ../../glossary.rst:996 msgid "provisional API" msgstr "provisional API(暫行 API)" -#: ../../glossary.rst:991 +#: ../../glossary.rst:998 msgid "" "A provisional API is one which has been deliberately excluded from the " "standard library's backwards compatibility guarantees. While major changes " @@ -2234,7 +2244,7 @@ msgstr "" "該介面)。這種變更並不會無端地產生——只有 API 被納入之前未察覺的嚴重基本缺陷被" "揭露時,它們才會發生。" -#: ../../glossary.rst:1000 +#: ../../glossary.rst:1007 msgid "" "Even for provisional APIs, backwards incompatible changes are seen as a " "\"solution of last resort\" - every attempt will still be made to find a " @@ -2243,7 +2253,7 @@ msgstr "" "即使對於暫行 API,向後不相容的變更也會被視為「最後的解決方案」——對於任何被發" "現的問題,仍然會盡可能找出一個向後相容的解決方案。" -#: ../../glossary.rst:1004 +#: ../../glossary.rst:1011 msgid "" "This process allows the standard library to continue to evolve over time, " "without locking in problematic design errors for extended periods of time. " @@ -2252,19 +2262,19 @@ msgstr "" "這個過程使得標準函式庫能隨著時間不斷進化,而避免耗費過長的時間去鎖定有問題的" "設計錯誤。請參閱 :pep:`411` 了解更多細節。" -#: ../../glossary.rst:1007 +#: ../../glossary.rst:1014 msgid "provisional package" msgstr "provisional package(暫行套件)" -#: ../../glossary.rst:1009 +#: ../../glossary.rst:1016 msgid "See :term:`provisional API`." msgstr "請參閱 :term:`provisional API`\\ (暫行 API)。" -#: ../../glossary.rst:1010 +#: ../../glossary.rst:1017 msgid "Python 3000" msgstr "Python 3000" -#: ../../glossary.rst:1012 +#: ../../glossary.rst:1019 msgid "" "Nickname for the Python 3.x release line (coined long ago when the release " "of version 3 was something in the distant future.) This is also abbreviated " @@ -2273,11 +2283,11 @@ msgstr "" "Python 3.x 系列版本的暱稱(很久以前創造的,當時第 3 版的發布是在遙遠的未" "來。)也可以縮寫為「Py3k」。" -#: ../../glossary.rst:1015 +#: ../../glossary.rst:1022 msgid "Pythonic" msgstr "Pythonic(Python 風格的)" -#: ../../glossary.rst:1017 +#: ../../glossary.rst:1024 msgid "" "An idea or piece of code which closely follows the most common idioms of the " "Python language, rather than implementing code using concepts common to " @@ -2293,18 +2303,18 @@ msgstr "" "\n" "::" -#: ../../glossary.rst:1027 +#: ../../glossary.rst:1034 msgid "As opposed to the cleaner, Pythonic method::" msgstr "" "相較之下,以下方法更簡潔、更具有 Python 風格:\n" "\n" "::" -#: ../../glossary.rst:1031 +#: ../../glossary.rst:1038 msgid "qualified name" msgstr "qualified name(限定名稱)" -#: ../../glossary.rst:1033 +#: ../../glossary.rst:1040 msgid "" "A dotted name showing the \"path\" from a module's global scope to a class, " "function or method defined in that module, as defined in :pep:`3155`. For " @@ -2317,7 +2327,7 @@ msgstr "" "\n" "::" -#: ../../glossary.rst:1050 +#: ../../glossary.rst:1057 msgid "" "When used to refer to modules, the *fully qualified name* means the entire " "dotted path to the module, including any parent packages, e.g. ``email.mime." @@ -2328,11 +2338,11 @@ msgstr "" "\n" "::" -#: ../../glossary.rst:1057 +#: ../../glossary.rst:1064 msgid "reference count" msgstr "reference count(參照計數)" -#: ../../glossary.rst:1059 +#: ../../glossary.rst:1066 msgid "" "The number of references to an object. When the reference count of an " "object drops to zero, it is deallocated. Reference counting is generally " @@ -2346,11 +2356,11 @@ msgstr "" "`CPython` 實作的一個關鍵元素。\\ :mod:`sys` 模組定義了一個 :func:`~sys." "getrefcount` 函式,程序設計師可以呼叫該函式來回傳一個特定物件的參照計數。" -#: ../../glossary.rst:1065 +#: ../../glossary.rst:1072 msgid "regular package" msgstr "regular package(正規套件)" -#: ../../glossary.rst:1067 +#: ../../glossary.rst:1074 msgid "" "A traditional :term:`package`, such as a directory containing an ``__init__." "py`` file." @@ -2358,15 +2368,15 @@ msgstr "" "一個傳統的 :term:`package`\\ (套件),例如一個包含 ``__init__.py`` 檔案的目" "錄。" -#: ../../glossary.rst:1070 +#: ../../glossary.rst:1077 msgid "See also :term:`namespace package`." msgstr "另請參閱 :term:`namespace package`\\ (命名空間套件)。" -#: ../../glossary.rst:1071 +#: ../../glossary.rst:1078 msgid "__slots__" msgstr "__slots__" -#: ../../glossary.rst:1073 +#: ../../glossary.rst:1080 msgid "" "A declaration inside a class that saves memory by pre-declaring space for " "instance attributes and eliminating instance dictionaries. Though popular, " @@ -2379,11 +2389,11 @@ msgstr "" "最好保留給那種在一個記憶體關鍵 (memory-critical) 的應用程式中存在大量實例的罕" "見情況。" -#: ../../glossary.rst:1078 +#: ../../glossary.rst:1085 msgid "sequence" msgstr "sequence(序列)" -#: ../../glossary.rst:1080 +#: ../../glossary.rst:1087 msgid "" "An :term:`iterable` which supports efficient element access using integer " "indices via the :meth:`__getitem__` special method and defines a :meth:" @@ -2401,7 +2411,7 @@ msgstr "" "對映 (mapping) 而不是序列,因為其查找方式是使用任意的 :term:`immutable` 鍵," "而不是整數。" -#: ../../glossary.rst:1089 +#: ../../glossary.rst:1096 msgid "" "The :class:`collections.abc.Sequence` abstract base class defines a much " "richer interface that goes beyond just :meth:`__getitem__` and :meth:" @@ -2415,11 +2425,11 @@ msgstr "" "`__reversed__`\\ 。實作此擴充介面的型別,可以使用 :func:`~abc.ABCMeta." "register` 被明確地註冊。" -#: ../../glossary.rst:1096 +#: ../../glossary.rst:1103 msgid "set comprehension" msgstr "set comprehension(集合綜合運算)" -#: ../../glossary.rst:1098 +#: ../../glossary.rst:1105 msgid "" "A compact way to process all or part of the elements in an iterable and " "return a set with the results. ``results = {c for c in 'abracadabra' if c " @@ -2430,11 +2440,11 @@ msgstr "" "set 回傳。``results = {c for c in 'abracadabra' if c not in 'abc'}`` 會產生一" "個字串 set:``{'r', 'd'}``。請參閱\\ :ref:`comprehensions`\\ 。" -#: ../../glossary.rst:1102 +#: ../../glossary.rst:1109 msgid "single dispatch" msgstr "single dispatch(單一調度)" -#: ../../glossary.rst:1104 +#: ../../glossary.rst:1111 msgid "" "A form of :term:`generic function` dispatch where the implementation is " "chosen based on the type of a single argument." @@ -2442,11 +2452,11 @@ msgstr "" ":term:`generic function`\\ (泛型函式)調度的一種形式,在此,實作的選擇是基於" "單一引數的型別。" -#: ../../glossary.rst:1106 +#: ../../glossary.rst:1113 msgid "slice" msgstr "slice(切片)" -#: ../../glossary.rst:1108 +#: ../../glossary.rst:1115 msgid "" "An object usually containing a portion of a :term:`sequence`. A slice is " "created using the subscript notation, ``[]`` with colons between numbers " @@ -2458,11 +2468,11 @@ msgstr "" "字之間使用冒號,例如 ``variable_name[1:3:5]``。在括號(下標)符號的內部,會使" "用 :class:`slice` 物件。" -#: ../../glossary.rst:1112 +#: ../../glossary.rst:1119 msgid "special method" msgstr "special method(特殊方法)" -#: ../../glossary.rst:1116 +#: ../../glossary.rst:1123 msgid "" "A method that is called implicitly by Python to execute a certain operation " "on a type, such as addition. Such methods have names starting and ending " @@ -2473,11 +2483,11 @@ msgstr "" "種 method 的名稱會在開頭和結尾有兩個下底線。Special method 在\\ :ref:" "`specialnames`\\ 中有詳細說明。" -#: ../../glossary.rst:1120 +#: ../../glossary.rst:1127 msgid "statement" msgstr "statement(陳述式)" -#: ../../glossary.rst:1122 +#: ../../glossary.rst:1129 msgid "" "A statement is part of a suite (a \"block\" of code). A statement is either " "an :term:`expression` or one of several constructs with a keyword, such as :" @@ -2487,11 +2497,11 @@ msgstr "" "term:`expression`\\ (運算式),或是含有關鍵字(例如 :keyword:`if`\\ 、\\ :" "keyword:`while` 或 :keyword:`for`\\ )的多種結構之一。" -#: ../../glossary.rst:1125 +#: ../../glossary.rst:1132 msgid "strong reference" msgstr "strong reference(強參照)" -#: ../../glossary.rst:1127 +#: ../../glossary.rst:1134 msgid "" "In Python's C API, a strong reference is a reference to an object which " "increments the object's reference count when it is created and decrements " @@ -2500,7 +2510,7 @@ msgstr "" "在 Python 的 C API 中,強參照是一個對物件的參照,在它被建立時會增加該物件的參" "照計數 (reference count),在它被刪除時則會減少該物件的參照計數。" -#: ../../glossary.rst:1131 +#: ../../glossary.rst:1138 msgid "" "The :c:func:`Py_NewRef` function can be used to create a strong reference to " "an object. Usually, the :c:func:`Py_DECREF` function must be called on the " @@ -2510,15 +2520,15 @@ msgstr "" ":c:func:`Py_NewRef` 函式可用於建立一個對物件的強參照。通常,在退出強參照的作" "用域之前,必須在該強參照上呼叫 :c:func:`Py_DECREF` 函式,以避免洩漏一個參照。" -#: ../../glossary.rst:1136 +#: ../../glossary.rst:1143 msgid "See also :term:`borrowed reference`." msgstr "另請參閱 :term:`borrowed reference`\\ (借用參照)。" -#: ../../glossary.rst:1137 +#: ../../glossary.rst:1144 msgid "text encoding" msgstr "text encoding(文字編碼)" -#: ../../glossary.rst:1139 +#: ../../glossary.rst:1146 msgid "" "A string in Python is a sequence of Unicode code points (in range ``U" "+0000``--``U+10FFFF``). To store or transfer a string, it needs to be " @@ -2527,7 +2537,7 @@ msgstr "" "Python 中的字串是一個 Unicode 碼點 (code point) 的序列(範圍在 ``U+0000`` -- " "``U+10FFFF`` 之間)。若要儲存或傳送一個字串,它必須被序列化為一個位元組序列。" -#: ../../glossary.rst:1143 +#: ../../glossary.rst:1150 msgid "" "Serializing a string into a sequence of bytes is known as \"encoding\", and " "recreating the string from the sequence of bytes is known as \"decoding\"." @@ -2535,7 +2545,7 @@ msgstr "" "將一個字串序列化為位元組序列,稱為「編碼」,而從位元組序列重新建立該字串則稱" "為「解碼 (decoding)」。" -#: ../../glossary.rst:1146 +#: ../../glossary.rst:1153 msgid "" "There are a variety of different text serialization :ref:`codecs `, which are collectively referred to as \"text encodings\"." @@ -2543,11 +2553,11 @@ msgstr "" "有多種不同的文字序列化編解碼器 (:ref:`codecs `),它們被統" "稱為「文字編碼」。" -#: ../../glossary.rst:1149 +#: ../../glossary.rst:1156 msgid "text file" msgstr "text file(文字檔案)" -#: ../../glossary.rst:1151 +#: ../../glossary.rst:1158 msgid "" "A :term:`file object` able to read and write :class:`str` objects. Often, a " "text file actually accesses a byte-oriented datastream and handles the :term:" @@ -2561,7 +2571,7 @@ msgstr "" "有:以文字模式(``'r'`` 或 ``'w'``)開啟的檔案、\\ :data:`sys.stdin`\\ 、\\ :" "data:`sys.stdout` 以及 :class:`io.StringIO` 的實例。" -#: ../../glossary.rst:1158 +#: ../../glossary.rst:1165 msgid "" "See also :term:`binary file` for a file object able to read and write :term:" "`bytes-like objects `." @@ -2569,11 +2579,11 @@ msgstr "" "另請參閱 :term:`binary file`\\ (二進制檔案),它是一個能夠讀取和寫入\\ :" "term:`類位元組串物件 (bytes-like object) ` 的檔案物件。" -#: ../../glossary.rst:1160 +#: ../../glossary.rst:1167 msgid "triple-quoted string" msgstr "triple-quoted string(三引號內字串)" -#: ../../glossary.rst:1162 +#: ../../glossary.rst:1169 msgid "" "A string which is bound by three instances of either a quotation mark (\") " "or an apostrophe ('). While they don't provide any functionality not " @@ -2588,11 +2598,11 @@ msgstr "" "中包含未跳脫 (unescaped) 的單引號和雙引號,而且它們不需使用連續字元 " "(continuation character) 就可以跨越多行,這使得它們在編寫說明字串時特別有用。" -#: ../../glossary.rst:1169 +#: ../../glossary.rst:1176 msgid "type" msgstr "type(型別)" -#: ../../glossary.rst:1171 +#: ../../glossary.rst:1178 msgid "" "The type of a Python object determines what kind of object it is; every " "object has a type. An object's type is accessible as its :attr:`~instance." @@ -2602,15 +2612,15 @@ msgstr "" "件的型別可以用它的 :attr:`~instance.__class__` 屬性來存取,或以 " "``type(obj)`` 來檢索。" -#: ../../glossary.rst:1175 +#: ../../glossary.rst:1182 msgid "type alias" msgstr "type alias(型別別名)" -#: ../../glossary.rst:1177 +#: ../../glossary.rst:1184 msgid "A synonym for a type, created by assigning the type to an identifier." msgstr "一個型別的同義詞,透過將型別指定給一個識別符 (identifier) 來建立。" -#: ../../glossary.rst:1179 +#: ../../glossary.rst:1186 msgid "" "Type aliases are useful for simplifying :term:`type hints `. For " "example::" @@ -2619,22 +2629,22 @@ msgstr "" "\n" "::" -#: ../../glossary.rst:1186 +#: ../../glossary.rst:1193 msgid "could be made more readable like this::" msgstr "" "可以寫成這樣,更具有可讀性:\n" "\n" "::" -#: ../../glossary.rst:1193 ../../glossary.rst:1207 +#: ../../glossary.rst:1200 ../../glossary.rst:1214 msgid "See :mod:`typing` and :pep:`484`, which describe this functionality." msgstr "請參閱 :mod:`typing` 和 :pep:`484`\\ ,有此功能的描述。" -#: ../../glossary.rst:1194 +#: ../../glossary.rst:1201 msgid "type hint" msgstr "type hint(型別提示)" -#: ../../glossary.rst:1196 +#: ../../glossary.rst:1203 msgid "" "An :term:`annotation` that specifies the expected type for a variable, a " "class attribute, or a function parameter or return value." @@ -2642,7 +2652,7 @@ msgstr "" "一種 :term:`annotation`\\ (註釋),它指定一個變數、一個 class 屬性或一個函式" "的參數或回傳值的預期型別。" -#: ../../glossary.rst:1199 +#: ../../glossary.rst:1206 msgid "" "Type hints are optional and are not enforced by Python but they are useful " "to static type analysis tools, and aid IDEs with code completion and " @@ -2651,7 +2661,7 @@ msgstr "" "型別提示是選擇性的,而不是被 Python 強制的,但它們對靜態型別分析工具很有用," "並能協助 IDE 完成程式碼的補全 (completion) 和重構 (refactoring)。" -#: ../../glossary.rst:1203 +#: ../../glossary.rst:1210 msgid "" "Type hints of global variables, class attributes, and functions, but not " "local variables, can be accessed using :func:`typing.get_type_hints`." @@ -2659,11 +2669,11 @@ msgstr "" "全域變數、class 屬性和函式(不含區域變數)的型別提示,都可以使用 :func:" "`typing.get_type_hints` 來存取。" -#: ../../glossary.rst:1208 +#: ../../glossary.rst:1215 msgid "universal newlines" msgstr "universal newlines(通用換行字元)" -#: ../../glossary.rst:1210 +#: ../../glossary.rst:1217 msgid "" "A manner of interpreting text streams in which all of the following are " "recognized as ending a line: the Unix end-of-line convention ``'\\n'``, the " @@ -2676,15 +2686,15 @@ msgstr "" "``'\\r'``。請參閱 :pep:`278` 和 :pep:`3116`\\ ,以及用於 :func:`bytes." "splitlines` 的附加用途。" -#: ../../glossary.rst:1215 +#: ../../glossary.rst:1222 msgid "variable annotation" msgstr "variable annotation(變數註釋)" -#: ../../glossary.rst:1217 +#: ../../glossary.rst:1224 msgid "An :term:`annotation` of a variable or a class attribute." msgstr "一個變數或 class 屬性的 :term:`annotation`\\ (註釋)。" -#: ../../glossary.rst:1219 +#: ../../glossary.rst:1226 msgid "" "When annotating a variable or a class attribute, assignment is optional::" msgstr "" @@ -2692,7 +2702,7 @@ msgstr "" "\n" "::" -#: ../../glossary.rst:1224 +#: ../../glossary.rst:1231 msgid "" "Variable annotations are usually used for :term:`type hints `: " "for example this variable is expected to take :class:`int` values::" @@ -2702,11 +2712,11 @@ msgstr "" "\n" "::" -#: ../../glossary.rst:1230 +#: ../../glossary.rst:1237 msgid "Variable annotation syntax is explained in section :ref:`annassign`." msgstr "變數註釋的語法在\\ :ref:`annassign`\\ 章節有詳細的解釋。" -#: ../../glossary.rst:1232 +#: ../../glossary.rst:1239 msgid "" "See :term:`function annotation`, :pep:`484` and :pep:`526`, which describe " "this functionality. Also see :ref:`annotations-howto` for best practices on " @@ -2716,11 +2726,11 @@ msgstr "" "`526`\\ ,皆有此功能的描述。關於註釋的最佳實踐方法,另請參閱 :ref:" "`annotations-howto`\\ 。" -#: ../../glossary.rst:1236 +#: ../../glossary.rst:1243 msgid "virtual environment" msgstr "virtual environment(虛擬環境)" -#: ../../glossary.rst:1238 +#: ../../glossary.rst:1245 msgid "" "A cooperatively isolated runtime environment that allows Python users and " "applications to install and upgrade Python distribution packages without " @@ -2731,15 +2741,15 @@ msgstr "" "程式得以安裝和升級 Python 發佈套件,而不會對同一個系統上運行的其他 Python 應" "用程式的行為產生干擾。" -#: ../../glossary.rst:1243 +#: ../../glossary.rst:1250 msgid "See also :mod:`venv`." msgstr "另請參閱 :mod:`venv`\\ 。" -#: ../../glossary.rst:1244 +#: ../../glossary.rst:1251 msgid "virtual machine" msgstr "virtual machine(虛擬機器)" -#: ../../glossary.rst:1246 +#: ../../glossary.rst:1253 msgid "" "A computer defined entirely in software. Python's virtual machine executes " "the :term:`bytecode` emitted by the bytecode compiler." @@ -2747,11 +2757,11 @@ msgstr "" "一部完全由軟體所定義的電腦 (computer)。Python 的虛擬機器會執行由 :term:" "`bytecode`\\ (位元組碼)編譯器所發出的位元組碼。" -#: ../../glossary.rst:1248 +#: ../../glossary.rst:1255 msgid "Zen of Python" msgstr "Zen of Python(Python 之禪)" -#: ../../glossary.rst:1250 +#: ../../glossary.rst:1257 msgid "" "Listing of Python design principles and philosophies that are helpful in " "understanding and using the language. The listing can be found by typing " diff --git a/howto/logging-cookbook.po b/howto/logging-cookbook.po index 9e6e455218..b9a437e225 100644 --- a/howto/logging-cookbook.po +++ b/howto/logging-cookbook.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-08-28 00:21+0000\n" +"POT-Creation-Date: 2022-09-29 00:25+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-" @@ -239,6 +239,17 @@ msgstr "" #: ../../howto/logging-cookbook.rst:400 msgid "" +"Although the earlier discussion wasn't specifically talking about async " +"code, but rather about slow logging handlers, it should be noted that when " +"logging from async code, network and even file handlers could lead to " +"problems (blocking the event loop) because some logging is done from :mod:" +"`asyncio` internals. It might be best, if any async code is used in an " +"application, to use the above approach for logging, so that any blocking " +"code runs only in the ``QueueListener`` thread." +msgstr "" + +#: ../../howto/logging-cookbook.rst:408 +msgid "" "Prior to Python 3.5, the :class:`QueueListener` always passed every message " "received from the queue to every handler it was initialized with. (This was " "because it was assumed that level filtering was all done on the other side, " @@ -249,30 +260,30 @@ msgid "" "handler if it's appropriate to do so." msgstr "" -#: ../../howto/logging-cookbook.rst:413 +#: ../../howto/logging-cookbook.rst:421 msgid "Sending and receiving logging events across a network" msgstr "" -#: ../../howto/logging-cookbook.rst:415 +#: ../../howto/logging-cookbook.rst:423 msgid "" "Let's say you want to send logging events across a network, and handle them " "at the receiving end. A simple way of doing this is attaching a :class:" "`SocketHandler` instance to the root logger at the sending end::" msgstr "" -#: ../../howto/logging-cookbook.rst:443 +#: ../../howto/logging-cookbook.rst:451 msgid "" "At the receiving end, you can set up a receiver using the :mod:" "`socketserver` module. Here is a basic working example::" msgstr "" -#: ../../howto/logging-cookbook.rst:531 +#: ../../howto/logging-cookbook.rst:539 msgid "" "First run the server, and then the client. On the client side, nothing is " "printed on the console; on the server side, you should see something like:" msgstr "" -#: ../../howto/logging-cookbook.rst:543 +#: ../../howto/logging-cookbook.rst:551 msgid "" "Note that there are some security issues with pickle in some scenarios. If " "these affect you, you can use an alternative serialization scheme by " @@ -281,11 +292,11 @@ msgid "" "use your alternative serialization." msgstr "" -#: ../../howto/logging-cookbook.rst:551 +#: ../../howto/logging-cookbook.rst:559 msgid "Running a logging socket listener in production" msgstr "" -#: ../../howto/logging-cookbook.rst:553 +#: ../../howto/logging-cookbook.rst:561 msgid "" "To run a logging listener in production, you may need to use a process-" "management tool such as `Supervisor `_. `Here " @@ -295,11 +306,11 @@ msgid "" "to reflect the actual paths you want to use." msgstr "" -#: ../../howto/logging-cookbook.rst:564 +#: ../../howto/logging-cookbook.rst:572 msgid "Adding contextual information to your logging output" msgstr "" -#: ../../howto/logging-cookbook.rst:566 +#: ../../howto/logging-cookbook.rst:574 msgid "" "Sometimes you want logging output to contain contextual information in " "addition to the parameters passed to the logging call. For example, in a " @@ -315,11 +326,11 @@ msgid "" "`Logger` instances becomes effectively unbounded." msgstr "" -#: ../../howto/logging-cookbook.rst:581 +#: ../../howto/logging-cookbook.rst:589 msgid "Using LoggerAdapters to impart contextual information" msgstr "" -#: ../../howto/logging-cookbook.rst:583 +#: ../../howto/logging-cookbook.rst:591 msgid "" "An easy way in which you can pass contextual information to be output along " "with logging event information is to use the :class:`LoggerAdapter` class. " @@ -330,7 +341,7 @@ msgid "" "types of instances interchangeably." msgstr "" -#: ../../howto/logging-cookbook.rst:591 +#: ../../howto/logging-cookbook.rst:599 msgid "" "When you create an instance of :class:`LoggerAdapter`, you pass it a :class:" "`Logger` instance and a dict-like object which contains your contextual " @@ -341,7 +352,7 @@ msgid "" "of :class:`LoggerAdapter`::" msgstr "" -#: ../../howto/logging-cookbook.rst:607 +#: ../../howto/logging-cookbook.rst:615 msgid "" "The :meth:`~LoggerAdapter.process` method of :class:`LoggerAdapter` is where " "the contextual information is added to the logging output. It's passed the " @@ -354,7 +365,7 @@ msgid "" "be silently overwritten." msgstr "" -#: ../../howto/logging-cookbook.rst:616 +#: ../../howto/logging-cookbook.rst:624 msgid "" "The advantage of using 'extra' is that the values in the dict-like object " "are merged into the :class:`LogRecord` instance's __dict__, allowing you to " @@ -365,21 +376,21 @@ msgid "" "`~LoggerAdapter.process` to do what you need. Here is a simple example::" msgstr "" -#: ../../howto/logging-cookbook.rst:632 +#: ../../howto/logging-cookbook.rst:640 msgid "which you can use like this::" msgstr "" -#: ../../howto/logging-cookbook.rst:637 +#: ../../howto/logging-cookbook.rst:645 msgid "" "Then any events that you log to the adapter will have the value of " "``some_conn_id`` prepended to the log messages." msgstr "" -#: ../../howto/logging-cookbook.rst:641 +#: ../../howto/logging-cookbook.rst:649 msgid "Using objects other than dicts to pass contextual information" msgstr "" -#: ../../howto/logging-cookbook.rst:643 +#: ../../howto/logging-cookbook.rst:651 msgid "" "You don't need to pass an actual dict to a :class:`LoggerAdapter` - you " "could pass an instance of a class which implements ``__getitem__`` and " @@ -388,11 +399,11 @@ msgid "" "would be constant)." msgstr "" -#: ../../howto/logging-cookbook.rst:652 +#: ../../howto/logging-cookbook.rst:660 msgid "Using Filters to impart contextual information" msgstr "" -#: ../../howto/logging-cookbook.rst:654 +#: ../../howto/logging-cookbook.rst:662 msgid "" "You can also add contextual information to log output using a user-defined :" "class:`Filter`. ``Filter`` instances are allowed to modify the " @@ -401,7 +412,7 @@ msgid "" "class:`Formatter`." msgstr "" -#: ../../howto/logging-cookbook.rst:659 +#: ../../howto/logging-cookbook.rst:667 msgid "" "For example in a web application, the request being processed (or at least, " "the interesting parts of it) can be stored in a threadlocal (:class:" @@ -413,15 +424,15 @@ msgid "" "an example script::" msgstr "" -#: ../../howto/logging-cookbook.rst:705 +#: ../../howto/logging-cookbook.rst:713 msgid "which, when run, produces something like:" msgstr "" -#: ../../howto/logging-cookbook.rst:723 +#: ../../howto/logging-cookbook.rst:731 msgid "Use of ``contextvars``" msgstr "" -#: ../../howto/logging-cookbook.rst:725 +#: ../../howto/logging-cookbook.rst:733 msgid "" "Since Python 3.7, the :mod:`contextvars` module has provided context-local " "storage which works for both :mod:`threading` and :mod:`asyncio` processing " @@ -431,7 +442,7 @@ msgid "" "attributes handled by web applications." msgstr "" -#: ../../howto/logging-cookbook.rst:731 +#: ../../howto/logging-cookbook.rst:739 msgid "" "For the purposes of illustration, say that you have different web " "applications, each independent of the other but running in the same Python " @@ -442,18 +453,18 @@ msgid "" "information such as client IP, HTTP request method and client username?" msgstr "" -#: ../../howto/logging-cookbook.rst:738 +#: ../../howto/logging-cookbook.rst:746 msgid "Let's assume that the library can be simulated by the following code:" msgstr "" -#: ../../howto/logging-cookbook.rst:754 +#: ../../howto/logging-cookbook.rst:762 msgid "" "We can simulate the multiple web applications by means of two simple " "classes, ``Request`` and ``WebApp``. These simulate how real threaded web " "applications work - each request is handled by a thread:" msgstr "" -#: ../../howto/logging-cookbook.rst:898 +#: ../../howto/logging-cookbook.rst:906 msgid "" "If you run the above, you should find that roughly half the requests go " "into :file:`app1.log` and the rest into :file:`app2.log`, and the all the " @@ -464,11 +475,11 @@ msgid "" "illustrated by the following shell output:" msgstr "" -#: ../../howto/logging-cookbook.rst:945 +#: ../../howto/logging-cookbook.rst:953 msgid "Imparting contextual information in handlers" msgstr "" -#: ../../howto/logging-cookbook.rst:947 +#: ../../howto/logging-cookbook.rst:955 msgid "" "Each :class:`~Handler` has its own chain of filters. If you want to add " "contextual information to a :class:`LogRecord` without leaking it to other " @@ -476,11 +487,11 @@ msgid "" "instead of modifying it in-place, as shown in the following script::" msgstr "" -#: ../../howto/logging-cookbook.rst:974 +#: ../../howto/logging-cookbook.rst:982 msgid "Logging to a single file from multiple processes" msgstr "" -#: ../../howto/logging-cookbook.rst:976 +#: ../../howto/logging-cookbook.rst:984 msgid "" "Although logging is thread-safe, and logging to a single file from multiple " "threads in a single process *is* supported, logging to a single file from " @@ -496,7 +507,7 @@ msgid "" "you to adapt in your own applications." msgstr "" -#: ../../howto/logging-cookbook.rst:989 +#: ../../howto/logging-cookbook.rst:997 msgid "" "You could also write your own handler which uses the :class:" "`~multiprocessing.Lock` class from the :mod:`multiprocessing` module to " @@ -507,7 +518,7 @@ msgid "" "platforms (see https://bugs.python.org/issue3770)." msgstr "" -#: ../../howto/logging-cookbook.rst:999 +#: ../../howto/logging-cookbook.rst:1007 msgid "" "Alternatively, you can use a ``Queue`` and a :class:`QueueHandler` to send " "all logging events to one of the processes in your multi-process " @@ -522,13 +533,13 @@ msgid "" "requirements::" msgstr "" -#: ../../howto/logging-cookbook.rst:1115 +#: ../../howto/logging-cookbook.rst:1123 msgid "" "A variant of the above script keeps the logging in the main process, in a " "separate thread::" msgstr "" -#: ../../howto/logging-cookbook.rst:1210 +#: ../../howto/logging-cookbook.rst:1218 msgid "" "This variant shows how you can e.g. apply configuration for particular " "loggers - e.g. the ``foo`` logger has a special handler which stores all " @@ -538,34 +549,34 @@ msgid "" "appropriate destinations." msgstr "" -#: ../../howto/logging-cookbook.rst:1217 +#: ../../howto/logging-cookbook.rst:1225 msgid "Using concurrent.futures.ProcessPoolExecutor" msgstr "" -#: ../../howto/logging-cookbook.rst:1219 +#: ../../howto/logging-cookbook.rst:1227 msgid "" "If you want to use :class:`concurrent.futures.ProcessPoolExecutor` to start " "your worker processes, you need to create the queue slightly differently. " "Instead of" msgstr "" -#: ../../howto/logging-cookbook.rst:1227 +#: ../../howto/logging-cookbook.rst:1235 msgid "you should use" msgstr "" -#: ../../howto/logging-cookbook.rst:1233 +#: ../../howto/logging-cookbook.rst:1241 msgid "and you can then replace the worker creation from this::" msgstr "" -#: ../../howto/logging-cookbook.rst:1244 +#: ../../howto/logging-cookbook.rst:1252 msgid "to this (remembering to first import :mod:`concurrent.futures`)::" msgstr "" -#: ../../howto/logging-cookbook.rst:1251 +#: ../../howto/logging-cookbook.rst:1259 msgid "Deploying Web applications using Gunicorn and uWSGI" msgstr "" -#: ../../howto/logging-cookbook.rst:1253 +#: ../../howto/logging-cookbook.rst:1261 msgid "" "When deploying Web applications using `Gunicorn `_ or " "`uWSGI `_ (or similar), " @@ -577,11 +588,11 @@ msgid "" "listener in production`_ for more details." msgstr "" -#: ../../howto/logging-cookbook.rst:1263 +#: ../../howto/logging-cookbook.rst:1271 msgid "Using file rotation" msgstr "" -#: ../../howto/logging-cookbook.rst:1268 +#: ../../howto/logging-cookbook.rst:1276 msgid "" "Sometimes you want to let a log file grow to a certain size, then open a new " "file and log to that. You may want to keep a certain number of these files, " @@ -591,13 +602,13 @@ msgid "" "RotatingFileHandler`::" msgstr "" -#: ../../howto/logging-cookbook.rst:1300 +#: ../../howto/logging-cookbook.rst:1308 msgid "" "The result should be 6 separate files, each with part of the log history for " "the application:" msgstr "" -#: ../../howto/logging-cookbook.rst:1312 +#: ../../howto/logging-cookbook.rst:1320 msgid "" "The most current file is always :file:`logging_rotatingfile_example.out`, " "and each time it reaches the size limit it is renamed with the suffix " @@ -605,17 +616,17 @@ msgid "" "(``.1`` becomes ``.2``, etc.) and the ``.6`` file is erased." msgstr "" -#: ../../howto/logging-cookbook.rst:1317 +#: ../../howto/logging-cookbook.rst:1325 msgid "" "Obviously this example sets the log length much too small as an extreme " "example. You would want to set *maxBytes* to an appropriate value." msgstr "" -#: ../../howto/logging-cookbook.rst:1323 +#: ../../howto/logging-cookbook.rst:1331 msgid "Use of alternative formatting styles" msgstr "" -#: ../../howto/logging-cookbook.rst:1325 +#: ../../howto/logging-cookbook.rst:1333 msgid "" "When logging was added to the Python standard library, the only way of " "formatting messages with variable content was to use the %-formatting " @@ -624,7 +635,7 @@ msgid "" "Python 2.6)." msgstr "" -#: ../../howto/logging-cookbook.rst:1331 +#: ../../howto/logging-cookbook.rst:1339 msgid "" "Logging (as of 3.2) provides improved support for these two additional " "formatting styles. The :class:`Formatter` class been enhanced to take an " @@ -637,14 +648,14 @@ msgid "" "session to show the possibilities:" msgstr "" -#: ../../howto/logging-cookbook.rst:1365 +#: ../../howto/logging-cookbook.rst:1373 msgid "" "Note that the formatting of logging messages for final output to logs is " "completely independent of how an individual logging message is constructed. " "That can still use %-formatting, as shown here::" msgstr "" -#: ../../howto/logging-cookbook.rst:1373 +#: ../../howto/logging-cookbook.rst:1381 msgid "" "Logging calls (``logger.debug()``, ``logger.info()`` etc.) only take " "positional parameters for the actual logging message itself, with keyword " @@ -660,7 +671,7 @@ msgid "" "strings." msgstr "" -#: ../../howto/logging-cookbook.rst:1386 +#: ../../howto/logging-cookbook.rst:1394 msgid "" "There is, however, a way that you can use {}- and $- formatting to construct " "your individual log messages. Recall that for a message you can use an " @@ -669,7 +680,7 @@ msgid "" "the following two classes::" msgstr "" -#: ../../howto/logging-cookbook.rst:1410 +#: ../../howto/logging-cookbook.rst:1418 msgid "" "Either of these can be used in place of a format string, to allow {}- or $-" "formatting to be used to build the actual \"message\" part which appears in " @@ -680,21 +691,21 @@ msgid "" "used as a synonym/alias for :func:`gettext.gettext` or its brethren)." msgstr "" -#: ../../howto/logging-cookbook.rst:1418 +#: ../../howto/logging-cookbook.rst:1426 msgid "" "The above classes are not included in Python, though they're easy enough to " "copy and paste into your own code. They can be used as follows (assuming " "that they're declared in a module called ``wherever``):" msgstr "" -#: ../../howto/logging-cookbook.rst:1440 +#: ../../howto/logging-cookbook.rst:1448 msgid "" "While the above examples use ``print()`` to show how the formatting works, " "you would of course use ``logger.debug()`` or similar to actually log using " "this approach." msgstr "" -#: ../../howto/logging-cookbook.rst:1444 +#: ../../howto/logging-cookbook.rst:1452 msgid "" "One thing to note is that you pay no significant performance penalty with " "this approach: the actual formatting happens not when you make the logging " @@ -705,23 +716,23 @@ msgid "" "sugar for a constructor call to one of the XXXMessage classes." msgstr "" -#: ../../howto/logging-cookbook.rst:1452 +#: ../../howto/logging-cookbook.rst:1460 msgid "" "If you prefer, you can use a :class:`LoggerAdapter` to achieve a similar " "effect to the above, as in the following example::" msgstr "" -#: ../../howto/logging-cookbook.rst:1483 +#: ../../howto/logging-cookbook.rst:1491 msgid "" "The above script should log the message ``Hello, world!`` when run with " "Python 3.2 or later." msgstr "" -#: ../../howto/logging-cookbook.rst:1492 +#: ../../howto/logging-cookbook.rst:1500 msgid "Customizing ``LogRecord``" msgstr "" -#: ../../howto/logging-cookbook.rst:1494 +#: ../../howto/logging-cookbook.rst:1502 msgid "" "Every logging event is represented by a :class:`LogRecord` instance. When an " "event is logged and not filtered out by a logger's level, a :class:" @@ -732,13 +743,13 @@ msgid "" "was done:" msgstr "" -#: ../../howto/logging-cookbook.rst:1501 +#: ../../howto/logging-cookbook.rst:1509 msgid "" ":meth:`Logger.makeRecord`, which is called in the normal process of logging " "an event. This invoked :class:`LogRecord` directly to create an instance." msgstr "" -#: ../../howto/logging-cookbook.rst:1504 +#: ../../howto/logging-cookbook.rst:1512 msgid "" ":func:`makeLogRecord`, which is called with a dictionary containing " "attributes to be added to the LogRecord. This is typically invoked when a " @@ -747,27 +758,27 @@ msgid "" "`~handlers.HTTPHandler`)." msgstr "" -#: ../../howto/logging-cookbook.rst:1510 +#: ../../howto/logging-cookbook.rst:1518 msgid "" "This has usually meant that if you need to do anything special with a :class:" "`LogRecord`, you've had to do one of the following." msgstr "" -#: ../../howto/logging-cookbook.rst:1513 +#: ../../howto/logging-cookbook.rst:1521 msgid "" "Create your own :class:`Logger` subclass, which overrides :meth:`Logger." "makeRecord`, and set it using :func:`~logging.setLoggerClass` before any " "loggers that you care about are instantiated." msgstr "" -#: ../../howto/logging-cookbook.rst:1516 +#: ../../howto/logging-cookbook.rst:1524 msgid "" "Add a :class:`Filter` to a logger or handler, which does the necessary " "special manipulation you need when its :meth:`~Filter.filter` method is " "called." msgstr "" -#: ../../howto/logging-cookbook.rst:1520 +#: ../../howto/logging-cookbook.rst:1528 msgid "" "The first approach would be a little unwieldy in the scenario where (say) " "several different libraries wanted to do different things. Each would " @@ -775,7 +786,7 @@ msgid "" "last would win." msgstr "" -#: ../../howto/logging-cookbook.rst:1525 +#: ../../howto/logging-cookbook.rst:1533 msgid "" "The second approach works reasonably well for many cases, but does not allow " "you to e.g. use a specialized subclass of :class:`LogRecord`. Library " @@ -784,7 +795,7 @@ msgid "" "would do simply by adding new packages or modules and doing ::" msgstr "" -#: ../../howto/logging-cookbook.rst:1533 +#: ../../howto/logging-cookbook.rst:1541 msgid "" "at module level). It's probably one too many things to think about. " "Developers could also add the filter to a :class:`~logging.NullHandler` " @@ -794,7 +805,7 @@ msgid "" "developer." msgstr "" -#: ../../howto/logging-cookbook.rst:1539 +#: ../../howto/logging-cookbook.rst:1547 msgid "" "In Python 3.2 and later, :class:`~logging.LogRecord` creation is done " "through a factory, which you can specify. The factory is just a callable you " @@ -804,7 +815,7 @@ msgid "" "`LogRecord` is the default setting for the factory." msgstr "" -#: ../../howto/logging-cookbook.rst:1546 +#: ../../howto/logging-cookbook.rst:1554 msgid "" "This approach allows a custom factory to control all aspects of LogRecord " "creation. For example, you could return a subclass, or just add some " @@ -812,7 +823,7 @@ msgid "" "this::" msgstr "" -#: ../../howto/logging-cookbook.rst:1559 +#: ../../howto/logging-cookbook.rst:1567 msgid "" "This pattern allows different libraries to chain factories together, and as " "long as they don't overwrite each other's attributes or unintentionally " @@ -822,70 +833,70 @@ msgid "" "used when the use of a :class:`Filter` does not provide the desired result." msgstr "" -#: ../../howto/logging-cookbook.rst:1570 +#: ../../howto/logging-cookbook.rst:1578 msgid "Subclassing QueueHandler - a ZeroMQ example" msgstr "" -#: ../../howto/logging-cookbook.rst:1572 +#: ../../howto/logging-cookbook.rst:1580 msgid "" "You can use a :class:`QueueHandler` subclass to send messages to other kinds " "of queues, for example a ZeroMQ 'publish' socket. In the example below,the " "socket is created separately and passed to the handler (as its 'queue')::" msgstr "" -#: ../../howto/logging-cookbook.rst:1591 +#: ../../howto/logging-cookbook.rst:1599 msgid "" "Of course there are other ways of organizing this, for example passing in " "the data needed by the handler to create the socket::" msgstr "" -#: ../../howto/logging-cookbook.rst:1609 +#: ../../howto/logging-cookbook.rst:1617 msgid "Subclassing QueueListener - a ZeroMQ example" msgstr "" -#: ../../howto/logging-cookbook.rst:1611 +#: ../../howto/logging-cookbook.rst:1619 msgid "" "You can also subclass :class:`QueueListener` to get messages from other " "kinds of queues, for example a ZeroMQ 'subscribe' socket. Here's an example::" msgstr "" -#: ../../howto/logging-cookbook.rst:1630 ../../howto/logging-cookbook.rst:3512 +#: ../../howto/logging-cookbook.rst:1638 ../../howto/logging-cookbook.rst:3520 msgid "Module :mod:`logging`" msgstr ":mod:`logging` 模組" -#: ../../howto/logging-cookbook.rst:1630 ../../howto/logging-cookbook.rst:3512 +#: ../../howto/logging-cookbook.rst:1638 ../../howto/logging-cookbook.rst:3520 msgid "API reference for the logging module." msgstr "" -#: ../../howto/logging-cookbook.rst:1633 ../../howto/logging-cookbook.rst:3515 +#: ../../howto/logging-cookbook.rst:1641 ../../howto/logging-cookbook.rst:3523 msgid "Module :mod:`logging.config`" msgstr ":mod:`logging.config` 模組" -#: ../../howto/logging-cookbook.rst:1633 ../../howto/logging-cookbook.rst:3515 +#: ../../howto/logging-cookbook.rst:1641 ../../howto/logging-cookbook.rst:3523 msgid "Configuration API for the logging module." msgstr "" -#: ../../howto/logging-cookbook.rst:1636 ../../howto/logging-cookbook.rst:3518 +#: ../../howto/logging-cookbook.rst:1644 ../../howto/logging-cookbook.rst:3526 msgid "Module :mod:`logging.handlers`" msgstr ":mod:`logging.handlers` 模組" -#: ../../howto/logging-cookbook.rst:1636 ../../howto/logging-cookbook.rst:3518 +#: ../../howto/logging-cookbook.rst:1644 ../../howto/logging-cookbook.rst:3526 msgid "Useful handlers included with the logging module." msgstr "" -#: ../../howto/logging-cookbook.rst:1638 +#: ../../howto/logging-cookbook.rst:1646 msgid ":ref:`A basic logging tutorial `" msgstr "" -#: ../../howto/logging-cookbook.rst:1640 +#: ../../howto/logging-cookbook.rst:1648 msgid ":ref:`A more advanced logging tutorial `" msgstr "" -#: ../../howto/logging-cookbook.rst:1644 +#: ../../howto/logging-cookbook.rst:1652 msgid "An example dictionary-based configuration" msgstr "" -#: ../../howto/logging-cookbook.rst:1646 +#: ../../howto/logging-cookbook.rst:1654 msgid "" "Below is an example of a logging configuration dictionary - it's taken from " "the `documentation on the Django project `_ of the Django documentation." msgstr "" -#: ../../howto/logging-cookbook.rst:1709 +#: ../../howto/logging-cookbook.rst:1717 msgid "Using a rotator and namer to customize log rotation processing" msgstr "" -#: ../../howto/logging-cookbook.rst:1711 +#: ../../howto/logging-cookbook.rst:1719 msgid "" "An example of how you can define a namer and rotator is given in the " "following snippet, which shows zlib-based compression of the log file::" msgstr "" -#: ../../howto/logging-cookbook.rst:1729 +#: ../../howto/logging-cookbook.rst:1737 msgid "" "These are not \"true\" .gz files, as they are bare compressed data, with no " "\"container\" such as you’d find in an actual gzip file. This snippet is " "just for illustration purposes." msgstr "" -#: ../../howto/logging-cookbook.rst:1734 +#: ../../howto/logging-cookbook.rst:1742 msgid "A more elaborate multiprocessing example" msgstr "" -#: ../../howto/logging-cookbook.rst:1736 +#: ../../howto/logging-cookbook.rst:1744 msgid "" "The following working example shows how logging can be used with " "multiprocessing using configuration files. The configurations are fairly " @@ -929,7 +940,7 @@ msgid "" "in a real multiprocessing scenario." msgstr "" -#: ../../howto/logging-cookbook.rst:1741 +#: ../../howto/logging-cookbook.rst:1749 msgid "" "In the example, the main process spawns a listener process and some worker " "processes. Each of the main process, the listener and the workers have three " @@ -942,17 +953,17 @@ msgid "" "own scenario." msgstr "" -#: ../../howto/logging-cookbook.rst:1751 +#: ../../howto/logging-cookbook.rst:1759 msgid "" "Here's the script - the docstrings and the comments hopefully explain how it " "works::" msgstr "" -#: ../../howto/logging-cookbook.rst:1963 +#: ../../howto/logging-cookbook.rst:1971 msgid "Inserting a BOM into messages sent to a SysLogHandler" msgstr "" -#: ../../howto/logging-cookbook.rst:1965 +#: ../../howto/logging-cookbook.rst:1973 msgid "" ":rfc:`5424` requires that a Unicode message be sent to a syslog daemon as a " "set of bytes which have the following structure: an optional pure-ASCII " @@ -961,7 +972,7 @@ msgid "" "<5424#section-6>`.)" msgstr "" -#: ../../howto/logging-cookbook.rst:1971 +#: ../../howto/logging-cookbook.rst:1979 msgid "" "In Python 3.1, code was added to :class:`~logging.handlers.SysLogHandler` to " "insert a BOM into the message, but unfortunately, it was implemented " @@ -969,7 +980,7 @@ msgid "" "hence not allowing any pure-ASCII component to appear before it." msgstr "" -#: ../../howto/logging-cookbook.rst:1977 +#: ../../howto/logging-cookbook.rst:1985 msgid "" "As this behaviour is broken, the incorrect BOM insertion code is being " "removed from Python 3.2.4 and later. However, it is not being replaced, and " @@ -978,33 +989,33 @@ msgid "" "encoded using UTF-8, then you need to do the following:" msgstr "" -#: ../../howto/logging-cookbook.rst:1983 +#: ../../howto/logging-cookbook.rst:1991 msgid "" "Attach a :class:`~logging.Formatter` instance to your :class:`~logging." "handlers.SysLogHandler` instance, with a format string such as::" msgstr "" -#: ../../howto/logging-cookbook.rst:1989 +#: ../../howto/logging-cookbook.rst:1997 msgid "" "The Unicode code point U+FEFF, when encoded using UTF-8, will be encoded as " "a UTF-8 BOM -- the byte-string ``b'\\xef\\xbb\\xbf'``." msgstr "" -#: ../../howto/logging-cookbook.rst:1992 +#: ../../howto/logging-cookbook.rst:2000 msgid "" "Replace the ASCII section with whatever placeholders you like, but make sure " "that the data that appears in there after substitution is always ASCII (that " "way, it will remain unchanged after UTF-8 encoding)." msgstr "" -#: ../../howto/logging-cookbook.rst:1996 +#: ../../howto/logging-cookbook.rst:2004 msgid "" "Replace the Unicode section with whatever placeholders you like; if the data " "which appears there after substitution contains characters outside the ASCII " "range, that's fine -- it will be encoded using UTF-8." msgstr "" -#: ../../howto/logging-cookbook.rst:2000 +#: ../../howto/logging-cookbook.rst:2008 msgid "" "The formatted message *will* be encoded using UTF-8 encoding by " "``SysLogHandler``. If you follow the above rules, you should be able to " @@ -1013,11 +1024,11 @@ msgid "" "daemon may complain." msgstr "" -#: ../../howto/logging-cookbook.rst:2007 +#: ../../howto/logging-cookbook.rst:2015 msgid "Implementing structured logging" msgstr "" -#: ../../howto/logging-cookbook.rst:2009 +#: ../../howto/logging-cookbook.rst:2017 msgid "" "Although most logging messages are intended for reading by humans, and thus " "not readily machine-parseable, there might be circumstances where you want " @@ -1029,31 +1040,31 @@ msgid "" "machine-parseable manner::" msgstr "" -#: ../../howto/logging-cookbook.rst:2033 +#: ../../howto/logging-cookbook.rst:2041 msgid "If the above script is run, it prints:" msgstr "" -#: ../../howto/logging-cookbook.rst:2039 ../../howto/logging-cookbook.rst:2081 +#: ../../howto/logging-cookbook.rst:2047 ../../howto/logging-cookbook.rst:2089 msgid "" "Note that the order of items might be different according to the version of " "Python used." msgstr "" -#: ../../howto/logging-cookbook.rst:2042 +#: ../../howto/logging-cookbook.rst:2050 msgid "" "If you need more specialised processing, you can use a custom JSON encoder, " "as in the following complete example::" msgstr "" -#: ../../howto/logging-cookbook.rst:2075 +#: ../../howto/logging-cookbook.rst:2083 msgid "When the above script is run, it prints:" msgstr "" -#: ../../howto/logging-cookbook.rst:2090 +#: ../../howto/logging-cookbook.rst:2098 msgid "Customizing handlers with :func:`dictConfig`" msgstr "" -#: ../../howto/logging-cookbook.rst:2092 +#: ../../howto/logging-cookbook.rst:2100 msgid "" "There are times when you want to customize logging handlers in particular " "ways, and if you use :func:`dictConfig` you may be able to do this without " @@ -1063,24 +1074,24 @@ msgid "" "customize handler creation using a plain function such as::" msgstr "" -#: ../../howto/logging-cookbook.rst:2106 +#: ../../howto/logging-cookbook.rst:2114 msgid "" "You can then specify, in a logging configuration passed to :func:" "`dictConfig`, that a logging handler be created by calling this function::" msgstr "" -#: ../../howto/logging-cookbook.rst:2139 +#: ../../howto/logging-cookbook.rst:2147 msgid "" "In this example I am setting the ownership using the ``pulse`` user and " "group, just for the purposes of illustration. Putting it together into a " "working script, ``chowntest.py``::" msgstr "" -#: ../../howto/logging-cookbook.rst:2186 +#: ../../howto/logging-cookbook.rst:2194 msgid "To run this, you will probably need to run as ``root``:" msgstr "" -#: ../../howto/logging-cookbook.rst:2196 +#: ../../howto/logging-cookbook.rst:2204 msgid "" "Note that this example uses Python 3.3 because that's where :func:`shutil." "chown` makes an appearance. This approach should work with any Python " @@ -1089,17 +1100,17 @@ msgid "" "change using e.g. :func:`os.chown`." msgstr "" -#: ../../howto/logging-cookbook.rst:2202 +#: ../../howto/logging-cookbook.rst:2210 msgid "" "In practice, the handler-creating function may be in a utility module " "somewhere in your project. Instead of the line in the configuration::" msgstr "" -#: ../../howto/logging-cookbook.rst:2207 +#: ../../howto/logging-cookbook.rst:2215 msgid "you could use e.g.::" msgstr "" -#: ../../howto/logging-cookbook.rst:2211 +#: ../../howto/logging-cookbook.rst:2219 msgid "" "where ``project.util`` can be replaced with the actual name of the package " "where the function resides. In the above working script, using ``'ext://" @@ -1107,25 +1118,25 @@ msgid "" "resolved by :func:`dictConfig` from the ``ext://`` specification." msgstr "" -#: ../../howto/logging-cookbook.rst:2216 +#: ../../howto/logging-cookbook.rst:2224 msgid "" "This example hopefully also points the way to how you could implement other " "types of file change - e.g. setting specific POSIX permission bits - in the " "same way, using :func:`os.chmod`." msgstr "" -#: ../../howto/logging-cookbook.rst:2220 +#: ../../howto/logging-cookbook.rst:2228 msgid "" "Of course, the approach could also be extended to types of handler other " "than a :class:`~logging.FileHandler` - for example, one of the rotating file " "handlers, or a different type of handler altogether." msgstr "" -#: ../../howto/logging-cookbook.rst:2230 +#: ../../howto/logging-cookbook.rst:2238 msgid "Using particular formatting styles throughout your application" msgstr "" -#: ../../howto/logging-cookbook.rst:2232 +#: ../../howto/logging-cookbook.rst:2240 msgid "" "In Python 3.2, the :class:`~logging.Formatter` gained a ``style`` keyword " "parameter which, while defaulting to ``%`` for backward compatibility, " @@ -1136,7 +1147,7 @@ msgid "" "is constructed." msgstr "" -#: ../../howto/logging-cookbook.rst:2239 +#: ../../howto/logging-cookbook.rst:2247 msgid "" "Logging calls (:meth:`~Logger.debug`, :meth:`~Logger.info` etc.) only take " "positional parameters for the actual logging message itself, with keyword " @@ -1151,7 +1162,7 @@ msgid "" "calls which are out there in existing code will be using %-format strings." msgstr "" -#: ../../howto/logging-cookbook.rst:2251 +#: ../../howto/logging-cookbook.rst:2259 msgid "" "There have been suggestions to associate format styles with specific " "loggers, but that approach also runs into backward compatibility problems " @@ -1159,7 +1170,7 @@ msgid "" "formatting." msgstr "" -#: ../../howto/logging-cookbook.rst:2255 +#: ../../howto/logging-cookbook.rst:2263 msgid "" "For logging to work interoperably between any third-party libraries and your " "code, decisions about formatting need to be made at the level of the " @@ -1167,11 +1178,11 @@ msgid "" "formatting styles can be accommodated." msgstr "" -#: ../../howto/logging-cookbook.rst:2262 +#: ../../howto/logging-cookbook.rst:2270 msgid "Using LogRecord factories" msgstr "" -#: ../../howto/logging-cookbook.rst:2264 +#: ../../howto/logging-cookbook.rst:2272 msgid "" "In Python 3.2, along with the :class:`~logging.Formatter` changes mentioned " "above, the logging package gained the ability to allow users to set their " @@ -1186,17 +1197,17 @@ msgid "" "implementation does." msgstr "" -#: ../../howto/logging-cookbook.rst:2275 +#: ../../howto/logging-cookbook.rst:2283 msgid "" "Refer to the reference documentation on :func:`setLogRecordFactory` and :" "class:`LogRecord` for more information." msgstr "" -#: ../../howto/logging-cookbook.rst:2280 +#: ../../howto/logging-cookbook.rst:2288 msgid "Using custom message objects" msgstr "" -#: ../../howto/logging-cookbook.rst:2282 +#: ../../howto/logging-cookbook.rst:2290 msgid "" "There is another, perhaps simpler way that you can use {}- and $- formatting " "to construct your individual log messages. You may recall (from :ref:" @@ -1206,7 +1217,7 @@ msgid "" "following two classes::" msgstr "" -#: ../../howto/logging-cookbook.rst:2307 +#: ../../howto/logging-cookbook.rst:2315 msgid "" "Either of these can be used in place of a format string, to allow {}- or $-" "formatting to be used to build the actual \"message\" part which appears in " @@ -1217,17 +1228,17 @@ msgid "" "using ``_`` for localization)." msgstr "" -#: ../../howto/logging-cookbook.rst:2315 +#: ../../howto/logging-cookbook.rst:2323 msgid "" "Examples of this approach are given below. Firstly, formatting with :meth:" "`str.format`::" msgstr "" -#: ../../howto/logging-cookbook.rst:2329 +#: ../../howto/logging-cookbook.rst:2337 msgid "Secondly, formatting with :class:`string.Template`::" msgstr "" -#: ../../howto/logging-cookbook.rst:2336 +#: ../../howto/logging-cookbook.rst:2344 msgid "" "One thing to note is that you pay no significant performance penalty with " "this approach: the actual formatting happens not when you make the logging " @@ -1239,11 +1250,11 @@ msgid "" "above." msgstr "" -#: ../../howto/logging-cookbook.rst:2350 +#: ../../howto/logging-cookbook.rst:2358 msgid "Configuring filters with :func:`dictConfig`" msgstr "" -#: ../../howto/logging-cookbook.rst:2352 +#: ../../howto/logging-cookbook.rst:2360 msgid "" "You *can* configure filters using :func:`~logging.config.dictConfig`, though " "it might not be obvious at first glance how to do it (hence this recipe). " @@ -1258,22 +1269,22 @@ msgid "" "complete example::" msgstr "" -#: ../../howto/logging-cookbook.rst:2405 +#: ../../howto/logging-cookbook.rst:2413 msgid "" "This example shows how you can pass configuration data to the callable which " "constructs the instance, in the form of keyword parameters. When run, the " "above script will print:" msgstr "" -#: ../../howto/logging-cookbook.rst:2413 +#: ../../howto/logging-cookbook.rst:2421 msgid "which shows that the filter is working as configured." msgstr "" -#: ../../howto/logging-cookbook.rst:2415 +#: ../../howto/logging-cookbook.rst:2423 msgid "A couple of extra points to note:" msgstr "" -#: ../../howto/logging-cookbook.rst:2417 +#: ../../howto/logging-cookbook.rst:2425 msgid "" "If you can't refer to the callable directly in the configuration (e.g. if it " "lives in a different module, and you can't import it directly where the " @@ -1283,7 +1294,7 @@ msgid "" "the above example." msgstr "" -#: ../../howto/logging-cookbook.rst:2424 +#: ../../howto/logging-cookbook.rst:2432 msgid "" "As well as for filters, this technique can also be used to configure custom " "handlers and formatters. See :ref:`logging-config-dict-userdef` for more " @@ -1292,11 +1303,11 @@ msgid "" "above." msgstr "" -#: ../../howto/logging-cookbook.rst:2433 +#: ../../howto/logging-cookbook.rst:2441 msgid "Customized exception formatting" msgstr "" -#: ../../howto/logging-cookbook.rst:2435 +#: ../../howto/logging-cookbook.rst:2443 msgid "" "There might be times when you want to do customized exception formatting - " "for argument's sake, let's say you want exactly one line per logged event, " @@ -1304,22 +1315,22 @@ msgid "" "formatter class, as shown in the following example::" msgstr "" -#: ../../howto/logging-cookbook.rst:2476 +#: ../../howto/logging-cookbook.rst:2484 msgid "When run, this produces a file with exactly two lines:" msgstr "" -#: ../../howto/logging-cookbook.rst:2483 +#: ../../howto/logging-cookbook.rst:2491 msgid "" "While the above treatment is simplistic, it points the way to how exception " "information can be formatted to your liking. The :mod:`traceback` module may " "be helpful for more specialized needs." msgstr "" -#: ../../howto/logging-cookbook.rst:2490 +#: ../../howto/logging-cookbook.rst:2498 msgid "Speaking logging messages" msgstr "" -#: ../../howto/logging-cookbook.rst:2492 +#: ../../howto/logging-cookbook.rst:2500 msgid "" "There might be situations when it is desirable to have logging messages " "rendered in an audible rather than a visible format. This is easy to do if " @@ -1336,24 +1347,24 @@ msgid "" "approach, which assumes that the ``espeak`` TTS package is available::" msgstr "" -#: ../../howto/logging-cookbook.rst:2534 +#: ../../howto/logging-cookbook.rst:2542 msgid "" "When run, this script should say \"Hello\" and then \"Goodbye\" in a female " "voice." msgstr "" -#: ../../howto/logging-cookbook.rst:2536 +#: ../../howto/logging-cookbook.rst:2544 msgid "" "The above approach can, of course, be adapted to other TTS systems and even " "other systems altogether which can process messages via external programs " "run from a command line." msgstr "" -#: ../../howto/logging-cookbook.rst:2544 +#: ../../howto/logging-cookbook.rst:2552 msgid "Buffering logging messages and outputting them conditionally" msgstr "" -#: ../../howto/logging-cookbook.rst:2546 +#: ../../howto/logging-cookbook.rst:2554 msgid "" "There might be situations where you want to log messages in a temporary area " "and only output them if a certain condition occurs. For example, you may " @@ -1363,7 +1374,7 @@ msgid "" "debug information to be output as well as the error." msgstr "" -#: ../../howto/logging-cookbook.rst:2553 +#: ../../howto/logging-cookbook.rst:2561 msgid "" "Here is an example which shows how you could do this using a decorator for " "your functions where you want logging to behave this way. It makes use of " @@ -1376,7 +1387,7 @@ msgid "" "subclass of ``MemoryHandler`` if you want custom flushing behavior." msgstr "" -#: ../../howto/logging-cookbook.rst:2563 +#: ../../howto/logging-cookbook.rst:2571 msgid "" "The example script has a simple function, ``foo``, which just cycles through " "all the logging levels, writing to ``sys.stderr`` to say what level it's " @@ -1385,7 +1396,7 @@ msgid "" "levels - otherwise, it only logs at DEBUG, INFO and WARNING levels." msgstr "" -#: ../../howto/logging-cookbook.rst:2569 +#: ../../howto/logging-cookbook.rst:2577 msgid "" "The script just arranges to decorate ``foo`` with a decorator which will do " "the conditional logging that's required. The decorator takes a logger as a " @@ -1397,30 +1408,30 @@ msgid "" "respectively." msgstr "" -#: ../../howto/logging-cookbook.rst:2577 +#: ../../howto/logging-cookbook.rst:2585 msgid "Here's the script::" msgstr "" -#: ../../howto/logging-cookbook.rst:2640 +#: ../../howto/logging-cookbook.rst:2648 msgid "When this script is run, the following output should be observed:" msgstr "" -#: ../../howto/logging-cookbook.rst:2670 +#: ../../howto/logging-cookbook.rst:2678 msgid "" "As you can see, actual logging output only occurs when an event is logged " "whose severity is ERROR or greater, but in that case, any previous events at " "lower severities are also logged." msgstr "" -#: ../../howto/logging-cookbook.rst:2674 +#: ../../howto/logging-cookbook.rst:2682 msgid "You can of course use the conventional means of decoration::" msgstr "" -#: ../../howto/logging-cookbook.rst:2684 +#: ../../howto/logging-cookbook.rst:2692 msgid "Sending logging messages to email, with buffering" msgstr "" -#: ../../howto/logging-cookbook.rst:2686 +#: ../../howto/logging-cookbook.rst:2694 msgid "" "To illustrate how you can send log messages via email, so that a set number " "of messages are sent per email, you can subclass :class:`~logging.handlers." @@ -1431,7 +1442,7 @@ msgid "" "argument to see the required and optional arguments.)" msgstr "" -#: ../../howto/logging-cookbook.rst:2758 +#: ../../howto/logging-cookbook.rst:2766 msgid "" "If you run this script and your SMTP server is correctly set up, you should " "find that it sends eleven emails to the addressee you specify. The first ten " @@ -1439,17 +1450,17 @@ msgid "" "messages. That makes up 102 messages as specified in the script." msgstr "" -#: ../../howto/logging-cookbook.rst:2766 +#: ../../howto/logging-cookbook.rst:2774 msgid "Formatting times using UTC (GMT) via configuration" msgstr "" -#: ../../howto/logging-cookbook.rst:2768 +#: ../../howto/logging-cookbook.rst:2776 msgid "" "Sometimes you want to format times using UTC, which can be done using a " "class such as `UTCFormatter`, shown below::" msgstr "" -#: ../../howto/logging-cookbook.rst:2777 +#: ../../howto/logging-cookbook.rst:2785 msgid "" "and you can then use the ``UTCFormatter`` in your code instead of :class:" "`~logging.Formatter`. If you want to do that via configuration, you can use " @@ -1457,21 +1468,21 @@ msgid "" "the following complete example::" msgstr "" -#: ../../howto/logging-cookbook.rst:2820 +#: ../../howto/logging-cookbook.rst:2828 msgid "When this script is run, it should print something like:" msgstr "" -#: ../../howto/logging-cookbook.rst:2827 +#: ../../howto/logging-cookbook.rst:2835 msgid "" "showing how the time is formatted both as local time and UTC, one for each " "handler." msgstr "" -#: ../../howto/logging-cookbook.rst:2834 +#: ../../howto/logging-cookbook.rst:2842 msgid "Using a context manager for selective logging" msgstr "" -#: ../../howto/logging-cookbook.rst:2836 +#: ../../howto/logging-cookbook.rst:2844 msgid "" "There are times when it would be useful to temporarily change the logging " "configuration and revert it back after doing something. For this, a context " @@ -1481,7 +1492,7 @@ msgid "" "scope of the context manager::" msgstr "" -#: ../../howto/logging-cookbook.rst:2869 +#: ../../howto/logging-cookbook.rst:2877 msgid "" "If you specify a level value, the logger's level is set to that value in the " "scope of the with block covered by the context manager. If you specify a " @@ -1490,13 +1501,13 @@ msgid "" "block exit - you could do this if you don't need the handler any more." msgstr "" -#: ../../howto/logging-cookbook.rst:2875 +#: ../../howto/logging-cookbook.rst:2883 msgid "" "To illustrate how it works, we can add the following block of code to the " "above::" msgstr "" -#: ../../howto/logging-cookbook.rst:2893 +#: ../../howto/logging-cookbook.rst:2901 msgid "" "We initially set the logger's level to ``INFO``, so message #1 appears and " "message #2 doesn't. We then change the level to ``DEBUG`` temporarily in the " @@ -1509,56 +1520,56 @@ msgid "" "(like message #1) whereas message #7 doesn't (just like message #2)." msgstr "" -#: ../../howto/logging-cookbook.rst:2903 +#: ../../howto/logging-cookbook.rst:2911 msgid "If we run the resulting script, the result is as follows:" msgstr "" -#: ../../howto/logging-cookbook.rst:2914 +#: ../../howto/logging-cookbook.rst:2922 msgid "" "If we run it again, but pipe ``stderr`` to ``/dev/null``, we see the " "following, which is the only message written to ``stdout``:" msgstr "" -#: ../../howto/logging-cookbook.rst:2922 +#: ../../howto/logging-cookbook.rst:2930 msgid "Once again, but piping ``stdout`` to ``/dev/null``, we get:" msgstr "" -#: ../../howto/logging-cookbook.rst:2932 +#: ../../howto/logging-cookbook.rst:2940 msgid "" "In this case, the message #5 printed to ``stdout`` doesn't appear, as " "expected." msgstr "" -#: ../../howto/logging-cookbook.rst:2934 +#: ../../howto/logging-cookbook.rst:2942 msgid "" "Of course, the approach described here can be generalised, for example to " "attach logging filters temporarily. Note that the above code works in Python " "2 as well as Python 3." msgstr "" -#: ../../howto/logging-cookbook.rst:2942 +#: ../../howto/logging-cookbook.rst:2950 msgid "A CLI application starter template" msgstr "" -#: ../../howto/logging-cookbook.rst:2944 +#: ../../howto/logging-cookbook.rst:2952 msgid "Here's an example which shows how you can:" msgstr "" -#: ../../howto/logging-cookbook.rst:2946 +#: ../../howto/logging-cookbook.rst:2954 msgid "Use a logging level based on command-line arguments" msgstr "" -#: ../../howto/logging-cookbook.rst:2947 +#: ../../howto/logging-cookbook.rst:2955 msgid "" "Dispatch to multiple subcommands in separate files, all logging at the same " "level in a consistent way" msgstr "" -#: ../../howto/logging-cookbook.rst:2949 +#: ../../howto/logging-cookbook.rst:2957 msgid "Make use of simple, minimal configuration" msgstr "" -#: ../../howto/logging-cookbook.rst:2951 +#: ../../howto/logging-cookbook.rst:2959 msgid "" "Suppose we have a command-line application whose job is to stop, start or " "restart some services. This could be organised for the purposes of " @@ -1569,53 +1580,53 @@ msgid "" "``logging.INFO``. Here's one way that ``app.py`` could be written::" msgstr "" -#: ../../howto/logging-cookbook.rst:3000 +#: ../../howto/logging-cookbook.rst:3008 msgid "" "And the ``start``, ``stop`` and ``restart`` commands can be implemented in " "separate modules, like so for starting::" msgstr "" -#: ../../howto/logging-cookbook.rst:3013 +#: ../../howto/logging-cookbook.rst:3021 msgid "and thus for stopping::" msgstr "" -#: ../../howto/logging-cookbook.rst:3034 +#: ../../howto/logging-cookbook.rst:3042 msgid "and similarly for restarting::" msgstr "" -#: ../../howto/logging-cookbook.rst:3055 +#: ../../howto/logging-cookbook.rst:3063 msgid "" "If we run this application with the default log level, we get output like " "this:" msgstr "" -#: ../../howto/logging-cookbook.rst:3068 +#: ../../howto/logging-cookbook.rst:3076 msgid "" "The first word is the logging level, and the second word is the module or " "package name of the place where the event was logged." msgstr "" -#: ../../howto/logging-cookbook.rst:3071 +#: ../../howto/logging-cookbook.rst:3079 msgid "" "If we change the logging level, then we can change the information sent to " "the log. For example, if we want more information:" msgstr "" -#: ../../howto/logging-cookbook.rst:3088 +#: ../../howto/logging-cookbook.rst:3096 msgid "And if we want less:" msgstr "" -#: ../../howto/logging-cookbook.rst:3096 +#: ../../howto/logging-cookbook.rst:3104 msgid "" "In this case, the commands don't print anything to the console, since " "nothing at ``WARNING`` level or above is logged by them." msgstr "" -#: ../../howto/logging-cookbook.rst:3102 +#: ../../howto/logging-cookbook.rst:3110 msgid "A Qt GUI for logging" msgstr "" -#: ../../howto/logging-cookbook.rst:3104 +#: ../../howto/logging-cookbook.rst:3112 msgid "" "A question that comes up from time to time is about how to log to a GUI " "application. The `Qt `_ framework is a popular cross-" @@ -1623,7 +1634,7 @@ msgid "" "project/PySide2/>`_ or `PyQt5 `_ libraries." msgstr "" -#: ../../howto/logging-cookbook.rst:3110 +#: ../../howto/logging-cookbook.rst:3118 msgid "" "The following example shows how to log to a Qt GUI. This introduces a simple " "``QtHandler`` class which takes a callable, which should be a slot in the " @@ -1633,14 +1644,14 @@ msgid "" "logging messages at random levels with random short delays in between)." msgstr "" -#: ../../howto/logging-cookbook.rst:3117 +#: ../../howto/logging-cookbook.rst:3125 msgid "" "The worker thread is implemented using Qt's ``QThread`` class rather than " "the :mod:`threading` module, as there are circumstances where one has to use " "``QThread``, which offers better integration with other ``Qt`` components." msgstr "" -#: ../../howto/logging-cookbook.rst:3121 +#: ../../howto/logging-cookbook.rst:3129 msgid "" "The code should work with recent releases of either ``PySide2`` or " "``PyQt5``. You should be able to adapt the approach to earlier versions of " @@ -1648,11 +1659,11 @@ msgid "" "information." msgstr "" -#: ../../howto/logging-cookbook.rst:3335 +#: ../../howto/logging-cookbook.rst:3343 msgid "Logging to syslog with RFC5424 support" msgstr "" -#: ../../howto/logging-cookbook.rst:3337 +#: ../../howto/logging-cookbook.rst:3345 msgid "" "Although :rfc:`5424` dates from 2009, most syslog servers are configured by " "detault to use the older :rfc:`3164`, which hails from 2001. When " @@ -1662,14 +1673,14 @@ msgid "" "handlers.SysLogHandler` functionality has not been updated." msgstr "" -#: ../../howto/logging-cookbook.rst:3344 +#: ../../howto/logging-cookbook.rst:3352 msgid "" "RFC 5424 contains some useful features such as support for structured data, " "and if you need to be able to log to a syslog server with support for it, " "you can do so with a subclassed handler which looks something like this::" msgstr "" -#: ../../howto/logging-cookbook.rst:3410 +#: ../../howto/logging-cookbook.rst:3418 msgid "" "You'll need to be familiar with RFC 5424 to fully understand the above code, " "and it may be that you have slightly different needs (e.g. for how you pass " @@ -1678,11 +1689,11 @@ msgid "" "using something like this::" msgstr "" -#: ../../howto/logging-cookbook.rst:3427 +#: ../../howto/logging-cookbook.rst:3435 msgid "Patterns to avoid" msgstr "" -#: ../../howto/logging-cookbook.rst:3429 +#: ../../howto/logging-cookbook.rst:3437 msgid "" "Although the preceding sections have described ways of doing things you " "might need to do or deal with, it is worth mentioning some usage patterns " @@ -1690,11 +1701,11 @@ msgid "" "The following sections are in no particular order." msgstr "" -#: ../../howto/logging-cookbook.rst:3436 +#: ../../howto/logging-cookbook.rst:3444 msgid "Opening the same log file multiple times" msgstr "" -#: ../../howto/logging-cookbook.rst:3438 +#: ../../howto/logging-cookbook.rst:3446 msgid "" "On Windows, you will generally not be able to open the same file multiple " "times as this will lead to a \"file is in use by another process\" error. " @@ -1702,32 +1713,32 @@ msgid "" "file multiple times. This could be done accidentally, for example by:" msgstr "" -#: ../../howto/logging-cookbook.rst:3443 +#: ../../howto/logging-cookbook.rst:3451 msgid "" "Adding a file handler more than once which references the same file (e.g. by " "a copy/paste/forget-to-change error)." msgstr "" -#: ../../howto/logging-cookbook.rst:3446 +#: ../../howto/logging-cookbook.rst:3454 msgid "" "Opening two files that look different, as they have different names, but are " "the same because one is a symbolic link to the other." msgstr "" -#: ../../howto/logging-cookbook.rst:3449 +#: ../../howto/logging-cookbook.rst:3457 msgid "" "Forking a process, following which both parent and child have a reference to " "the same file. This might be through use of the :mod:`multiprocessing` " "module, for example." msgstr "" -#: ../../howto/logging-cookbook.rst:3453 +#: ../../howto/logging-cookbook.rst:3461 msgid "" "Opening a file multiple times might *appear* to work most of the time, but " "can lead to a number of problems in practice:" msgstr "" -#: ../../howto/logging-cookbook.rst:3456 +#: ../../howto/logging-cookbook.rst:3464 msgid "" "Logging output can be garbled because multiple threads or processes try to " "write to the same file. Although logging guards against concurrent use of " @@ -1736,7 +1747,7 @@ msgid "" "different handler instances which happen to point to the same file." msgstr "" -#: ../../howto/logging-cookbook.rst:3462 +#: ../../howto/logging-cookbook.rst:3470 msgid "" "An attempt to delete a file (e.g. during file rotation) silently fails, " "because there is another reference pointing to it. This can lead to " @@ -1746,17 +1757,17 @@ msgid "" "being supposedly in place." msgstr "" -#: ../../howto/logging-cookbook.rst:3469 +#: ../../howto/logging-cookbook.rst:3477 msgid "" "Use the techniques outlined in :ref:`multiple-processes` to circumvent such " "issues." msgstr "" -#: ../../howto/logging-cookbook.rst:3473 +#: ../../howto/logging-cookbook.rst:3481 msgid "Using loggers as attributes in a class or passing them as parameters" msgstr "" -#: ../../howto/logging-cookbook.rst:3475 +#: ../../howto/logging-cookbook.rst:3483 msgid "" "While there might be unusual cases where you'll need to do this, in general " "there is no point because loggers are singletons. Code can always access a " @@ -1767,12 +1778,12 @@ msgid "" "module (and not the class) is the unit of software decomposition." msgstr "" -#: ../../howto/logging-cookbook.rst:3485 +#: ../../howto/logging-cookbook.rst:3493 msgid "" "Adding handlers other than :class:`NullHandler` to a logger in a library" msgstr "" -#: ../../howto/logging-cookbook.rst:3487 +#: ../../howto/logging-cookbook.rst:3495 msgid "" "Configuring logging by adding handlers, formatters and filters is the " "responsibility of the application developer, not the library developer. If " @@ -1780,11 +1791,11 @@ msgid "" "your loggers other than a :class:`~logging.NullHandler` instance." msgstr "" -#: ../../howto/logging-cookbook.rst:3494 +#: ../../howto/logging-cookbook.rst:3502 msgid "Creating a lot of loggers" msgstr "" -#: ../../howto/logging-cookbook.rst:3496 +#: ../../howto/logging-cookbook.rst:3504 msgid "" "Loggers are singletons that are never freed during a script execution, and " "so creating lots of loggers will use up memory which can't then be freed. " @@ -1795,14 +1806,14 @@ msgid "" "occasionally slightly more fine-grained than that)." msgstr "" -#: ../../howto/logging-cookbook.rst:3507 +#: ../../howto/logging-cookbook.rst:3515 msgid "Other resources" msgstr "" -#: ../../howto/logging-cookbook.rst:3520 +#: ../../howto/logging-cookbook.rst:3528 msgid ":ref:`Basic Tutorial `" msgstr "" -#: ../../howto/logging-cookbook.rst:3522 +#: ../../howto/logging-cookbook.rst:3530 msgid ":ref:`Advanced Tutorial `" msgstr "" diff --git a/howto/unicode.po b/howto/unicode.po index 5f13f059d8..0699219a39 100644 --- a/howto/unicode.po +++ b/howto/unicode.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-08-05 00:19+0000\n" +"POT-Creation-Date: 2022-09-26 00:21+0000\n" "PO-Revision-Date: 2018-05-23 14:37+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -569,7 +569,7 @@ msgstr "" #: ../../howto/unicode.rst:520 msgid "" -"`Processing Text Files in Python 3 `_, by Nick Coghlan." msgstr "" diff --git a/library/ast.po b/library/ast.po index fd4ca88e7f..41baf546aa 100644 --- a/library/ast.po +++ b/library/ast.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-07-19 00:19+0000\n" +"POT-Creation-Date: 2022-09-28 00:27+0000\n" "PO-Revision-Date: 2018-05-23 14:38+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1304,7 +1304,7 @@ msgstr "" #: ../../library/ast.rst:2240 msgid "" -"`leoAst.py `_ unifies the " +"`leoAst.py `_ unifies the " "token-based and parse-tree-based views of python programs by inserting two-" "way links between tokens and ast nodes." msgstr "" diff --git a/library/asyncio-dev.po b/library/asyncio-dev.po index 8e8e62472c..0666c865cf 100644 --- a/library/asyncio-dev.po +++ b/library/asyncio-dev.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-13 00:11+0000\n" +"POT-Creation-Date: 2022-09-29 00:25+0000\n" "PO-Revision-Date: 2022-06-11 15:29+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -207,16 +207,16 @@ msgstr "" msgid "" "There is currently no way to schedule coroutines or callbacks directly from " "a different process (such as one started with :mod:`multiprocessing`). The :" -"ref:`Event Loop Methods ` section lists APIs that can " -"read from pipes and watch file descriptors without blocking the event loop. " -"In addition, asyncio's :ref:`Subprocess ` APIs provide a " -"way to start a process and communicate with it from the event loop. Lastly, " -"the aforementioned :meth:`loop.run_in_executor` method can also be used with " -"a :class:`concurrent.futures.ProcessPoolExecutor` to execute code in a " +"ref:`asyncio-event-loop-methods` section lists APIs that can read from pipes " +"and watch file descriptors without blocking the event loop. In addition, " +"asyncio's :ref:`Subprocess ` APIs provide a way to start " +"a process and communicate with it from the event loop. Lastly, the " +"aforementioned :meth:`loop.run_in_executor` method can also be used with a :" +"class:`concurrent.futures.ProcessPoolExecutor` to execute code in a " "different process." msgstr "" "目前沒有什麼辦法能直接從另一個行程(例如透過 :mod:`multiprocessing` 啟動的程" -"序)來為協程或回呼排程。\\ :ref:`事件迴圈方法 `\\ 小節列" +"序)來為協程或回呼排程。\\ :ref:`asyncio-event-loop-methods`\\ 小節列" "出了可以從 pipes(管道)讀取並監視 file descriptor(檔案描述器)而不會阻塞事" "件迴圈的 API。此外,asyncio 的\\ :ref:`子行程 ` API 提供" "了一種啟動行程並從事件迴圈與其通訊的辦法。最後,之前提到的 :meth:`loop." @@ -267,11 +267,17 @@ msgstr "" "\n" "::" -#: ../../library/asyncio-dev.rst:154 +#: ../../library/asyncio-dev.rst:151 +msgid "" +"Network logging can block the event loop. It is recommended to use a " +"separate thread for handling logs or use non-blocking IO." +msgstr "" + +#: ../../library/asyncio-dev.rst:158 msgid "Detect never-awaited coroutines" msgstr "偵測從未被等待的 (never-awaited) 協程" -#: ../../library/asyncio-dev.rst:156 +#: ../../library/asyncio-dev.rst:160 msgid "" "When a coroutine function is called, but not awaited (e.g. ``coro()`` " "instead of ``await coro()``) or the coroutine is not scheduled with :meth:" @@ -283,21 +289,21 @@ msgstr "" "\n" "::" -#: ../../library/asyncio-dev.rst:171 ../../library/asyncio-dev.rst:216 +#: ../../library/asyncio-dev.rst:175 ../../library/asyncio-dev.rst:220 msgid "Output::" msgstr "" "輸出:\n" "\n" "::" -#: ../../library/asyncio-dev.rst:176 ../../library/asyncio-dev.rst:232 +#: ../../library/asyncio-dev.rst:180 ../../library/asyncio-dev.rst:236 msgid "Output in debug mode::" msgstr "" "除錯模式中的輸出:\n" "\n" "::" -#: ../../library/asyncio-dev.rst:189 +#: ../../library/asyncio-dev.rst:193 msgid "" "The usual fix is to either await the coroutine or call the :meth:`asyncio." "create_task` function::" @@ -306,11 +312,11 @@ msgstr "" "\n" "::" -#: ../../library/asyncio-dev.rst:197 +#: ../../library/asyncio-dev.rst:201 msgid "Detect never-retrieved exceptions" msgstr "偵測從未被獲取的 (never-retrieved) 例外" -#: ../../library/asyncio-dev.rst:199 +#: ../../library/asyncio-dev.rst:203 msgid "" "If a :meth:`Future.set_exception` is called but the Future object is never " "awaited on, the exception would never be propagated to the user code. In " @@ -321,14 +327,14 @@ msgstr "" "傳播 (propagate) 到使用者程式。在這種情況下,當 Future 物件被垃圾回收 " "(garbage collected) 時,asyncio 將發出一則日誌訊息。" -#: ../../library/asyncio-dev.rst:204 +#: ../../library/asyncio-dev.rst:208 msgid "Example of an unhandled exception::" msgstr "" "未處理例外的例子:\n" "\n" "::" -#: ../../library/asyncio-dev.rst:227 +#: ../../library/asyncio-dev.rst:231 msgid "" ":ref:`Enable the debug mode ` to get the traceback where " "the task was created::" diff --git a/library/asyncio-eventloop.po b/library/asyncio-eventloop.po index c96c3e2044..5447021722 100644 --- a/library/asyncio-eventloop.po +++ b/library/asyncio-eventloop.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-08-10 00:15+0000\n" +"POT-Creation-Date: 2022-09-29 00:25+0000\n" "PO-Revision-Date: 2022-02-20 12:36+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -19,11 +19,11 @@ msgstr "" "Plural-Forms: nplurals=1; plural=0;\n" "X-Generator: Poedit 3.0.1\n" -#: ../../library/asyncio-eventloop.rst:6 +#: ../../library/asyncio-eventloop.rst:8 msgid "Event Loop" msgstr "" -#: ../../library/asyncio-eventloop.rst:8 +#: ../../library/asyncio-eventloop.rst:10 msgid "" "**Source code:** :source:`Lib/asyncio/events.py`, :source:`Lib/asyncio/" "base_events.py`" @@ -31,18 +31,18 @@ msgstr "" "**原始碼:**\\ :source:`Lib/asyncio/events.py`\\ 、\\ :source:`Lib/asyncio/" "base_events.py`" -#: ../../library/asyncio-eventloop.rst:14 +#: ../../library/asyncio-eventloop.rst:16 msgid "Preface" msgstr "" -#: ../../library/asyncio-eventloop.rst:15 +#: ../../library/asyncio-eventloop.rst:17 msgid "" "The event loop is the core of every asyncio application. Event loops run " "asynchronous tasks and callbacks, perform network IO operations, and run " "subprocesses." msgstr "" -#: ../../library/asyncio-eventloop.rst:19 +#: ../../library/asyncio-eventloop.rst:21 msgid "" "Application developers should typically use the high-level asyncio " "functions, such as :func:`asyncio.run`, and should rarely need to reference " @@ -51,140 +51,140 @@ msgid "" "control over the event loop behavior." msgstr "" -#: ../../library/asyncio-eventloop.rst:26 +#: ../../library/asyncio-eventloop.rst:28 msgid "Obtaining the Event Loop" msgstr "" -#: ../../library/asyncio-eventloop.rst:27 +#: ../../library/asyncio-eventloop.rst:29 msgid "" "The following low-level functions can be used to get, set, or create an " "event loop:" msgstr "" -#: ../../library/asyncio-eventloop.rst:32 +#: ../../library/asyncio-eventloop.rst:34 msgid "Return the running event loop in the current OS thread." msgstr "" -#: ../../library/asyncio-eventloop.rst:34 +#: ../../library/asyncio-eventloop.rst:36 msgid "" "If there is no running event loop a :exc:`RuntimeError` is raised. This " "function can only be called from a coroutine or a callback." msgstr "" -#: ../../library/asyncio-eventloop.rst:41 +#: ../../library/asyncio-eventloop.rst:43 msgid "Get the current event loop." msgstr "" -#: ../../library/asyncio-eventloop.rst:43 +#: ../../library/asyncio-eventloop.rst:45 msgid "" "If there is no current event loop set in the current OS thread, the OS " "thread is main, and :func:`set_event_loop` has not yet been called, asyncio " "will create a new event loop and set it as the current one." msgstr "" -#: ../../library/asyncio-eventloop.rst:48 +#: ../../library/asyncio-eventloop.rst:50 msgid "" "Because this function has rather complex behavior (especially when custom " "event loop policies are in use), using the :func:`get_running_loop` function " "is preferred to :func:`get_event_loop` in coroutines and callbacks." msgstr "" -#: ../../library/asyncio-eventloop.rst:53 +#: ../../library/asyncio-eventloop.rst:55 msgid "" "Consider also using the :func:`asyncio.run` function instead of using lower " "level functions to manually create and close an event loop." msgstr "" -#: ../../library/asyncio-eventloop.rst:56 +#: ../../library/asyncio-eventloop.rst:58 msgid "" "Deprecation warning is emitted if there is no running event loop. In future " "Python releases, this function will be an alias of :func:`get_running_loop`." msgstr "" -#: ../../library/asyncio-eventloop.rst:63 +#: ../../library/asyncio-eventloop.rst:65 msgid "Set *loop* as a current event loop for the current OS thread." msgstr "" -#: ../../library/asyncio-eventloop.rst:67 +#: ../../library/asyncio-eventloop.rst:69 msgid "Create and return a new event loop object." msgstr "" -#: ../../library/asyncio-eventloop.rst:69 +#: ../../library/asyncio-eventloop.rst:71 msgid "" "Note that the behaviour of :func:`get_event_loop`, :func:`set_event_loop`, " "and :func:`new_event_loop` functions can be altered by :ref:`setting a " "custom event loop policy `." msgstr "" -#: ../../library/asyncio-eventloop.rst:75 +#: ../../library/asyncio-eventloop.rst:77 msgid "Contents" msgstr "目錄" -#: ../../library/asyncio-eventloop.rst:76 +#: ../../library/asyncio-eventloop.rst:78 msgid "This documentation page contains the following sections:" msgstr "" -#: ../../library/asyncio-eventloop.rst:78 +#: ../../library/asyncio-eventloop.rst:80 msgid "" "The `Event Loop Methods`_ section is the reference documentation of the " "event loop APIs;" msgstr "" -#: ../../library/asyncio-eventloop.rst:81 +#: ../../library/asyncio-eventloop.rst:83 msgid "" "The `Callback Handles`_ section documents the :class:`Handle` and :class:" "`TimerHandle` instances which are returned from scheduling methods such as :" "meth:`loop.call_soon` and :meth:`loop.call_later`;" msgstr "" -#: ../../library/asyncio-eventloop.rst:85 +#: ../../library/asyncio-eventloop.rst:87 msgid "" "The `Server Objects`_ section documents types returned from event loop " "methods like :meth:`loop.create_server`;" msgstr "" -#: ../../library/asyncio-eventloop.rst:88 +#: ../../library/asyncio-eventloop.rst:90 msgid "" "The `Event Loop Implementations`_ section documents the :class:" "`SelectorEventLoop` and :class:`ProactorEventLoop` classes;" msgstr "" -#: ../../library/asyncio-eventloop.rst:91 +#: ../../library/asyncio-eventloop.rst:93 msgid "" "The `Examples`_ section showcases how to work with some event loop APIs." msgstr "" -#: ../../library/asyncio-eventloop.rst:98 +#: ../../library/asyncio-eventloop.rst:100 msgid "Event Loop Methods" msgstr "" -#: ../../library/asyncio-eventloop.rst:100 +#: ../../library/asyncio-eventloop.rst:102 msgid "Event loops have **low-level** APIs for the following:" msgstr "" -#: ../../library/asyncio-eventloop.rst:108 +#: ../../library/asyncio-eventloop.rst:110 msgid "Running and stopping the loop" msgstr "" -#: ../../library/asyncio-eventloop.rst:112 +#: ../../library/asyncio-eventloop.rst:114 msgid "Run until the *future* (an instance of :class:`Future`) has completed." msgstr "" -#: ../../library/asyncio-eventloop.rst:115 +#: ../../library/asyncio-eventloop.rst:117 msgid "" "If the argument is a :ref:`coroutine object ` it is implicitly " "scheduled to run as a :class:`asyncio.Task`." msgstr "" -#: ../../library/asyncio-eventloop.rst:118 +#: ../../library/asyncio-eventloop.rst:120 msgid "Return the Future's result or raise its exception." msgstr "" -#: ../../library/asyncio-eventloop.rst:122 +#: ../../library/asyncio-eventloop.rst:124 msgid "Run the event loop until :meth:`stop` is called." msgstr "" -#: ../../library/asyncio-eventloop.rst:124 +#: ../../library/asyncio-eventloop.rst:126 msgid "" "If :meth:`stop` is called before :meth:`run_forever()` is called, the loop " "will poll the I/O selector once with a timeout of zero, run all callbacks " @@ -192,7 +192,7 @@ msgid "" "and then exit." msgstr "" -#: ../../library/asyncio-eventloop.rst:129 +#: ../../library/asyncio-eventloop.rst:131 msgid "" "If :meth:`stop` is called while :meth:`run_forever` is running, the loop " "will run the current batch of callbacks and then exit. Note that new " @@ -201,41 +201,41 @@ msgid "" "called." msgstr "" -#: ../../library/asyncio-eventloop.rst:137 +#: ../../library/asyncio-eventloop.rst:139 msgid "Stop the event loop." msgstr "" -#: ../../library/asyncio-eventloop.rst:141 +#: ../../library/asyncio-eventloop.rst:143 msgid "Return ``True`` if the event loop is currently running." msgstr "" -#: ../../library/asyncio-eventloop.rst:145 +#: ../../library/asyncio-eventloop.rst:147 msgid "Return ``True`` if the event loop was closed." msgstr "" -#: ../../library/asyncio-eventloop.rst:149 +#: ../../library/asyncio-eventloop.rst:151 msgid "Close the event loop." msgstr "" -#: ../../library/asyncio-eventloop.rst:151 +#: ../../library/asyncio-eventloop.rst:153 msgid "" "The loop must not be running when this function is called. Any pending " "callbacks will be discarded." msgstr "" -#: ../../library/asyncio-eventloop.rst:154 +#: ../../library/asyncio-eventloop.rst:156 msgid "" "This method clears all queues and shuts down the executor, but does not wait " "for the executor to finish." msgstr "" -#: ../../library/asyncio-eventloop.rst:157 +#: ../../library/asyncio-eventloop.rst:159 msgid "" "This method is idempotent and irreversible. No other methods should be " "called after the event loop is closed." msgstr "" -#: ../../library/asyncio-eventloop.rst:162 +#: ../../library/asyncio-eventloop.rst:164 msgid "" "Schedule all currently open :term:`asynchronous generator` objects to close " "with an :meth:`~agen.aclose()` call. After calling this method, the event " @@ -243,23 +243,23 @@ msgid "" "should be used to reliably finalize all scheduled asynchronous generators." msgstr "" -#: ../../library/asyncio-eventloop.rst:168 -#: ../../library/asyncio-eventloop.rst:188 +#: ../../library/asyncio-eventloop.rst:170 +#: ../../library/asyncio-eventloop.rst:190 msgid "" "Note that there is no need to call this function when :func:`asyncio.run` is " "used." msgstr "" -#: ../../library/asyncio-eventloop.rst:171 -#: ../../library/asyncio-eventloop.rst:1078 -#: ../../library/asyncio-eventloop.rst:1464 +#: ../../library/asyncio-eventloop.rst:173 +#: ../../library/asyncio-eventloop.rst:1080 +#: ../../library/asyncio-eventloop.rst:1466 msgid "Example::" msgstr "" "範例:\n" "\n" "::" -#: ../../library/asyncio-eventloop.rst:183 +#: ../../library/asyncio-eventloop.rst:185 msgid "" "Schedule the closure of the default executor and wait for it to join all of " "the threads in the :class:`ThreadPoolExecutor`. After calling this method, " @@ -267,196 +267,196 @@ msgid "" "called while using the default executor." msgstr "" -#: ../../library/asyncio-eventloop.rst:195 +#: ../../library/asyncio-eventloop.rst:197 msgid "Scheduling callbacks" msgstr "" -#: ../../library/asyncio-eventloop.rst:199 +#: ../../library/asyncio-eventloop.rst:201 msgid "" "Schedule the *callback* :term:`callback` to be called with *args* arguments " "at the next iteration of the event loop." msgstr "" -#: ../../library/asyncio-eventloop.rst:202 +#: ../../library/asyncio-eventloop.rst:204 msgid "" "Callbacks are called in the order in which they are registered. Each " "callback will be called exactly once." msgstr "" -#: ../../library/asyncio-eventloop.rst:205 -#: ../../library/asyncio-eventloop.rst:272 +#: ../../library/asyncio-eventloop.rst:207 +#: ../../library/asyncio-eventloop.rst:274 msgid "" "An optional keyword-only *context* argument allows specifying a custom :" "class:`contextvars.Context` for the *callback* to run in. The current " "context is used when no *context* is provided." msgstr "" -#: ../../library/asyncio-eventloop.rst:209 +#: ../../library/asyncio-eventloop.rst:211 msgid "" "An instance of :class:`asyncio.Handle` is returned, which can be used later " "to cancel the callback." msgstr "" -#: ../../library/asyncio-eventloop.rst:212 +#: ../../library/asyncio-eventloop.rst:214 msgid "This method is not thread-safe." msgstr "" -#: ../../library/asyncio-eventloop.rst:216 +#: ../../library/asyncio-eventloop.rst:218 msgid "" "A thread-safe variant of :meth:`call_soon`. Must be used to schedule " "callbacks *from another thread*." msgstr "" -#: ../../library/asyncio-eventloop.rst:219 +#: ../../library/asyncio-eventloop.rst:221 msgid "" "Raises :exc:`RuntimeError` if called on a loop that's been closed. This can " "happen on a secondary thread when the main application is shutting down." msgstr "" -#: ../../library/asyncio-eventloop.rst:223 +#: ../../library/asyncio-eventloop.rst:225 msgid "" "See the :ref:`concurrency and multithreading ` " "section of the documentation." msgstr "" -#: ../../library/asyncio-eventloop.rst:226 -#: ../../library/asyncio-eventloop.rst:276 -#: ../../library/asyncio-eventloop.rst:296 +#: ../../library/asyncio-eventloop.rst:228 +#: ../../library/asyncio-eventloop.rst:278 +#: ../../library/asyncio-eventloop.rst:298 msgid "" "The *context* keyword-only parameter was added. See :pep:`567` for more " "details." msgstr "" -#: ../../library/asyncio-eventloop.rst:234 +#: ../../library/asyncio-eventloop.rst:236 msgid "" "Most :mod:`asyncio` scheduling functions don't allow passing keyword " "arguments. To do that, use :func:`functools.partial`::" msgstr "" -#: ../../library/asyncio-eventloop.rst:241 +#: ../../library/asyncio-eventloop.rst:243 msgid "" "Using partial objects is usually more convenient than using lambdas, as " "asyncio can render partial objects better in debug and error messages." msgstr "" -#: ../../library/asyncio-eventloop.rst:249 +#: ../../library/asyncio-eventloop.rst:251 msgid "Scheduling delayed callbacks" msgstr "" -#: ../../library/asyncio-eventloop.rst:251 +#: ../../library/asyncio-eventloop.rst:253 msgid "" "Event loop provides mechanisms to schedule callback functions to be called " "at some point in the future. Event loop uses monotonic clocks to track time." msgstr "" -#: ../../library/asyncio-eventloop.rst:258 +#: ../../library/asyncio-eventloop.rst:260 msgid "" "Schedule *callback* to be called after the given *delay* number of seconds " "(can be either an int or a float)." msgstr "" -#: ../../library/asyncio-eventloop.rst:261 -#: ../../library/asyncio-eventloop.rst:293 +#: ../../library/asyncio-eventloop.rst:263 +#: ../../library/asyncio-eventloop.rst:295 msgid "" "An instance of :class:`asyncio.TimerHandle` is returned which can be used to " "cancel the callback." msgstr "" -#: ../../library/asyncio-eventloop.rst:264 +#: ../../library/asyncio-eventloop.rst:266 msgid "" "*callback* will be called exactly once. If two callbacks are scheduled for " "exactly the same time, the order in which they are called is undefined." msgstr "" -#: ../../library/asyncio-eventloop.rst:268 +#: ../../library/asyncio-eventloop.rst:270 msgid "" "The optional positional *args* will be passed to the callback when it is " "called. If you want the callback to be called with keyword arguments use :" "func:`functools.partial`." msgstr "" -#: ../../library/asyncio-eventloop.rst:280 +#: ../../library/asyncio-eventloop.rst:282 msgid "" "In Python 3.7 and earlier with the default event loop implementation, the " "*delay* could not exceed one day. This has been fixed in Python 3.8." msgstr "" -#: ../../library/asyncio-eventloop.rst:287 +#: ../../library/asyncio-eventloop.rst:289 msgid "" "Schedule *callback* to be called at the given absolute timestamp *when* (an " "int or a float), using the same time reference as :meth:`loop.time`." msgstr "" -#: ../../library/asyncio-eventloop.rst:291 +#: ../../library/asyncio-eventloop.rst:293 msgid "This method's behavior is the same as :meth:`call_later`." msgstr "" -#: ../../library/asyncio-eventloop.rst:300 +#: ../../library/asyncio-eventloop.rst:302 msgid "" "In Python 3.7 and earlier with the default event loop implementation, the " "difference between *when* and the current time could not exceed one day. " "This has been fixed in Python 3.8." msgstr "" -#: ../../library/asyncio-eventloop.rst:307 +#: ../../library/asyncio-eventloop.rst:309 msgid "" "Return the current time, as a :class:`float` value, according to the event " "loop's internal monotonic clock." msgstr "" -#: ../../library/asyncio-eventloop.rst:311 +#: ../../library/asyncio-eventloop.rst:313 msgid "" "In Python 3.7 and earlier timeouts (relative *delay* or absolute *when*) " "should not exceed one day. This has been fixed in Python 3.8." msgstr "" -#: ../../library/asyncio-eventloop.rst:317 +#: ../../library/asyncio-eventloop.rst:319 msgid "The :func:`asyncio.sleep` function." msgstr "" -#: ../../library/asyncio-eventloop.rst:321 +#: ../../library/asyncio-eventloop.rst:323 msgid "Creating Futures and Tasks" msgstr "" -#: ../../library/asyncio-eventloop.rst:325 +#: ../../library/asyncio-eventloop.rst:327 msgid "Create an :class:`asyncio.Future` object attached to the event loop." msgstr "" -#: ../../library/asyncio-eventloop.rst:327 +#: ../../library/asyncio-eventloop.rst:329 msgid "" "This is the preferred way to create Futures in asyncio. This lets third-" "party event loops provide alternative implementations of the Future object " "(with better performance or instrumentation)." msgstr "" -#: ../../library/asyncio-eventloop.rst:335 +#: ../../library/asyncio-eventloop.rst:337 msgid "" "Schedule the execution of :ref:`coroutine ` *coro*. Return a :" "class:`Task` object." msgstr "" -#: ../../library/asyncio-eventloop.rst:338 +#: ../../library/asyncio-eventloop.rst:340 msgid "" "Third-party event loops can use their own subclass of :class:`Task` for " "interoperability. In this case, the result type is a subclass of :class:" "`Task`." msgstr "" -#: ../../library/asyncio-eventloop.rst:342 +#: ../../library/asyncio-eventloop.rst:344 msgid "" "If the *name* argument is provided and not ``None``, it is set as the name " "of the task using :meth:`Task.set_name`." msgstr "" -#: ../../library/asyncio-eventloop.rst:345 +#: ../../library/asyncio-eventloop.rst:347 msgid "Added the *name* parameter." msgstr "加入 *name* 參數。" -#: ../../library/asyncio-eventloop.rst:350 +#: ../../library/asyncio-eventloop.rst:352 msgid "Set a task factory that will be used by :meth:`loop.create_task`." msgstr "" -#: ../../library/asyncio-eventloop.rst:353 +#: ../../library/asyncio-eventloop.rst:355 msgid "" "If *factory* is ``None`` the default task factory will be set. Otherwise, " "*factory* must be a *callable* with the signature matching ``(loop, coro)``, " @@ -465,82 +465,82 @@ msgid "" "compatible object." msgstr "" -#: ../../library/asyncio-eventloop.rst:361 +#: ../../library/asyncio-eventloop.rst:363 msgid "Return a task factory or ``None`` if the default one is in use." msgstr "" -#: ../../library/asyncio-eventloop.rst:365 +#: ../../library/asyncio-eventloop.rst:367 msgid "Opening network connections" msgstr "" -#: ../../library/asyncio-eventloop.rst:374 +#: ../../library/asyncio-eventloop.rst:376 msgid "" "Open a streaming transport connection to a given address specified by *host* " "and *port*." msgstr "" -#: ../../library/asyncio-eventloop.rst:377 +#: ../../library/asyncio-eventloop.rst:379 msgid "" "The socket family can be either :py:data:`~socket.AF_INET` or :py:data:" "`~socket.AF_INET6` depending on *host* (or the *family* argument, if " "provided)." msgstr "" -#: ../../library/asyncio-eventloop.rst:381 +#: ../../library/asyncio-eventloop.rst:383 msgid "The socket type will be :py:data:`~socket.SOCK_STREAM`." msgstr "" -#: ../../library/asyncio-eventloop.rst:383 -#: ../../library/asyncio-eventloop.rst:994 -#: ../../library/asyncio-eventloop.rst:1010 +#: ../../library/asyncio-eventloop.rst:385 +#: ../../library/asyncio-eventloop.rst:996 +#: ../../library/asyncio-eventloop.rst:1012 msgid "" "*protocol_factory* must be a callable returning an :ref:`asyncio protocol " "` implementation." msgstr "" -#: ../../library/asyncio-eventloop.rst:386 +#: ../../library/asyncio-eventloop.rst:388 msgid "" "This method will try to establish the connection in the background. When " "successful, it returns a ``(transport, protocol)`` pair." msgstr "" -#: ../../library/asyncio-eventloop.rst:389 +#: ../../library/asyncio-eventloop.rst:391 msgid "The chronological synopsis of the underlying operation is as follows:" msgstr "" -#: ../../library/asyncio-eventloop.rst:391 +#: ../../library/asyncio-eventloop.rst:393 msgid "" "The connection is established and a :ref:`transport ` is " "created for it." msgstr "" -#: ../../library/asyncio-eventloop.rst:394 +#: ../../library/asyncio-eventloop.rst:396 msgid "" "*protocol_factory* is called without arguments and is expected to return a :" "ref:`protocol ` instance." msgstr "" -#: ../../library/asyncio-eventloop.rst:397 +#: ../../library/asyncio-eventloop.rst:399 msgid "" "The protocol instance is coupled with the transport by calling its :meth:" "`~BaseProtocol.connection_made` method." msgstr "" -#: ../../library/asyncio-eventloop.rst:400 +#: ../../library/asyncio-eventloop.rst:402 msgid "A ``(transport, protocol)`` tuple is returned on success." msgstr "" -#: ../../library/asyncio-eventloop.rst:402 +#: ../../library/asyncio-eventloop.rst:404 msgid "" "The created transport is an implementation-dependent bidirectional stream." msgstr "" -#: ../../library/asyncio-eventloop.rst:405 -#: ../../library/asyncio-eventloop.rst:527 +#: ../../library/asyncio-eventloop.rst:407 +#: ../../library/asyncio-eventloop.rst:529 msgid "Other arguments:" msgstr "" -#: ../../library/asyncio-eventloop.rst:407 +#: ../../library/asyncio-eventloop.rst:409 msgid "" "*ssl*: if given and not false, a SSL/TLS transport is created (by default a " "plain TCP transport is created). If *ssl* is a :class:`ssl.SSLContext` " @@ -549,11 +549,11 @@ msgid "" "is used." msgstr "" -#: ../../library/asyncio-eventloop.rst:413 +#: ../../library/asyncio-eventloop.rst:415 msgid ":ref:`SSL/TLS security considerations `" msgstr "" -#: ../../library/asyncio-eventloop.rst:415 +#: ../../library/asyncio-eventloop.rst:417 msgid "" "*server_hostname* sets or overrides the hostname that the target server's " "certificate will be matched against. Should only be passed if *ssl* is not " @@ -564,7 +564,7 @@ msgid "" "potential man-in-the-middle attacks)." msgstr "" -#: ../../library/asyncio-eventloop.rst:423 +#: ../../library/asyncio-eventloop.rst:425 msgid "" "*family*, *proto*, *flags* are the optional address family, protocol and " "flags to be passed through to getaddrinfo() for *host* resolution. If given, " @@ -572,7 +572,7 @@ msgid "" "constants." msgstr "" -#: ../../library/asyncio-eventloop.rst:428 +#: ../../library/asyncio-eventloop.rst:430 msgid "" "*happy_eyeballs_delay*, if given, enables Happy Eyeballs for this " "connection. It should be a floating-point number representing the amount of " @@ -582,7 +582,7 @@ msgid "" "RFC is ``0.25`` (250 milliseconds)." msgstr "" -#: ../../library/asyncio-eventloop.rst:436 +#: ../../library/asyncio-eventloop.rst:438 msgid "" "*interleave* controls address reordering when a host name resolves to " "multiple IP addresses. If ``0`` or unspecified, no reordering is done, and " @@ -593,7 +593,7 @@ msgid "" "is not specified, and ``1`` if it is." msgstr "" -#: ../../library/asyncio-eventloop.rst:445 +#: ../../library/asyncio-eventloop.rst:447 msgid "" "*sock*, if given, should be an existing, already connected :class:`socket." "socket` object to be used by the transport. If *sock* is given, none of " @@ -601,42 +601,42 @@ msgid "" "*interleave* and *local_addr* should be specified." msgstr "" -#: ../../library/asyncio-eventloop.rst:451 +#: ../../library/asyncio-eventloop.rst:453 msgid "" "*local_addr*, if given, is a ``(local_host, local_port)`` tuple used to bind " "the socket locally. The *local_host* and *local_port* are looked up using " "``getaddrinfo()``, similarly to *host* and *port*." msgstr "" -#: ../../library/asyncio-eventloop.rst:455 -#: ../../library/asyncio-eventloop.rst:803 +#: ../../library/asyncio-eventloop.rst:457 +#: ../../library/asyncio-eventloop.rst:805 msgid "" "*ssl_handshake_timeout* is (for a TLS connection) the time in seconds to " "wait for the TLS handshake to complete before aborting the connection. " "``60.0`` seconds if ``None`` (default)." msgstr "" -#: ../../library/asyncio-eventloop.rst:461 -#: ../../library/asyncio-eventloop.rst:673 +#: ../../library/asyncio-eventloop.rst:463 +#: ../../library/asyncio-eventloop.rst:675 msgid "Added support for SSL/TLS in :class:`ProactorEventLoop`." msgstr "" -#: ../../library/asyncio-eventloop.rst:465 +#: ../../library/asyncio-eventloop.rst:467 msgid "" "The socket option :py:data:`~socket.TCP_NODELAY` is set by default for all " "TCP connections." msgstr "" -#: ../../library/asyncio-eventloop.rst:470 -#: ../../library/asyncio-eventloop.rst:743 +#: ../../library/asyncio-eventloop.rst:472 +#: ../../library/asyncio-eventloop.rst:745 msgid "Added the *ssl_handshake_timeout* parameter." msgstr "增加 *ssl_handshake_timeout* 參數。" -#: ../../library/asyncio-eventloop.rst:474 +#: ../../library/asyncio-eventloop.rst:476 msgid "Added the *happy_eyeballs_delay* and *interleave* parameters." msgstr "加入 *happy_eyeballs_delay* 和 *interleave* 參數。" -#: ../../library/asyncio-eventloop.rst:476 +#: ../../library/asyncio-eventloop.rst:478 msgid "" "Happy Eyeballs Algorithm: Success with Dual-Stack Hosts. When a server's " "IPv4 path and protocol are working, but the server's IPv6 path and protocol " @@ -647,32 +647,32 @@ msgid "" "visible delay and provides an algorithm." msgstr "" -#: ../../library/asyncio-eventloop.rst:485 +#: ../../library/asyncio-eventloop.rst:487 msgid "For more information: https://tools.ietf.org/html/rfc6555" msgstr "更多資訊請見:\\ https://tools.ietf.org/html/rfc6555" -#: ../../library/asyncio-eventloop.rst:489 +#: ../../library/asyncio-eventloop.rst:491 msgid "" "The :func:`open_connection` function is a high-level alternative API. It " "returns a pair of (:class:`StreamReader`, :class:`StreamWriter`) that can be " "used directly in async/await code." msgstr "" -#: ../../library/asyncio-eventloop.rst:500 +#: ../../library/asyncio-eventloop.rst:502 msgid "" "The parameter *reuse_address* is no longer supported, as using :py:data:" "`~sockets.SO_REUSEADDR` poses a significant security concern for UDP. " "Explicitly passing ``reuse_address=True`` will raise an exception." msgstr "" -#: ../../library/asyncio-eventloop.rst:504 +#: ../../library/asyncio-eventloop.rst:506 msgid "" "When multiple processes with differing UIDs assign sockets to an identical " "UDP socket address with ``SO_REUSEADDR``, incoming packets can become " "randomly distributed among the sockets." msgstr "" -#: ../../library/asyncio-eventloop.rst:508 +#: ../../library/asyncio-eventloop.rst:510 msgid "" "For supported platforms, *reuse_port* can be used as a replacement for " "similar functionality. With *reuse_port*, :py:data:`~sockets.SO_REUSEPORT` " @@ -680,49 +680,49 @@ msgid "" "from assigning sockets to the same socket address." msgstr "" -#: ../../library/asyncio-eventloop.rst:514 +#: ../../library/asyncio-eventloop.rst:516 msgid "Create a datagram connection." msgstr "" -#: ../../library/asyncio-eventloop.rst:516 +#: ../../library/asyncio-eventloop.rst:518 msgid "" "The socket family can be either :py:data:`~socket.AF_INET`, :py:data:" "`~socket.AF_INET6`, or :py:data:`~socket.AF_UNIX`, depending on *host* (or " "the *family* argument, if provided)." msgstr "" -#: ../../library/asyncio-eventloop.rst:520 +#: ../../library/asyncio-eventloop.rst:522 msgid "The socket type will be :py:data:`~socket.SOCK_DGRAM`." msgstr "" -#: ../../library/asyncio-eventloop.rst:522 -#: ../../library/asyncio-eventloop.rst:614 -#: ../../library/asyncio-eventloop.rst:724 +#: ../../library/asyncio-eventloop.rst:524 +#: ../../library/asyncio-eventloop.rst:616 +#: ../../library/asyncio-eventloop.rst:726 msgid "" "*protocol_factory* must be a callable returning a :ref:`protocol ` implementation." msgstr "" -#: ../../library/asyncio-eventloop.rst:525 -#: ../../library/asyncio-eventloop.rst:579 +#: ../../library/asyncio-eventloop.rst:527 +#: ../../library/asyncio-eventloop.rst:581 msgid "A tuple of ``(transport, protocol)`` is returned on success." msgstr "" -#: ../../library/asyncio-eventloop.rst:529 +#: ../../library/asyncio-eventloop.rst:531 msgid "" "*local_addr*, if given, is a ``(local_host, local_port)`` tuple used to bind " "the socket locally. The *local_host* and *local_port* are looked up using :" "meth:`getaddrinfo`." msgstr "" -#: ../../library/asyncio-eventloop.rst:533 +#: ../../library/asyncio-eventloop.rst:535 msgid "" "*remote_addr*, if given, is a ``(remote_host, remote_port)`` tuple used to " "connect the socket to a remote address. The *remote_host* and *remote_port* " "are looked up using :meth:`getaddrinfo`." msgstr "" -#: ../../library/asyncio-eventloop.rst:537 +#: ../../library/asyncio-eventloop.rst:539 msgid "" "*family*, *proto*, *flags* are the optional address family, protocol and " "flags to be passed through to :meth:`getaddrinfo` for *host* resolution. If " @@ -730,7 +730,7 @@ msgid "" "module constants." msgstr "" -#: ../../library/asyncio-eventloop.rst:542 +#: ../../library/asyncio-eventloop.rst:544 msgid "" "*reuse_port* tells the kernel to allow this endpoint to be bound to the same " "port as other existing endpoints are bound to, so long as they all set this " @@ -739,13 +739,13 @@ msgid "" "this capability is unsupported." msgstr "" -#: ../../library/asyncio-eventloop.rst:548 +#: ../../library/asyncio-eventloop.rst:550 msgid "" "*allow_broadcast* tells the kernel to allow this endpoint to send messages " "to the broadcast address." msgstr "" -#: ../../library/asyncio-eventloop.rst:551 +#: ../../library/asyncio-eventloop.rst:553 msgid "" "*sock* can optionally be specified in order to use a preexisting, already " "connected, :class:`socket.socket` object to be used by the transport. If " @@ -753,107 +753,107 @@ msgid "" "`None`)." msgstr "" -#: ../../library/asyncio-eventloop.rst:556 +#: ../../library/asyncio-eventloop.rst:558 msgid "" "See :ref:`UDP echo client protocol ` and :" "ref:`UDP echo server protocol ` examples." msgstr "" -#: ../../library/asyncio-eventloop.rst:559 +#: ../../library/asyncio-eventloop.rst:561 msgid "" "The *family*, *proto*, *flags*, *reuse_address*, *reuse_port, " "*allow_broadcast*, and *sock* parameters were added." msgstr "" -#: ../../library/asyncio-eventloop.rst:563 +#: ../../library/asyncio-eventloop.rst:565 msgid "" "The *reuse_address* parameter is no longer supported due to security " "concerns." msgstr "" -#: ../../library/asyncio-eventloop.rst:567 +#: ../../library/asyncio-eventloop.rst:569 msgid "Added support for Windows." msgstr "新增對於 Windows 的支援。" -#: ../../library/asyncio-eventloop.rst:574 +#: ../../library/asyncio-eventloop.rst:576 msgid "Create a Unix connection." msgstr "" -#: ../../library/asyncio-eventloop.rst:576 +#: ../../library/asyncio-eventloop.rst:578 msgid "" "The socket family will be :py:data:`~socket.AF_UNIX`; socket type will be :" "py:data:`~socket.SOCK_STREAM`." msgstr "" -#: ../../library/asyncio-eventloop.rst:581 +#: ../../library/asyncio-eventloop.rst:583 msgid "" "*path* is the name of a Unix domain socket and is required, unless a *sock* " "parameter is specified. Abstract Unix sockets, :class:`str`, :class:" "`bytes`, and :class:`~pathlib.Path` paths are supported." msgstr "" -#: ../../library/asyncio-eventloop.rst:586 +#: ../../library/asyncio-eventloop.rst:588 msgid "" "See the documentation of the :meth:`loop.create_connection` method for " "information about arguments to this method." msgstr "" -#: ../../library/asyncio-eventloop.rst:590 -#: ../../library/asyncio-eventloop.rst:708 -#: ../../library/asyncio-eventloop.rst:1061 +#: ../../library/asyncio-eventloop.rst:592 +#: ../../library/asyncio-eventloop.rst:710 +#: ../../library/asyncio-eventloop.rst:1063 msgid ":ref:`Availability `: Unix." msgstr ":ref:`適用 `:Unix。" -#: ../../library/asyncio-eventloop.rst:591 +#: ../../library/asyncio-eventloop.rst:593 msgid "" "Added the *ssl_handshake_timeout* parameter. The *path* parameter can now be " "a :term:`path-like object`." msgstr "" -#: ../../library/asyncio-eventloop.rst:597 +#: ../../library/asyncio-eventloop.rst:599 msgid "Creating network servers" msgstr "" -#: ../../library/asyncio-eventloop.rst:607 +#: ../../library/asyncio-eventloop.rst:609 msgid "" "Create a TCP server (socket type :data:`~socket.SOCK_STREAM`) listening on " "*port* of the *host* address." msgstr "" -#: ../../library/asyncio-eventloop.rst:610 +#: ../../library/asyncio-eventloop.rst:612 msgid "Returns a :class:`Server` object." msgstr "" -#: ../../library/asyncio-eventloop.rst:612 +#: ../../library/asyncio-eventloop.rst:614 msgid "Arguments:" msgstr "引數:" -#: ../../library/asyncio-eventloop.rst:617 +#: ../../library/asyncio-eventloop.rst:619 msgid "" "The *host* parameter can be set to several types which determine where the " "server would be listening:" msgstr "" -#: ../../library/asyncio-eventloop.rst:620 +#: ../../library/asyncio-eventloop.rst:622 msgid "" "If *host* is a string, the TCP server is bound to a single network interface " "specified by *host*." msgstr "" -#: ../../library/asyncio-eventloop.rst:623 +#: ../../library/asyncio-eventloop.rst:625 msgid "" "If *host* is a sequence of strings, the TCP server is bound to all network " "interfaces specified by the sequence." msgstr "" -#: ../../library/asyncio-eventloop.rst:626 +#: ../../library/asyncio-eventloop.rst:628 msgid "" "If *host* is an empty string or ``None``, all interfaces are assumed and a " "list of multiple sockets will be returned (most likely one for IPv4 and " "another one for IPv6)." msgstr "" -#: ../../library/asyncio-eventloop.rst:630 +#: ../../library/asyncio-eventloop.rst:632 msgid "" "The *port* parameter can be set to specify which port the server should " "listen on. If ``0`` or ``None`` (the default), a random unused port will be " @@ -861,57 +861,57 @@ msgid "" "different random port will be selected for each interface)." msgstr "" -#: ../../library/asyncio-eventloop.rst:635 +#: ../../library/asyncio-eventloop.rst:637 msgid "" "*family* can be set to either :data:`socket.AF_INET` or :data:`~socket." "AF_INET6` to force the socket to use IPv4 or IPv6. If not set, the *family* " "will be determined from host name (defaults to :data:`~socket.AF_UNSPEC`)." msgstr "" -#: ../../library/asyncio-eventloop.rst:640 +#: ../../library/asyncio-eventloop.rst:642 msgid "*flags* is a bitmask for :meth:`getaddrinfo`." msgstr "" -#: ../../library/asyncio-eventloop.rst:642 +#: ../../library/asyncio-eventloop.rst:644 msgid "" "*sock* can optionally be specified in order to use a preexisting socket " "object. If specified, *host* and *port* must not be specified." msgstr "" -#: ../../library/asyncio-eventloop.rst:645 +#: ../../library/asyncio-eventloop.rst:647 msgid "" "*backlog* is the maximum number of queued connections passed to :meth:" "`~socket.socket.listen` (defaults to 100)." msgstr "" -#: ../../library/asyncio-eventloop.rst:648 +#: ../../library/asyncio-eventloop.rst:650 msgid "" "*ssl* can be set to an :class:`~ssl.SSLContext` instance to enable TLS over " "the accepted connections." msgstr "" -#: ../../library/asyncio-eventloop.rst:651 +#: ../../library/asyncio-eventloop.rst:653 msgid "" "*reuse_address* tells the kernel to reuse a local socket in ``TIME_WAIT`` " "state, without waiting for its natural timeout to expire. If not specified " "will automatically be set to ``True`` on Unix." msgstr "" -#: ../../library/asyncio-eventloop.rst:656 +#: ../../library/asyncio-eventloop.rst:658 msgid "" "*reuse_port* tells the kernel to allow this endpoint to be bound to the same " "port as other existing endpoints are bound to, so long as they all set this " "flag when being created. This option is not supported on Windows." msgstr "" -#: ../../library/asyncio-eventloop.rst:661 +#: ../../library/asyncio-eventloop.rst:663 msgid "" "*ssl_handshake_timeout* is (for a TLS server) the time in seconds to wait " "for the TLS handshake to complete before aborting the connection. ``60.0`` " "seconds if ``None`` (default)." msgstr "" -#: ../../library/asyncio-eventloop.rst:665 +#: ../../library/asyncio-eventloop.rst:667 msgid "" "*start_serving* set to ``True`` (the default) causes the created server to " "start accepting connections immediately. When set to ``False``, the user " @@ -919,44 +919,44 @@ msgid "" "to make the server to start accepting connections." msgstr "" -#: ../../library/asyncio-eventloop.rst:677 +#: ../../library/asyncio-eventloop.rst:679 msgid "The *host* parameter can be a sequence of strings." msgstr "" -#: ../../library/asyncio-eventloop.rst:681 +#: ../../library/asyncio-eventloop.rst:683 msgid "" "Added *ssl_handshake_timeout* and *start_serving* parameters. The socket " "option :py:data:`~socket.TCP_NODELAY` is set by default for all TCP " "connections." msgstr "" -#: ../../library/asyncio-eventloop.rst:687 +#: ../../library/asyncio-eventloop.rst:689 msgid "" "The :func:`start_server` function is a higher-level alternative API that " "returns a pair of :class:`StreamReader` and :class:`StreamWriter` that can " "be used in an async/await code." msgstr "" -#: ../../library/asyncio-eventloop.rst:696 +#: ../../library/asyncio-eventloop.rst:698 msgid "" "Similar to :meth:`loop.create_server` but works with the :py:data:`~socket." "AF_UNIX` socket family." msgstr "" -#: ../../library/asyncio-eventloop.rst:699 +#: ../../library/asyncio-eventloop.rst:701 msgid "" "*path* is the name of a Unix domain socket, and is required, unless a *sock* " "argument is provided. Abstract Unix sockets, :class:`str`, :class:`bytes`, " "and :class:`~pathlib.Path` paths are supported." msgstr "" -#: ../../library/asyncio-eventloop.rst:704 +#: ../../library/asyncio-eventloop.rst:706 msgid "" "See the documentation of the :meth:`loop.create_server` method for " "information about arguments to this method." msgstr "" -#: ../../library/asyncio-eventloop.rst:711 +#: ../../library/asyncio-eventloop.rst:713 msgid "" "Added the *ssl_handshake_timeout* and *start_serving* parameters. The *path* " "parameter can now be a :class:`~pathlib.Path` object." @@ -964,63 +964,63 @@ msgstr "" "新增 *ssl_handshake_timeout* 與 *start_serving* 參數。\\ *path* 參數現在可為" "一個 :class:`~pathlib.Path` 物件。" -#: ../../library/asyncio-eventloop.rst:717 +#: ../../library/asyncio-eventloop.rst:719 msgid "Wrap an already accepted connection into a transport/protocol pair." msgstr "" -#: ../../library/asyncio-eventloop.rst:719 +#: ../../library/asyncio-eventloop.rst:721 msgid "" "This method can be used by servers that accept connections outside of " "asyncio but that use asyncio to handle them." msgstr "" -#: ../../library/asyncio-eventloop.rst:722 -#: ../../library/asyncio-eventloop.rst:789 +#: ../../library/asyncio-eventloop.rst:724 +#: ../../library/asyncio-eventloop.rst:791 msgid "Parameters:" msgstr "參數:" -#: ../../library/asyncio-eventloop.rst:727 +#: ../../library/asyncio-eventloop.rst:729 msgid "" "*sock* is a preexisting socket object returned from :meth:`socket.accept " "`." msgstr "" -#: ../../library/asyncio-eventloop.rst:730 +#: ../../library/asyncio-eventloop.rst:732 msgid "" "*ssl* can be set to an :class:`~ssl.SSLContext` to enable SSL over the " "accepted connections." msgstr "" -#: ../../library/asyncio-eventloop.rst:733 +#: ../../library/asyncio-eventloop.rst:735 msgid "" "*ssl_handshake_timeout* is (for an SSL connection) the time in seconds to " "wait for the SSL handshake to complete before aborting the connection. " "``60.0`` seconds if ``None`` (default)." msgstr "" -#: ../../library/asyncio-eventloop.rst:737 +#: ../../library/asyncio-eventloop.rst:739 msgid "Returns a ``(transport, protocol)`` pair." msgstr "" -#: ../../library/asyncio-eventloop.rst:747 +#: ../../library/asyncio-eventloop.rst:749 msgid "Transferring files" msgstr "" -#: ../../library/asyncio-eventloop.rst:752 +#: ../../library/asyncio-eventloop.rst:754 msgid "" "Send a *file* over a *transport*. Return the total number of bytes sent." msgstr "" -#: ../../library/asyncio-eventloop.rst:755 +#: ../../library/asyncio-eventloop.rst:757 msgid "The method uses high-performance :meth:`os.sendfile` if available." msgstr "" -#: ../../library/asyncio-eventloop.rst:757 +#: ../../library/asyncio-eventloop.rst:759 msgid "*file* must be a regular file object opened in binary mode." msgstr "" -#: ../../library/asyncio-eventloop.rst:759 -#: ../../library/asyncio-eventloop.rst:949 +#: ../../library/asyncio-eventloop.rst:761 +#: ../../library/asyncio-eventloop.rst:951 msgid "" "*offset* tells from where to start reading the file. If specified, *count* " "is the total number of bytes to transmit as opposed to sending the file " @@ -1029,98 +1029,98 @@ msgid "" "obtain the actual number of bytes sent." msgstr "" -#: ../../library/asyncio-eventloop.rst:766 +#: ../../library/asyncio-eventloop.rst:768 msgid "" "*fallback* set to ``True`` makes asyncio to manually read and send the file " "when the platform does not support the sendfile system call (e.g. Windows or " "SSL socket on Unix)." msgstr "" -#: ../../library/asyncio-eventloop.rst:770 +#: ../../library/asyncio-eventloop.rst:772 msgid "" "Raise :exc:`SendfileNotAvailableError` if the system does not support the " "*sendfile* syscall and *fallback* is ``False``." msgstr "" -#: ../../library/asyncio-eventloop.rst:777 +#: ../../library/asyncio-eventloop.rst:779 msgid "TLS Upgrade" msgstr "" -#: ../../library/asyncio-eventloop.rst:783 +#: ../../library/asyncio-eventloop.rst:785 msgid "Upgrade an existing transport-based connection to TLS." msgstr "" -#: ../../library/asyncio-eventloop.rst:785 +#: ../../library/asyncio-eventloop.rst:787 msgid "" "Return a new transport instance, that the *protocol* must start using " "immediately after the *await*. The *transport* instance passed to the " "*start_tls* method should never be used again." msgstr "" -#: ../../library/asyncio-eventloop.rst:791 +#: ../../library/asyncio-eventloop.rst:793 msgid "" "*transport* and *protocol* instances that methods like :meth:`~loop." "create_server` and :meth:`~loop.create_connection` return." msgstr "" -#: ../../library/asyncio-eventloop.rst:795 +#: ../../library/asyncio-eventloop.rst:797 msgid "*sslcontext*: a configured instance of :class:`~ssl.SSLContext`." msgstr "" -#: ../../library/asyncio-eventloop.rst:797 +#: ../../library/asyncio-eventloop.rst:799 msgid "" "*server_side* pass ``True`` when a server-side connection is being upgraded " "(like the one created by :meth:`~loop.create_server`)." msgstr "" -#: ../../library/asyncio-eventloop.rst:800 +#: ../../library/asyncio-eventloop.rst:802 msgid "" "*server_hostname*: sets or overrides the host name that the target server's " "certificate will be matched against." msgstr "" -#: ../../library/asyncio-eventloop.rst:811 +#: ../../library/asyncio-eventloop.rst:813 msgid "Watching file descriptors" msgstr "" -#: ../../library/asyncio-eventloop.rst:815 +#: ../../library/asyncio-eventloop.rst:817 msgid "" "Start monitoring the *fd* file descriptor for read availability and invoke " "*callback* with the specified arguments once *fd* is available for reading." msgstr "" -#: ../../library/asyncio-eventloop.rst:821 +#: ../../library/asyncio-eventloop.rst:823 msgid "Stop monitoring the *fd* file descriptor for read availability." msgstr "" -#: ../../library/asyncio-eventloop.rst:825 +#: ../../library/asyncio-eventloop.rst:827 msgid "" "Start monitoring the *fd* file descriptor for write availability and invoke " "*callback* with the specified arguments once *fd* is available for writing." msgstr "" -#: ../../library/asyncio-eventloop.rst:829 -#: ../../library/asyncio-eventloop.rst:1048 +#: ../../library/asyncio-eventloop.rst:831 +#: ../../library/asyncio-eventloop.rst:1050 msgid "" "Use :func:`functools.partial` :ref:`to pass keyword arguments ` to *callback*." msgstr "" -#: ../../library/asyncio-eventloop.rst:834 +#: ../../library/asyncio-eventloop.rst:836 msgid "Stop monitoring the *fd* file descriptor for write availability." msgstr "" -#: ../../library/asyncio-eventloop.rst:836 +#: ../../library/asyncio-eventloop.rst:838 msgid "" "See also :ref:`Platform Support ` section for some " "limitations of these methods." msgstr "" -#: ../../library/asyncio-eventloop.rst:841 +#: ../../library/asyncio-eventloop.rst:843 msgid "Working with socket objects directly" msgstr "" -#: ../../library/asyncio-eventloop.rst:843 +#: ../../library/asyncio-eventloop.rst:845 msgid "" "In general, protocol implementations that use transport-based APIs such as :" "meth:`loop.create_connection` and :meth:`loop.create_server` are faster than " @@ -1129,49 +1129,49 @@ msgid "" "socket` objects directly is more convenient." msgstr "" -#: ../../library/asyncio-eventloop.rst:852 +#: ../../library/asyncio-eventloop.rst:854 msgid "" "Receive up to *nbytes* from *sock*. Asynchronous version of :meth:`socket." "recv() `." msgstr "" -#: ../../library/asyncio-eventloop.rst:855 +#: ../../library/asyncio-eventloop.rst:857 msgid "Return the received data as a bytes object." msgstr "" -#: ../../library/asyncio-eventloop.rst:857 -#: ../../library/asyncio-eventloop.rst:871 -#: ../../library/asyncio-eventloop.rst:886 -#: ../../library/asyncio-eventloop.rst:899 -#: ../../library/asyncio-eventloop.rst:925 -#: ../../library/asyncio-eventloop.rst:963 +#: ../../library/asyncio-eventloop.rst:859 +#: ../../library/asyncio-eventloop.rst:873 +#: ../../library/asyncio-eventloop.rst:888 +#: ../../library/asyncio-eventloop.rst:901 +#: ../../library/asyncio-eventloop.rst:927 +#: ../../library/asyncio-eventloop.rst:965 msgid "*sock* must be a non-blocking socket." msgstr "" -#: ../../library/asyncio-eventloop.rst:859 +#: ../../library/asyncio-eventloop.rst:861 msgid "" "Even though this method was always documented as a coroutine method, " "releases before Python 3.7 returned a :class:`Future`. Since Python 3.7 this " "is an ``async def`` method." msgstr "" -#: ../../library/asyncio-eventloop.rst:866 +#: ../../library/asyncio-eventloop.rst:868 msgid "" "Receive data from *sock* into the *buf* buffer. Modeled after the blocking :" "meth:`socket.recv_into() ` method." msgstr "" -#: ../../library/asyncio-eventloop.rst:869 +#: ../../library/asyncio-eventloop.rst:871 msgid "Return the number of bytes written to the buffer." msgstr "" -#: ../../library/asyncio-eventloop.rst:877 +#: ../../library/asyncio-eventloop.rst:879 msgid "" "Send *data* to the *sock* socket. Asynchronous version of :meth:`socket." "sendall() `." msgstr "" -#: ../../library/asyncio-eventloop.rst:880 +#: ../../library/asyncio-eventloop.rst:882 msgid "" "This method continues to send to the socket until either all data in *data* " "has been sent or an error occurs. ``None`` is returned on success. On " @@ -1180,23 +1180,23 @@ msgid "" "the connection." msgstr "" -#: ../../library/asyncio-eventloop.rst:888 +#: ../../library/asyncio-eventloop.rst:890 msgid "" "Even though the method was always documented as a coroutine method, before " "Python 3.7 it returned an :class:`Future`. Since Python 3.7, this is an " "``async def`` method." msgstr "" -#: ../../library/asyncio-eventloop.rst:895 +#: ../../library/asyncio-eventloop.rst:897 msgid "Connect *sock* to a remote socket at *address*." msgstr "" -#: ../../library/asyncio-eventloop.rst:897 +#: ../../library/asyncio-eventloop.rst:899 msgid "" "Asynchronous version of :meth:`socket.connect() `." msgstr "" -#: ../../library/asyncio-eventloop.rst:901 +#: ../../library/asyncio-eventloop.rst:903 msgid "" "``address`` no longer needs to be resolved. ``sock_connect`` will try to " "check if the *address* is already resolved by calling :func:`socket." @@ -1204,19 +1204,19 @@ msgid "" "*address*." msgstr "" -#: ../../library/asyncio-eventloop.rst:910 +#: ../../library/asyncio-eventloop.rst:912 msgid "" ":meth:`loop.create_connection` and :func:`asyncio.open_connection() " "`." msgstr "" -#: ../../library/asyncio-eventloop.rst:916 +#: ../../library/asyncio-eventloop.rst:918 msgid "" "Accept a connection. Modeled after the blocking :meth:`socket.accept() " "` method." msgstr "" -#: ../../library/asyncio-eventloop.rst:919 +#: ../../library/asyncio-eventloop.rst:921 msgid "" "The socket must be bound to an address and listening for connections. The " "return value is a pair ``(conn, address)`` where *conn* is a *new* socket " @@ -1224,64 +1224,64 @@ msgid "" "the address bound to the socket on the other end of the connection." msgstr "" -#: ../../library/asyncio-eventloop.rst:927 +#: ../../library/asyncio-eventloop.rst:929 msgid "" "Even though the method was always documented as a coroutine method, before " "Python 3.7 it returned a :class:`Future`. Since Python 3.7, this is an " "``async def`` method." msgstr "" -#: ../../library/asyncio-eventloop.rst:934 +#: ../../library/asyncio-eventloop.rst:936 msgid ":meth:`loop.create_server` and :func:`start_server`." msgstr ":meth:`loop.create_server` 和 :func:`start_server`\\ 。" -#: ../../library/asyncio-eventloop.rst:939 +#: ../../library/asyncio-eventloop.rst:941 msgid "" "Send a file using high-performance :mod:`os.sendfile` if possible. Return " "the total number of bytes sent." msgstr "" -#: ../../library/asyncio-eventloop.rst:942 +#: ../../library/asyncio-eventloop.rst:944 msgid "" "Asynchronous version of :meth:`socket.sendfile() `." msgstr "" -#: ../../library/asyncio-eventloop.rst:944 +#: ../../library/asyncio-eventloop.rst:946 msgid "" "*sock* must be a non-blocking :const:`socket.SOCK_STREAM` :class:`~socket." "socket`." msgstr "" -#: ../../library/asyncio-eventloop.rst:947 +#: ../../library/asyncio-eventloop.rst:949 msgid "*file* must be a regular file object open in binary mode." msgstr "" -#: ../../library/asyncio-eventloop.rst:956 +#: ../../library/asyncio-eventloop.rst:958 msgid "" "*fallback*, when set to ``True``, makes asyncio manually read and send the " "file when the platform does not support the sendfile syscall (e.g. Windows " "or SSL socket on Unix)." msgstr "" -#: ../../library/asyncio-eventloop.rst:960 +#: ../../library/asyncio-eventloop.rst:962 msgid "" "Raise :exc:`SendfileNotAvailableError` if the system does not support " "*sendfile* syscall and *fallback* is ``False``." msgstr "" -#: ../../library/asyncio-eventloop.rst:969 +#: ../../library/asyncio-eventloop.rst:971 msgid "DNS" msgstr "DNS" -#: ../../library/asyncio-eventloop.rst:974 +#: ../../library/asyncio-eventloop.rst:976 msgid "Asynchronous version of :meth:`socket.getaddrinfo`." msgstr "" -#: ../../library/asyncio-eventloop.rst:978 +#: ../../library/asyncio-eventloop.rst:980 msgid "Asynchronous version of :meth:`socket.getnameinfo`." msgstr "" -#: ../../library/asyncio-eventloop.rst:980 +#: ../../library/asyncio-eventloop.rst:982 msgid "" "Both *getaddrinfo* and *getnameinfo* methods were always documented to " "return a coroutine, but prior to Python 3.7 they were, in fact, returning :" @@ -1289,67 +1289,67 @@ msgid "" "coroutines." msgstr "" -#: ../../library/asyncio-eventloop.rst:988 +#: ../../library/asyncio-eventloop.rst:990 msgid "Working with pipes" msgstr "" -#: ../../library/asyncio-eventloop.rst:992 +#: ../../library/asyncio-eventloop.rst:994 msgid "Register the read end of *pipe* in the event loop." msgstr "" -#: ../../library/asyncio-eventloop.rst:997 +#: ../../library/asyncio-eventloop.rst:999 msgid "*pipe* is a :term:`file-like object `." msgstr "" -#: ../../library/asyncio-eventloop.rst:999 +#: ../../library/asyncio-eventloop.rst:1001 msgid "" "Return pair ``(transport, protocol)``, where *transport* supports the :class:" "`ReadTransport` interface and *protocol* is an object instantiated by the " "*protocol_factory*." msgstr "" -#: ../../library/asyncio-eventloop.rst:1003 -#: ../../library/asyncio-eventloop.rst:1019 +#: ../../library/asyncio-eventloop.rst:1005 +#: ../../library/asyncio-eventloop.rst:1021 msgid "" "With :class:`SelectorEventLoop` event loop, the *pipe* is set to non-" "blocking mode." msgstr "" -#: ../../library/asyncio-eventloop.rst:1008 +#: ../../library/asyncio-eventloop.rst:1010 msgid "Register the write end of *pipe* in the event loop." msgstr "" -#: ../../library/asyncio-eventloop.rst:1013 +#: ../../library/asyncio-eventloop.rst:1015 msgid "*pipe* is :term:`file-like object `." msgstr "" -#: ../../library/asyncio-eventloop.rst:1015 +#: ../../library/asyncio-eventloop.rst:1017 msgid "" "Return pair ``(transport, protocol)``, where *transport* supports :class:" "`WriteTransport` interface and *protocol* is an object instantiated by the " "*protocol_factory*." msgstr "" -#: ../../library/asyncio-eventloop.rst:1024 +#: ../../library/asyncio-eventloop.rst:1026 msgid "" ":class:`SelectorEventLoop` does not support the above methods on Windows. " "Use :class:`ProactorEventLoop` instead for Windows." msgstr "" -#: ../../library/asyncio-eventloop.rst:1029 +#: ../../library/asyncio-eventloop.rst:1031 msgid "" "The :meth:`loop.subprocess_exec` and :meth:`loop.subprocess_shell` methods." msgstr "" -#: ../../library/asyncio-eventloop.rst:1034 +#: ../../library/asyncio-eventloop.rst:1036 msgid "Unix signals" msgstr "" -#: ../../library/asyncio-eventloop.rst:1038 +#: ../../library/asyncio-eventloop.rst:1040 msgid "Set *callback* as the handler for the *signum* signal." msgstr "" -#: ../../library/asyncio-eventloop.rst:1040 +#: ../../library/asyncio-eventloop.rst:1042 msgid "" "The callback will be invoked by *loop*, along with other queued callbacks " "and runnable coroutines of that event loop. Unlike signal handlers " @@ -1357,56 +1357,56 @@ msgid "" "function is allowed to interact with the event loop." msgstr "" -#: ../../library/asyncio-eventloop.rst:1045 +#: ../../library/asyncio-eventloop.rst:1047 msgid "" "Raise :exc:`ValueError` if the signal number is invalid or uncatchable. " "Raise :exc:`RuntimeError` if there is a problem setting up the handler." msgstr "" -#: ../../library/asyncio-eventloop.rst:1051 +#: ../../library/asyncio-eventloop.rst:1053 msgid "" "Like :func:`signal.signal`, this function must be invoked in the main thread." msgstr "" -#: ../../library/asyncio-eventloop.rst:1056 +#: ../../library/asyncio-eventloop.rst:1058 msgid "Remove the handler for the *sig* signal." msgstr "" -#: ../../library/asyncio-eventloop.rst:1058 +#: ../../library/asyncio-eventloop.rst:1060 msgid "" "Return ``True`` if the signal handler was removed, or ``False`` if no " "handler was set for the given signal." msgstr "" -#: ../../library/asyncio-eventloop.rst:1065 +#: ../../library/asyncio-eventloop.rst:1067 msgid "The :mod:`signal` module." msgstr "" -#: ../../library/asyncio-eventloop.rst:1069 +#: ../../library/asyncio-eventloop.rst:1071 msgid "Executing code in thread or process pools" msgstr "" -#: ../../library/asyncio-eventloop.rst:1073 +#: ../../library/asyncio-eventloop.rst:1075 msgid "Arrange for *func* to be called in the specified executor." msgstr "" -#: ../../library/asyncio-eventloop.rst:1075 +#: ../../library/asyncio-eventloop.rst:1077 msgid "" "The *executor* argument should be an :class:`concurrent.futures.Executor` " "instance. The default executor is used if *executor* is ``None``." msgstr "" -#: ../../library/asyncio-eventloop.rst:1119 +#: ../../library/asyncio-eventloop.rst:1121 msgid "This method returns a :class:`asyncio.Future` object." msgstr "" -#: ../../library/asyncio-eventloop.rst:1121 +#: ../../library/asyncio-eventloop.rst:1123 msgid "" "Use :func:`functools.partial` :ref:`to pass keyword arguments ` to *func*." msgstr "" -#: ../../library/asyncio-eventloop.rst:1124 +#: ../../library/asyncio-eventloop.rst:1126 msgid "" ":meth:`loop.run_in_executor` no longer configures the ``max_workers`` of the " "thread pool executor it creates, instead leaving it up to the thread pool " @@ -1414,38 +1414,38 @@ msgid "" "default." msgstr "" -#: ../../library/asyncio-eventloop.rst:1133 +#: ../../library/asyncio-eventloop.rst:1135 msgid "" "Set *executor* as the default executor used by :meth:`run_in_executor`. " "*executor* should be an instance of :class:`~concurrent.futures." "ThreadPoolExecutor`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1137 +#: ../../library/asyncio-eventloop.rst:1139 msgid "" "Using an executor that is not an instance of :class:`~concurrent.futures." "ThreadPoolExecutor` is deprecated and will trigger an error in Python 3.9." msgstr "" -#: ../../library/asyncio-eventloop.rst:1142 +#: ../../library/asyncio-eventloop.rst:1144 msgid "" "*executor* must be an instance of :class:`concurrent.futures." "ThreadPoolExecutor`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1147 +#: ../../library/asyncio-eventloop.rst:1149 msgid "Error Handling API" msgstr "" -#: ../../library/asyncio-eventloop.rst:1149 +#: ../../library/asyncio-eventloop.rst:1151 msgid "Allows customizing how exceptions are handled in the event loop." msgstr "" -#: ../../library/asyncio-eventloop.rst:1153 +#: ../../library/asyncio-eventloop.rst:1155 msgid "Set *handler* as the new event loop exception handler." msgstr "" -#: ../../library/asyncio-eventloop.rst:1155 +#: ../../library/asyncio-eventloop.rst:1157 msgid "" "If *handler* is ``None``, the default exception handler will be set. " "Otherwise, *handler* must be a callable with the signature matching ``(loop, " @@ -1454,158 +1454,158 @@ msgid "" "(see :meth:`call_exception_handler` documentation for details about context)." msgstr "" -#: ../../library/asyncio-eventloop.rst:1165 +#: ../../library/asyncio-eventloop.rst:1167 msgid "" "Return the current exception handler, or ``None`` if no custom exception " "handler was set." msgstr "" -#: ../../library/asyncio-eventloop.rst:1172 +#: ../../library/asyncio-eventloop.rst:1174 msgid "Default exception handler." msgstr "" -#: ../../library/asyncio-eventloop.rst:1174 +#: ../../library/asyncio-eventloop.rst:1176 msgid "" "This is called when an exception occurs and no exception handler is set. " "This can be called by a custom exception handler that wants to defer to the " "default handler behavior." msgstr "" -#: ../../library/asyncio-eventloop.rst:1178 +#: ../../library/asyncio-eventloop.rst:1180 msgid "" "*context* parameter has the same meaning as in :meth:" "`call_exception_handler`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1183 +#: ../../library/asyncio-eventloop.rst:1185 msgid "Call the current event loop exception handler." msgstr "" -#: ../../library/asyncio-eventloop.rst:1185 +#: ../../library/asyncio-eventloop.rst:1187 msgid "" "*context* is a ``dict`` object containing the following keys (new keys may " "be introduced in future Python versions):" msgstr "" -#: ../../library/asyncio-eventloop.rst:1188 +#: ../../library/asyncio-eventloop.rst:1190 msgid "'message': Error message;" msgstr "" -#: ../../library/asyncio-eventloop.rst:1189 +#: ../../library/asyncio-eventloop.rst:1191 msgid "'exception' (optional): Exception object;" msgstr "" -#: ../../library/asyncio-eventloop.rst:1190 +#: ../../library/asyncio-eventloop.rst:1192 msgid "'future' (optional): :class:`asyncio.Future` instance;" msgstr "" -#: ../../library/asyncio-eventloop.rst:1191 +#: ../../library/asyncio-eventloop.rst:1193 msgid "'task' (optional): :class:`asyncio.Task` instance;" msgstr "" -#: ../../library/asyncio-eventloop.rst:1192 +#: ../../library/asyncio-eventloop.rst:1194 msgid "'handle' (optional): :class:`asyncio.Handle` instance;" msgstr "" -#: ../../library/asyncio-eventloop.rst:1193 +#: ../../library/asyncio-eventloop.rst:1195 msgid "'protocol' (optional): :ref:`Protocol ` instance;" msgstr "" -#: ../../library/asyncio-eventloop.rst:1194 +#: ../../library/asyncio-eventloop.rst:1196 msgid "'transport' (optional): :ref:`Transport ` instance;" msgstr "" -#: ../../library/asyncio-eventloop.rst:1195 +#: ../../library/asyncio-eventloop.rst:1197 msgid "'socket' (optional): :class:`socket.socket` instance;" msgstr "" -#: ../../library/asyncio-eventloop.rst:1197 +#: ../../library/asyncio-eventloop.rst:1199 msgid "'asyncgen' (optional): Asynchronous generator that caused" msgstr "" -#: ../../library/asyncio-eventloop.rst:1197 +#: ../../library/asyncio-eventloop.rst:1199 msgid "the exception." msgstr "" -#: ../../library/asyncio-eventloop.rst:1201 +#: ../../library/asyncio-eventloop.rst:1203 msgid "" "This method should not be overloaded in subclassed event loops. For custom " "exception handling, use the :meth:`set_exception_handler()` method." msgstr "" -#: ../../library/asyncio-eventloop.rst:1206 +#: ../../library/asyncio-eventloop.rst:1208 msgid "Enabling debug mode" msgstr "" -#: ../../library/asyncio-eventloop.rst:1210 +#: ../../library/asyncio-eventloop.rst:1212 msgid "Get the debug mode (:class:`bool`) of the event loop." msgstr "" -#: ../../library/asyncio-eventloop.rst:1212 +#: ../../library/asyncio-eventloop.rst:1214 msgid "" "The default value is ``True`` if the environment variable :envvar:" "`PYTHONASYNCIODEBUG` is set to a non-empty string, ``False`` otherwise." msgstr "" -#: ../../library/asyncio-eventloop.rst:1218 +#: ../../library/asyncio-eventloop.rst:1220 msgid "Set the debug mode of the event loop." msgstr "" -#: ../../library/asyncio-eventloop.rst:1222 +#: ../../library/asyncio-eventloop.rst:1224 msgid "" "The new :ref:`Python Development Mode ` can now also be used to " "enable the debug mode." msgstr "" -#: ../../library/asyncio-eventloop.rst:1227 +#: ../../library/asyncio-eventloop.rst:1229 msgid "The :ref:`debug mode of asyncio `." msgstr "" -#: ../../library/asyncio-eventloop.rst:1231 +#: ../../library/asyncio-eventloop.rst:1233 msgid "Running Subprocesses" msgstr "" -#: ../../library/asyncio-eventloop.rst:1233 +#: ../../library/asyncio-eventloop.rst:1235 msgid "" "Methods described in this subsections are low-level. In regular async/await " "code consider using the high-level :func:`asyncio.create_subprocess_shell` " "and :func:`asyncio.create_subprocess_exec` convenience functions instead." msgstr "" -#: ../../library/asyncio-eventloop.rst:1240 +#: ../../library/asyncio-eventloop.rst:1242 msgid "" "On Windows, the default event loop :class:`ProactorEventLoop` supports " "subprocesses, whereas :class:`SelectorEventLoop` does not. See :ref:" "`Subprocess Support on Windows ` for details." msgstr "" -#: ../../library/asyncio-eventloop.rst:1249 +#: ../../library/asyncio-eventloop.rst:1251 msgid "" "Create a subprocess from one or more string arguments specified by *args*." msgstr "" -#: ../../library/asyncio-eventloop.rst:1252 +#: ../../library/asyncio-eventloop.rst:1254 msgid "*args* must be a list of strings represented by:" msgstr "" -#: ../../library/asyncio-eventloop.rst:1254 +#: ../../library/asyncio-eventloop.rst:1256 msgid ":class:`str`;" msgstr ":class:`str`\\ ;" -#: ../../library/asyncio-eventloop.rst:1255 +#: ../../library/asyncio-eventloop.rst:1257 msgid "" "or :class:`bytes`, encoded to the :ref:`filesystem encoding `." msgstr "" -#: ../../library/asyncio-eventloop.rst:1258 +#: ../../library/asyncio-eventloop.rst:1260 msgid "" "The first string specifies the program executable, and the remaining strings " "specify the arguments. Together, string arguments form the ``argv`` of the " "program." msgstr "" -#: ../../library/asyncio-eventloop.rst:1262 +#: ../../library/asyncio-eventloop.rst:1264 msgid "" "This is similar to the standard library :class:`subprocess.Popen` class " "called with ``shell=False`` and the list of strings passed as the first " @@ -1613,136 +1613,136 @@ msgid "" "which is list of strings, *subprocess_exec* takes multiple string arguments." msgstr "" -#: ../../library/asyncio-eventloop.rst:1268 +#: ../../library/asyncio-eventloop.rst:1270 msgid "" "The *protocol_factory* must be a callable returning a subclass of the :class:" "`asyncio.SubprocessProtocol` class." msgstr "" -#: ../../library/asyncio-eventloop.rst:1271 +#: ../../library/asyncio-eventloop.rst:1273 msgid "Other parameters:" msgstr "其他參數:" -#: ../../library/asyncio-eventloop.rst:1273 +#: ../../library/asyncio-eventloop.rst:1275 msgid "*stdin* can be any of these:" msgstr "" -#: ../../library/asyncio-eventloop.rst:1275 +#: ../../library/asyncio-eventloop.rst:1277 msgid "" "a file-like object representing a pipe to be connected to the subprocess's " "standard input stream using :meth:`~loop.connect_write_pipe`" msgstr "" -#: ../../library/asyncio-eventloop.rst:1278 -#: ../../library/asyncio-eventloop.rst:1290 -#: ../../library/asyncio-eventloop.rst:1302 +#: ../../library/asyncio-eventloop.rst:1280 +#: ../../library/asyncio-eventloop.rst:1292 +#: ../../library/asyncio-eventloop.rst:1304 msgid "" "the :const:`subprocess.PIPE` constant (default) which will create a new pipe " "and connect it," msgstr "" -#: ../../library/asyncio-eventloop.rst:1280 -#: ../../library/asyncio-eventloop.rst:1292 -#: ../../library/asyncio-eventloop.rst:1304 +#: ../../library/asyncio-eventloop.rst:1282 +#: ../../library/asyncio-eventloop.rst:1294 +#: ../../library/asyncio-eventloop.rst:1306 msgid "" "the value ``None`` which will make the subprocess inherit the file " "descriptor from this process" msgstr "" -#: ../../library/asyncio-eventloop.rst:1282 -#: ../../library/asyncio-eventloop.rst:1294 -#: ../../library/asyncio-eventloop.rst:1306 +#: ../../library/asyncio-eventloop.rst:1284 +#: ../../library/asyncio-eventloop.rst:1296 +#: ../../library/asyncio-eventloop.rst:1308 msgid "" "the :const:`subprocess.DEVNULL` constant which indicates that the special :" "data:`os.devnull` file will be used" msgstr "" -#: ../../library/asyncio-eventloop.rst:1285 +#: ../../library/asyncio-eventloop.rst:1287 msgid "*stdout* can be any of these:" msgstr "" -#: ../../library/asyncio-eventloop.rst:1287 +#: ../../library/asyncio-eventloop.rst:1289 msgid "" "a file-like object representing a pipe to be connected to the subprocess's " "standard output stream using :meth:`~loop.connect_write_pipe`" msgstr "" -#: ../../library/asyncio-eventloop.rst:1297 +#: ../../library/asyncio-eventloop.rst:1299 msgid "*stderr* can be any of these:" msgstr "" -#: ../../library/asyncio-eventloop.rst:1299 +#: ../../library/asyncio-eventloop.rst:1301 msgid "" "a file-like object representing a pipe to be connected to the subprocess's " "standard error stream using :meth:`~loop.connect_write_pipe`" msgstr "" -#: ../../library/asyncio-eventloop.rst:1308 +#: ../../library/asyncio-eventloop.rst:1310 msgid "" "the :const:`subprocess.STDOUT` constant which will connect the standard " "error stream to the process' standard output stream" msgstr "" -#: ../../library/asyncio-eventloop.rst:1311 +#: ../../library/asyncio-eventloop.rst:1313 msgid "" "All other keyword arguments are passed to :class:`subprocess.Popen` without " "interpretation, except for *bufsize*, *universal_newlines*, *shell*, *text*, " "*encoding* and *errors*, which should not be specified at all." msgstr "" -#: ../../library/asyncio-eventloop.rst:1316 +#: ../../library/asyncio-eventloop.rst:1318 msgid "" "The ``asyncio`` subprocess API does not support decoding the streams as " "text. :func:`bytes.decode` can be used to convert the bytes returned from " "the stream to text." msgstr "" -#: ../../library/asyncio-eventloop.rst:1320 +#: ../../library/asyncio-eventloop.rst:1322 msgid "" "See the constructor of the :class:`subprocess.Popen` class for documentation " "on other arguments." msgstr "" -#: ../../library/asyncio-eventloop.rst:1323 +#: ../../library/asyncio-eventloop.rst:1325 msgid "" "Returns a pair of ``(transport, protocol)``, where *transport* conforms to " "the :class:`asyncio.SubprocessTransport` base class and *protocol* is an " "object instantiated by the *protocol_factory*." msgstr "" -#: ../../library/asyncio-eventloop.rst:1331 +#: ../../library/asyncio-eventloop.rst:1333 msgid "" "Create a subprocess from *cmd*, which can be a :class:`str` or a :class:" "`bytes` string encoded to the :ref:`filesystem encoding `, using the platform's \"shell\" syntax." msgstr "" -#: ../../library/asyncio-eventloop.rst:1336 +#: ../../library/asyncio-eventloop.rst:1338 msgid "" "This is similar to the standard library :class:`subprocess.Popen` class " "called with ``shell=True``." msgstr "" -#: ../../library/asyncio-eventloop.rst:1339 +#: ../../library/asyncio-eventloop.rst:1341 msgid "" "The *protocol_factory* must be a callable returning a subclass of the :class:" "`SubprocessProtocol` class." msgstr "" -#: ../../library/asyncio-eventloop.rst:1342 +#: ../../library/asyncio-eventloop.rst:1344 msgid "" "See :meth:`~loop.subprocess_exec` for more details about the remaining " "arguments." msgstr "" -#: ../../library/asyncio-eventloop.rst:1345 +#: ../../library/asyncio-eventloop.rst:1347 msgid "" "Returns a pair of ``(transport, protocol)``, where *transport* conforms to " "the :class:`SubprocessTransport` base class and *protocol* is an object " "instantiated by the *protocol_factory*." msgstr "" -#: ../../library/asyncio-eventloop.rst:1350 +#: ../../library/asyncio-eventloop.rst:1352 msgid "" "It is the application's responsibility to ensure that all whitespace and " "special characters are quoted appropriately to avoid `shell injection " @@ -1752,105 +1752,105 @@ msgid "" "used to construct shell commands." msgstr "" -#: ../../library/asyncio-eventloop.rst:1359 +#: ../../library/asyncio-eventloop.rst:1361 msgid "Callback Handles" msgstr "" -#: ../../library/asyncio-eventloop.rst:1363 +#: ../../library/asyncio-eventloop.rst:1365 msgid "" "A callback wrapper object returned by :meth:`loop.call_soon`, :meth:`loop." "call_soon_threadsafe`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1368 +#: ../../library/asyncio-eventloop.rst:1370 msgid "" "Cancel the callback. If the callback has already been canceled or executed, " "this method has no effect." msgstr "" -#: ../../library/asyncio-eventloop.rst:1373 +#: ../../library/asyncio-eventloop.rst:1375 msgid "Return ``True`` if the callback was cancelled." msgstr "" -#: ../../library/asyncio-eventloop.rst:1379 +#: ../../library/asyncio-eventloop.rst:1381 msgid "" "A callback wrapper object returned by :meth:`loop.call_later`, and :meth:" "`loop.call_at`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1382 +#: ../../library/asyncio-eventloop.rst:1384 msgid "This class is a subclass of :class:`Handle`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1386 +#: ../../library/asyncio-eventloop.rst:1388 msgid "Return a scheduled callback time as :class:`float` seconds." msgstr "" -#: ../../library/asyncio-eventloop.rst:1388 +#: ../../library/asyncio-eventloop.rst:1390 msgid "" "The time is an absolute timestamp, using the same time reference as :meth:" "`loop.time`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1395 +#: ../../library/asyncio-eventloop.rst:1397 msgid "Server Objects" msgstr "" -#: ../../library/asyncio-eventloop.rst:1397 +#: ../../library/asyncio-eventloop.rst:1399 msgid "" "Server objects are created by :meth:`loop.create_server`, :meth:`loop." "create_unix_server`, :func:`start_server`, and :func:`start_unix_server` " "functions." msgstr "" -#: ../../library/asyncio-eventloop.rst:1401 +#: ../../library/asyncio-eventloop.rst:1403 msgid "Do not instantiate the class directly." msgstr "" -#: ../../library/asyncio-eventloop.rst:1405 +#: ../../library/asyncio-eventloop.rst:1407 msgid "" "*Server* objects are asynchronous context managers. When used in an ``async " "with`` statement, it's guaranteed that the Server object is closed and not " "accepting new connections when the ``async with`` statement is completed::" msgstr "" -#: ../../library/asyncio-eventloop.rst:1418 +#: ../../library/asyncio-eventloop.rst:1420 msgid "Server object is an asynchronous context manager since Python 3.7." msgstr "" -#: ../../library/asyncio-eventloop.rst:1423 +#: ../../library/asyncio-eventloop.rst:1425 msgid "" "Stop serving: close listening sockets and set the :attr:`sockets` attribute " "to ``None``." msgstr "" -#: ../../library/asyncio-eventloop.rst:1426 +#: ../../library/asyncio-eventloop.rst:1428 msgid "" "The sockets that represent existing incoming client connections are left " "open." msgstr "" -#: ../../library/asyncio-eventloop.rst:1429 +#: ../../library/asyncio-eventloop.rst:1431 msgid "" "The server is closed asynchronously, use the :meth:`wait_closed` coroutine " "to wait until the server is closed." msgstr "" -#: ../../library/asyncio-eventloop.rst:1434 +#: ../../library/asyncio-eventloop.rst:1436 msgid "Return the event loop associated with the server object." msgstr "" -#: ../../library/asyncio-eventloop.rst:1440 +#: ../../library/asyncio-eventloop.rst:1442 msgid "Start accepting connections." msgstr "" -#: ../../library/asyncio-eventloop.rst:1442 +#: ../../library/asyncio-eventloop.rst:1444 msgid "" "This method is idempotent, so it can be called when the server is already " "being serving." msgstr "" -#: ../../library/asyncio-eventloop.rst:1445 +#: ../../library/asyncio-eventloop.rst:1447 msgid "" "The *start_serving* keyword-only parameter to :meth:`loop.create_server` " "and :meth:`asyncio.start_server` allows creating a Server object that is not " @@ -1859,97 +1859,96 @@ msgid "" "accepting connections." msgstr "" -#: ../../library/asyncio-eventloop.rst:1456 +#: ../../library/asyncio-eventloop.rst:1458 msgid "" "Start accepting connections until the coroutine is cancelled. Cancellation " "of ``serve_forever`` task causes the server to be closed." msgstr "" -#: ../../library/asyncio-eventloop.rst:1460 +#: ../../library/asyncio-eventloop.rst:1462 msgid "" "This method can be called if the server is already accepting connections. " "Only one ``serve_forever`` task can exist per one *Server* object." msgstr "" -#: ../../library/asyncio-eventloop.rst:1482 +#: ../../library/asyncio-eventloop.rst:1484 msgid "Return ``True`` if the server is accepting new connections." msgstr "" -#: ../../library/asyncio-eventloop.rst:1488 +#: ../../library/asyncio-eventloop.rst:1490 msgid "Wait until the :meth:`close` method completes." msgstr "" -#: ../../library/asyncio-eventloop.rst:1492 +#: ../../library/asyncio-eventloop.rst:1494 msgid "List of :class:`socket.socket` objects the server is listening on." msgstr "" -#: ../../library/asyncio-eventloop.rst:1494 +#: ../../library/asyncio-eventloop.rst:1496 msgid "" "Prior to Python 3.7 ``Server.sockets`` used to return an internal list of " "server sockets directly. In 3.7 a copy of that list is returned." msgstr "" -#: ../../library/asyncio-eventloop.rst:1503 +#: ../../library/asyncio-eventloop.rst:1506 msgid "Event Loop Implementations" msgstr "" -#: ../../library/asyncio-eventloop.rst:1505 +#: ../../library/asyncio-eventloop.rst:1508 msgid "" "asyncio ships with two different event loop implementations: :class:" "`SelectorEventLoop` and :class:`ProactorEventLoop`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1508 +#: ../../library/asyncio-eventloop.rst:1511 msgid "" "By default asyncio is configured to use :class:`SelectorEventLoop` on Unix " "and :class:`ProactorEventLoop` on Windows." msgstr "" -#: ../../library/asyncio-eventloop.rst:1514 +#: ../../library/asyncio-eventloop.rst:1517 msgid "An event loop based on the :mod:`selectors` module." msgstr "" -#: ../../library/asyncio-eventloop.rst:1516 +#: ../../library/asyncio-eventloop.rst:1519 msgid "" "Uses the most efficient *selector* available for the given platform. It is " "also possible to manually configure the exact selector implementation to be " "used::" msgstr "" -#: ../../library/asyncio-eventloop.rst:1528 +#: ../../library/asyncio-eventloop.rst:1531 msgid ":ref:`Availability `: Unix, Windows." msgstr ":ref:`適用 `:Unix、Windows。" -#: ../../library/asyncio-eventloop.rst:1533 +#: ../../library/asyncio-eventloop.rst:1536 msgid "An event loop for Windows that uses \"I/O Completion Ports\" (IOCP)." msgstr "" -#: ../../library/asyncio-eventloop.rst:1536 +#: ../../library/asyncio-eventloop.rst:1539 msgid ":ref:`Availability `: Windows." msgstr ":ref:`適用 `:Windows。" -#: ../../library/asyncio-eventloop.rst:1539 +#: ../../library/asyncio-eventloop.rst:1542 msgid "" "`MSDN documentation on I/O Completion Ports `_." msgstr "" -#: ../../library/asyncio-eventloop.rst:1545 +#: ../../library/asyncio-eventloop.rst:1548 msgid "Abstract base class for asyncio-compliant event loops." msgstr "" -#: ../../library/asyncio-eventloop.rst:1547 +#: ../../library/asyncio-eventloop.rst:1550 msgid "" -"The :ref:`Event Loop Methods ` section lists all methods " -"that an alternative implementation of ``AbstractEventLoop`` should have " -"defined." +"The :ref:`asyncio-event-loop-methods` section lists all methods that an " +"alternative implementation of ``AbstractEventLoop`` should have defined." msgstr "" -#: ../../library/asyncio-eventloop.rst:1553 +#: ../../library/asyncio-eventloop.rst:1556 msgid "Examples" msgstr "範例" -#: ../../library/asyncio-eventloop.rst:1555 +#: ../../library/asyncio-eventloop.rst:1558 msgid "" "Note that all examples in this section **purposefully** show how to use the " "low-level event loop APIs, such as :meth:`loop.run_forever` and :meth:`loop." @@ -1957,70 +1956,70 @@ msgid "" "consider using the high-level functions like :func:`asyncio.run`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1565 +#: ../../library/asyncio-eventloop.rst:1568 msgid "Hello World with call_soon()" msgstr "" -#: ../../library/asyncio-eventloop.rst:1567 +#: ../../library/asyncio-eventloop.rst:1570 msgid "" "An example using the :meth:`loop.call_soon` method to schedule a callback. " "The callback displays ``\"Hello World\"`` and then stops the event loop::" msgstr "" -#: ../../library/asyncio-eventloop.rst:1591 +#: ../../library/asyncio-eventloop.rst:1594 msgid "" "A similar :ref:`Hello World ` example created with a coroutine " "and the :func:`run` function." msgstr "" -#: ../../library/asyncio-eventloop.rst:1598 +#: ../../library/asyncio-eventloop.rst:1601 msgid "Display the current date with call_later()" msgstr "" -#: ../../library/asyncio-eventloop.rst:1600 +#: ../../library/asyncio-eventloop.rst:1603 msgid "" "An example of a callback displaying the current date every second. The " "callback uses the :meth:`loop.call_later` method to reschedule itself after " "5 seconds, and then stops the event loop::" msgstr "" -#: ../../library/asyncio-eventloop.rst:1628 +#: ../../library/asyncio-eventloop.rst:1631 msgid "" "A similar :ref:`current date ` example created with a " "coroutine and the :func:`run` function." msgstr "" -#: ../../library/asyncio-eventloop.rst:1635 +#: ../../library/asyncio-eventloop.rst:1638 msgid "Watch a file descriptor for read events" msgstr "" -#: ../../library/asyncio-eventloop.rst:1637 +#: ../../library/asyncio-eventloop.rst:1640 msgid "" "Wait until a file descriptor received some data using the :meth:`loop." "add_reader` method and then close the event loop::" msgstr "" -#: ../../library/asyncio-eventloop.rst:1675 +#: ../../library/asyncio-eventloop.rst:1678 msgid "" "A similar :ref:`example ` using " "transports, protocols, and the :meth:`loop.create_connection` method." msgstr "" -#: ../../library/asyncio-eventloop.rst:1679 +#: ../../library/asyncio-eventloop.rst:1682 msgid "" "Another similar :ref:`example ` " "using the high-level :func:`asyncio.open_connection` function and streams." msgstr "" -#: ../../library/asyncio-eventloop.rst:1687 +#: ../../library/asyncio-eventloop.rst:1690 msgid "Set signal handlers for SIGINT and SIGTERM" msgstr "" -#: ../../library/asyncio-eventloop.rst:1689 +#: ../../library/asyncio-eventloop.rst:1692 msgid "(This ``signals`` example only works on Unix.)" msgstr "" -#: ../../library/asyncio-eventloop.rst:1691 +#: ../../library/asyncio-eventloop.rst:1694 msgid "" "Register handlers for signals :py:data:`SIGINT` and :py:data:`SIGTERM` using " "the :meth:`loop.add_signal_handler` method::" diff --git a/library/asyncio-llapi-index.po b/library/asyncio-llapi-index.po index 80804499cb..44c31c3802 100644 --- a/library/asyncio-llapi-index.po +++ b/library/asyncio-llapi-index.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-06-17 00:14+0000\n" +"POT-Creation-Date: 2022-09-29 00:25+0000\n" "PO-Revision-Date: 2022-02-09 11:27+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -78,10 +78,10 @@ msgstr "事件迴圈方法" #: ../../library/asyncio-llapi-index.rst:39 msgid "" -"See also the main documentation section about the :ref:`event loop methods " -"`." +"See also the main documentation section about the :ref:`asyncio-event-loop-" +"methods`." msgstr "" -"也請查閱文件中關於\\ :ref:`事件迴圈方法 `\\ 的主要段落。" +"也請查閱文件中關於\\ :ref:`asyncio-event-loop-methods`\\ 的主要段落。" #: ../../library/asyncio-llapi-index.rst:42 msgid "Lifecycle" diff --git a/library/asyncio-policy.po b/library/asyncio-policy.po index d34b1048e0..556e1f129a 100644 --- a/library/asyncio-policy.po +++ b/library/asyncio-policy.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-13 00:11+0000\n" +"POT-Creation-Date: 2022-09-29 00:25+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-" @@ -24,158 +24,161 @@ msgstr "" #: ../../library/asyncio-policy.rst:10 msgid "" -"An event loop policy is a global per-process object that controls the " -"management of the event loop. Each event loop has a default policy, which " -"can be changed and customized using the policy API." +"An event loop policy is a global object used to get and set the current :ref:" +"`event loop `, as well as create new event loops. The " +"default policy can be :ref:`replaced ` with :ref:" +"`built-in alternatives ` to use different event loop " +"implementations, or substituted by a :ref:`custom policy ` that can override these behaviors." msgstr "" -#: ../../library/asyncio-policy.rst:14 +#: ../../library/asyncio-policy.rst:19 msgid "" -"A policy defines the notion of *context* and manages a separate event loop " -"per context. The default policy defines *context* to be the current thread." +"The :ref:`policy object ` gets and sets a separate " +"event loop per *context*. This is per-thread by default, though custom " +"policies could define *context* differently." msgstr "" -#: ../../library/asyncio-policy.rst:18 +#: ../../library/asyncio-policy.rst:24 msgid "" -"By using a custom event loop policy, the behavior of :func:" -"`get_event_loop`, :func:`set_event_loop`, and :func:`new_event_loop` " -"functions can be customized." +"Custom event loop policies can control the behavior of :func:" +"`get_event_loop`, :func:`set_event_loop`, and :func:`new_event_loop`." msgstr "" -#: ../../library/asyncio-policy.rst:22 +#: ../../library/asyncio-policy.rst:27 msgid "" "Policy objects should implement the APIs defined in the :class:" "`AbstractEventLoopPolicy` abstract base class." msgstr "" -#: ../../library/asyncio-policy.rst:27 +#: ../../library/asyncio-policy.rst:34 msgid "Getting and Setting the Policy" msgstr "" -#: ../../library/asyncio-policy.rst:29 +#: ../../library/asyncio-policy.rst:36 msgid "" "The following functions can be used to get and set the policy for the " "current process:" msgstr "" -#: ../../library/asyncio-policy.rst:34 +#: ../../library/asyncio-policy.rst:41 msgid "Return the current process-wide policy." msgstr "" -#: ../../library/asyncio-policy.rst:38 +#: ../../library/asyncio-policy.rst:45 msgid "Set the current process-wide policy to *policy*." msgstr "" -#: ../../library/asyncio-policy.rst:40 +#: ../../library/asyncio-policy.rst:47 msgid "If *policy* is set to ``None``, the default policy is restored." msgstr "" -#: ../../library/asyncio-policy.rst:44 +#: ../../library/asyncio-policy.rst:53 msgid "Policy Objects" msgstr "" -#: ../../library/asyncio-policy.rst:46 +#: ../../library/asyncio-policy.rst:55 msgid "The abstract event loop policy base class is defined as follows:" msgstr "" -#: ../../library/asyncio-policy.rst:50 +#: ../../library/asyncio-policy.rst:59 msgid "An abstract base class for asyncio policies." msgstr "" -#: ../../library/asyncio-policy.rst:54 +#: ../../library/asyncio-policy.rst:63 msgid "Get the event loop for the current context." msgstr "" -#: ../../library/asyncio-policy.rst:56 +#: ../../library/asyncio-policy.rst:65 msgid "" "Return an event loop object implementing the :class:`AbstractEventLoop` " "interface." msgstr "" -#: ../../library/asyncio-policy.rst:59 ../../library/asyncio-policy.rst:71 +#: ../../library/asyncio-policy.rst:68 ../../library/asyncio-policy.rst:80 msgid "This method should never return ``None``." msgstr "" -#: ../../library/asyncio-policy.rst:65 +#: ../../library/asyncio-policy.rst:74 msgid "Set the event loop for the current context to *loop*." msgstr "" -#: ../../library/asyncio-policy.rst:69 +#: ../../library/asyncio-policy.rst:78 msgid "Create and return a new event loop object." msgstr "" -#: ../../library/asyncio-policy.rst:75 +#: ../../library/asyncio-policy.rst:84 msgid "Get a child process watcher object." msgstr "" -#: ../../library/asyncio-policy.rst:77 +#: ../../library/asyncio-policy.rst:86 msgid "" "Return a watcher object implementing the :class:`AbstractChildWatcher` " "interface." msgstr "" -#: ../../library/asyncio-policy.rst:80 ../../library/asyncio-policy.rst:86 +#: ../../library/asyncio-policy.rst:89 ../../library/asyncio-policy.rst:95 msgid "This function is Unix specific." msgstr "" -#: ../../library/asyncio-policy.rst:84 +#: ../../library/asyncio-policy.rst:93 msgid "Set the current child process watcher to *watcher*." msgstr "" -#: ../../library/asyncio-policy.rst:89 +#: ../../library/asyncio-policy.rst:100 msgid "asyncio ships with the following built-in policies:" msgstr "" -#: ../../library/asyncio-policy.rst:94 +#: ../../library/asyncio-policy.rst:105 msgid "" "The default asyncio policy. Uses :class:`SelectorEventLoop` on Unix and :" "class:`ProactorEventLoop` on Windows." msgstr "" -#: ../../library/asyncio-policy.rst:97 +#: ../../library/asyncio-policy.rst:108 msgid "" "There is no need to install the default policy manually. asyncio is " "configured to use the default policy automatically." msgstr "" -#: ../../library/asyncio-policy.rst:102 +#: ../../library/asyncio-policy.rst:113 msgid "On Windows, :class:`ProactorEventLoop` is now used by default." msgstr "" -#: ../../library/asyncio-policy.rst:107 +#: ../../library/asyncio-policy.rst:118 msgid "" "An alternative event loop policy that uses the :class:`SelectorEventLoop` " "event loop implementation." msgstr "" -#: ../../library/asyncio-policy.rst:110 ../../library/asyncio-policy.rst:118 +#: ../../library/asyncio-policy.rst:121 ../../library/asyncio-policy.rst:129 msgid ":ref:`Availability `: Windows." msgstr ":ref:`適用 `:Windows。" -#: ../../library/asyncio-policy.rst:115 +#: ../../library/asyncio-policy.rst:126 msgid "" "An alternative event loop policy that uses the :class:`ProactorEventLoop` " "event loop implementation." msgstr "" -#: ../../library/asyncio-policy.rst:123 +#: ../../library/asyncio-policy.rst:135 msgid "Process Watchers" msgstr "" -#: ../../library/asyncio-policy.rst:125 +#: ../../library/asyncio-policy.rst:137 msgid "" "A process watcher allows customization of how an event loop monitors child " "processes on Unix. Specifically, the event loop needs to know when a child " "process has exited." msgstr "" -#: ../../library/asyncio-policy.rst:129 +#: ../../library/asyncio-policy.rst:141 msgid "" "In asyncio, child processes are created with :func:`create_subprocess_exec` " "and :meth:`loop.subprocess_exec` functions." msgstr "" -#: ../../library/asyncio-policy.rst:133 +#: ../../library/asyncio-policy.rst:145 msgid "" "asyncio defines the :class:`AbstractChildWatcher` abstract base class, which " "child watchers should implement, and has four different implementations: :" @@ -184,176 +187,176 @@ msgid "" "`FastChildWatcher`." msgstr "" -#: ../../library/asyncio-policy.rst:139 +#: ../../library/asyncio-policy.rst:151 msgid "" "See also the :ref:`Subprocess and Threads ` " "section." msgstr "" -#: ../../library/asyncio-policy.rst:142 +#: ../../library/asyncio-policy.rst:154 msgid "" "The following two functions can be used to customize the child process " "watcher implementation used by the asyncio event loop:" msgstr "" -#: ../../library/asyncio-policy.rst:147 +#: ../../library/asyncio-policy.rst:159 msgid "Return the current child watcher for the current policy." msgstr "" -#: ../../library/asyncio-policy.rst:151 +#: ../../library/asyncio-policy.rst:163 msgid "" "Set the current child watcher to *watcher* for the current policy. " "*watcher* must implement methods defined in the :class:" "`AbstractChildWatcher` base class." msgstr "" -#: ../../library/asyncio-policy.rst:156 +#: ../../library/asyncio-policy.rst:168 msgid "" "Third-party event loops implementations might not support custom child " "watchers. For such event loops, using :func:`set_child_watcher` might be " "prohibited or have no effect." msgstr "" -#: ../../library/asyncio-policy.rst:164 +#: ../../library/asyncio-policy.rst:176 msgid "Register a new child handler." msgstr "" -#: ../../library/asyncio-policy.rst:166 +#: ../../library/asyncio-policy.rst:178 msgid "" "Arrange for ``callback(pid, returncode, *args)`` to be called when a process " "with PID equal to *pid* terminates. Specifying another callback for the " "same process replaces the previous handler." msgstr "" -#: ../../library/asyncio-policy.rst:171 +#: ../../library/asyncio-policy.rst:183 msgid "The *callback* callable must be thread-safe." msgstr "" -#: ../../library/asyncio-policy.rst:175 +#: ../../library/asyncio-policy.rst:187 msgid "Removes the handler for process with PID equal to *pid*." msgstr "" -#: ../../library/asyncio-policy.rst:177 +#: ../../library/asyncio-policy.rst:189 msgid "" "The function returns ``True`` if the handler was successfully removed, " "``False`` if there was nothing to remove." msgstr "" -#: ../../library/asyncio-policy.rst:182 +#: ../../library/asyncio-policy.rst:194 msgid "Attach the watcher to an event loop." msgstr "" -#: ../../library/asyncio-policy.rst:184 +#: ../../library/asyncio-policy.rst:196 msgid "" "If the watcher was previously attached to an event loop, then it is first " "detached before attaching to the new loop." msgstr "" -#: ../../library/asyncio-policy.rst:187 +#: ../../library/asyncio-policy.rst:199 msgid "Note: loop may be ``None``." msgstr "" -#: ../../library/asyncio-policy.rst:191 +#: ../../library/asyncio-policy.rst:203 msgid "Return ``True`` if the watcher is ready to use." msgstr "" -#: ../../library/asyncio-policy.rst:193 +#: ../../library/asyncio-policy.rst:205 msgid "" "Spawning a subprocess with *inactive* current child watcher raises :exc:" "`RuntimeError`." msgstr "" -#: ../../library/asyncio-policy.rst:200 +#: ../../library/asyncio-policy.rst:212 msgid "Close the watcher." msgstr "" -#: ../../library/asyncio-policy.rst:202 +#: ../../library/asyncio-policy.rst:214 msgid "" "This method has to be called to ensure that underlying resources are cleaned-" "up." msgstr "" -#: ../../library/asyncio-policy.rst:207 +#: ../../library/asyncio-policy.rst:219 msgid "" "This implementation starts a new waiting thread for every subprocess spawn." msgstr "" -#: ../../library/asyncio-policy.rst:209 +#: ../../library/asyncio-policy.rst:221 msgid "" "It works reliably even when the asyncio event loop is run in a non-main OS " "thread." msgstr "" -#: ../../library/asyncio-policy.rst:211 +#: ../../library/asyncio-policy.rst:223 msgid "" "There is no noticeable overhead when handling a big number of children " "(*O(1)* each time a child terminates), but starting a thread per process " "requires extra memory." msgstr "" -#: ../../library/asyncio-policy.rst:214 +#: ../../library/asyncio-policy.rst:226 msgid "This watcher is used by default." msgstr "" -#: ../../library/asyncio-policy.rst:220 +#: ../../library/asyncio-policy.rst:232 msgid "" "This implementation registers a :py:data:`SIGCHLD` signal handler on " "instantiation. That can break third-party code that installs a custom " "handler for :py:data:`SIGCHLD` signal." msgstr "" -#: ../../library/asyncio-policy.rst:224 ../../library/asyncio-policy.rst:242 +#: ../../library/asyncio-policy.rst:236 ../../library/asyncio-policy.rst:254 msgid "" "The watcher avoids disrupting other code spawning processes by polling every " "process explicitly on a :py:data:`SIGCHLD` signal." msgstr "" -#: ../../library/asyncio-policy.rst:227 +#: ../../library/asyncio-policy.rst:239 msgid "" "There is no limitation for running subprocesses from different threads once " "the watcher is installed." msgstr "" -#: ../../library/asyncio-policy.rst:230 +#: ../../library/asyncio-policy.rst:242 msgid "" "The solution is safe but it has a significant overhead when handling a big " "number of processes (*O(n)* each time a :py:data:`SIGCHLD` is received)." msgstr "" -#: ../../library/asyncio-policy.rst:238 +#: ../../library/asyncio-policy.rst:250 msgid "" "This implementation uses active event loop from the main thread to handle :" "py:data:`SIGCHLD` signal. If the main thread has no running event loop " "another thread cannot spawn a subprocess (:exc:`RuntimeError` is raised)." msgstr "" -#: ../../library/asyncio-policy.rst:245 +#: ../../library/asyncio-policy.rst:257 msgid "" "This solution is as safe as :class:`MultiLoopChildWatcher` and has the same " "*O(N)* complexity but requires a running event loop in the main thread to " "work." msgstr "" -#: ../../library/asyncio-policy.rst:250 +#: ../../library/asyncio-policy.rst:262 msgid "" "This implementation reaps every terminated processes by calling ``os." "waitpid(-1)`` directly, possibly breaking other code spawning processes and " "waiting for their termination." msgstr "" -#: ../../library/asyncio-policy.rst:254 +#: ../../library/asyncio-policy.rst:266 msgid "" "There is no noticeable overhead when handling a big number of children " "(*O(1)* each time a child terminates)." msgstr "" -#: ../../library/asyncio-policy.rst:257 +#: ../../library/asyncio-policy.rst:269 msgid "" "This solution requires a running event loop in the main thread to work, as :" "class:`SafeChildWatcher`." msgstr "" -#: ../../library/asyncio-policy.rst:262 +#: ../../library/asyncio-policy.rst:274 msgid "" "This implementation polls process file descriptors (pidfds) to await child " "process termination. In some respects, :class:`PidfdChildWatcher` is a " @@ -364,11 +367,11 @@ msgid "" "only work on recent (5.3+) kernels." msgstr "" -#: ../../library/asyncio-policy.rst:274 +#: ../../library/asyncio-policy.rst:288 msgid "Custom Policies" msgstr "" -#: ../../library/asyncio-policy.rst:276 +#: ../../library/asyncio-policy.rst:290 msgid "" "To implement a new event loop policy, it is recommended to subclass :class:" "`DefaultEventLoopPolicy` and override the methods for which custom behavior " diff --git a/library/bisect.po b/library/bisect.po index bcdaf68067..ddf7bf128b 100644 --- a/library/bisect.po +++ b/library/bisect.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-05-21 17:35+0000\n" +"POT-Creation-Date: 2022-09-26 00:21+0000\n" "PO-Revision-Date: 2022-08-27 16:41+0800\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -187,9 +187,9 @@ msgstr "" #: ../../library/bisect.rst:129 msgid "" -"`Sorted Collections `_ is " -"a high performance module that uses *bisect* to managed sorted collections " -"of data." +"`Sorted Collections `_ is a " +"high performance module that uses *bisect* to managed sorted collections of " +"data." msgstr "" #: ../../library/bisect.rst:133 diff --git a/library/decimal.po b/library/decimal.po index 8a88e7adb8..6c290e3b88 100644 --- a/library/decimal.po +++ b/library/decimal.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-07-06 00:17+0000\n" +"POT-Creation-Date: 2022-09-26 00:21+0000\n" "PO-Revision-Date: 2018-05-23 14:43+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -142,7 +142,7 @@ msgstr "" #: ../../library/decimal.rst:116 msgid "" "IBM's General Decimal Arithmetic Specification, `The General Decimal " -"Arithmetic Specification `_." +"Arithmetic Specification `_." msgstr "" #: ../../library/decimal.rst:125 diff --git a/library/functions.po b/library/functions.po index 6fb7e10bf7..8d67797a58 100644 --- a/library/functions.po +++ b/library/functions.po @@ -9,8 +9,8 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-09-03 00:15+0000\n" -"PO-Revision-Date: 2022-05-22 02:44+0800\n" +"POT-Creation-Date: 2022-09-30 00:28+0000\n" +"PO-Revision-Date: 2022-10-01 14:30+0800\n" "Last-Translator: Phil Lin \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -19,7 +19,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -"X-Generator: Poedit 3.0.1\n" +"X-Generator: Poedit 3.1.1\n" #: ../../library/functions.rst:5 ../../library/functions.rst:11 msgid "Built-in Functions" @@ -482,8 +482,8 @@ msgid "" "ways." msgstr "如果不一定需要 \"0b\" 前綴,還可以使用如下的方法。" -#: ../../library/functions.rst:139 ../../library/functions.rst:806 -#: ../../library/functions.rst:1110 +#: ../../library/functions.rst:139 ../../library/functions.rst:808 +#: ../../library/functions.rst:1112 msgid "See also :func:`format` for more information." msgstr "可參考 :func:`format` 獲取更多資訊。" @@ -502,8 +502,8 @@ msgstr "" "(參見 :ref:`typesnumeric`),其他 class 不能繼承自它。它只有 ``False`` 和 " "``True`` 兩個實例(參見 :ref:`bltin-boolean-values`)。" -#: ../../library/functions.rst:153 ../../library/functions.rst:674 -#: ../../library/functions.rst:890 +#: ../../library/functions.rst:153 ../../library/functions.rst:675 +#: ../../library/functions.rst:892 msgid "*x* is now a positional-only parameter." msgstr "" @@ -884,8 +884,8 @@ msgstr "" msgid "The complex type is described in :ref:`typesnumeric`." msgstr "複數型別在 :ref:`typesnumeric` 中有相關描述。" -#: ../../library/functions.rst:381 ../../library/functions.rst:671 -#: ../../library/functions.rst:887 +#: ../../library/functions.rst:381 ../../library/functions.rst:672 +#: ../../library/functions.rst:889 msgid "Grouping digits with underscores as in code literals is allowed." msgstr "可以使用底線將程式碼文字中的數字進行分組。" @@ -900,13 +900,15 @@ msgid "" "This is a relative of :func:`setattr`. The arguments are an object and a " "string. The string must be the name of one of the object's attributes. The " "function deletes the named attribute, provided the object allows it. For " -"example, ``delattr(x, 'foobar')`` is equivalent to ``del x.foobar``." +"example, ``delattr(x, 'foobar')`` is equivalent to ``del x.foobar``. *name* " +"need not be a Python identifier (see :func:`setattr`)." msgstr "" "這是 :func:`setattr` 相關的函式。引數是一個物件和一個字串,該字串必須是物件中" "某個屬性名稱。如果物件允許,該函式將刪除指定的屬性。例如 ``delattr(x, " -"'foobar')`` 等價於 ``del x.foobar``。" +"'foobar')`` 等價於 ``del x.foobar``。*name* 不必是個 Python 識別符 " +"(identifier)(請見 :func:`setattr`)。" -#: ../../library/functions.rst:403 +#: ../../library/functions.rst:404 msgid "" "Create a new dictionary. The :class:`dict` object is the dictionary class. " "See :class:`dict` and :ref:`typesmapping` for documentation about this class." @@ -914,7 +916,7 @@ msgstr "" "建立一個新的 dictionary(字典)。\\ :class:`dict` 物件是一個 dictionary " "class。參見 :class:`dict` 和 :ref:`typesmapping` 來瞭解這個 class。" -#: ../../library/functions.rst:406 +#: ../../library/functions.rst:407 msgid "" "For other containers see the built-in :class:`list`, :class:`set`, and :" "class:`tuple` classes, as well as the :mod:`collections` module." @@ -922,7 +924,7 @@ msgstr "" "其他容器型別,請參見內建的 :class:`list`、:class:`set` 和 :class:`tuple` " "class,以及 :mod:`collections` module。" -#: ../../library/functions.rst:412 +#: ../../library/functions.rst:413 msgid "" "Without arguments, return the list of names in the current local scope. " "With an argument, attempt to return a list of valid attributes for that " @@ -931,7 +933,7 @@ msgstr "" "如果沒有引數,則回傳當前本地作用域中的名稱列表。如果有引數,它會嘗試回傳該物" "件的有效屬性列表。" -#: ../../library/functions.rst:415 +#: ../../library/functions.rst:416 msgid "" "If the object has a method named :meth:`__dir__`, this method will be called " "and must return the list of attributes. This allows objects that implement a " @@ -942,7 +944,7 @@ msgstr "" "須回傳一個屬性列表。這允許實現自定義 :func:`__getattr__` 或 :func:" "`__getattribute__` 函式的物件能夠自定義 :func:`dir` 來報告它們的屬性。" -#: ../../library/functions.rst:420 +#: ../../library/functions.rst:421 msgid "" "If the object does not provide :meth:`__dir__`, the function tries its best " "to gather information from the object's :attr:`~object.__dict__` attribute, " @@ -954,7 +956,7 @@ msgstr "" "__dict__` 屬性和型別物件收集資訊。結果列表並不總是完整的,如果物件有自定義 :" "func:`__getattr__`,那結果可能不準確。" -#: ../../library/functions.rst:425 +#: ../../library/functions.rst:426 msgid "" "The default :func:`dir` mechanism behaves differently with different types " "of objects, as it attempts to produce the most relevant, rather than " @@ -963,13 +965,13 @@ msgstr "" "預設的 :func:`dir` 機制對不同型別的物件有不同行為,它會試圖回傳最相關而非最完" "整的資訊:" -#: ../../library/functions.rst:429 +#: ../../library/functions.rst:430 msgid "" "If the object is a module object, the list contains the names of the " "module's attributes." msgstr "如果物件是 module 物件,則列表包含 module 的屬性名稱。" -#: ../../library/functions.rst:432 +#: ../../library/functions.rst:433 msgid "" "If the object is a type or class object, the list contains the names of its " "attributes, and recursively of the attributes of its bases." @@ -977,7 +979,7 @@ msgstr "" "如果物件是型別或 class 物件,則列表包含它們的屬性名稱,並且遞迴查詢其基礎的所" "有屬性。" -#: ../../library/functions.rst:435 +#: ../../library/functions.rst:436 msgid "" "Otherwise, the list contains the object's attributes' names, the names of " "its class's attributes, and recursively of the attributes of its class's " @@ -986,11 +988,11 @@ msgstr "" "否則,包含物件的屬性名稱列表、它的 class 屬性名稱,並且遞迴查詢它的 class 的" "所有基礎 class 的屬性。" -#: ../../library/functions.rst:439 +#: ../../library/functions.rst:440 msgid "The resulting list is sorted alphabetically. For example:" msgstr "回傳的列表按字母表排序,例如:" -#: ../../library/functions.rst:458 +#: ../../library/functions.rst:459 msgid "" "Because :func:`dir` is supplied primarily as a convenience for use at an " "interactive prompt, it tries to supply an interesting set of names more than " @@ -1003,7 +1005,7 @@ msgstr "" "版本之間改變。例如,當引數是一個 class 時,metaclass 的屬性不包含在結果列表" "中。" -#: ../../library/functions.rst:468 +#: ../../library/functions.rst:469 msgid "" "Take two (non-complex) numbers as arguments and return a pair of numbers " "consisting of their quotient and remainder when using integer division. " @@ -1021,7 +1023,7 @@ msgstr "" "等,如果 ``a % b`` 非零,則它的符號和 *b* 一樣,且 ``0 <= abs(a % b) < " "abs(b)``。" -#: ../../library/functions.rst:480 +#: ../../library/functions.rst:481 msgid "" "Return an enumerate object. *iterable* must be a sequence, an :term:" "`iterator`, or some other object which supports iteration. The :meth:" @@ -1034,14 +1036,14 @@ msgstr "" "meth:`~iterator.__next__` method 回傳一個 tuple(元組),裡面包含一個計數值" "(從 *start* 開始,預設為 0)和通過疊代 *iterable* 獲得的值。" -#: ../../library/functions.rst:492 +#: ../../library/functions.rst:493 msgid "Equivalent to::" msgstr "" "等價於:\n" "\n" "::" -#: ../../library/functions.rst:503 +#: ../../library/functions.rst:504 msgid "" "The arguments are a string and optional globals and locals. If provided, " "*globals* must be a dictionary. If provided, *locals* can be any mapping " @@ -1050,7 +1052,7 @@ msgstr "" "引數是一個字串,以及選擇性的 globals 和 locals。如果有提供選擇性引數," "*globals* 必須是一個 dictionary。*locals* 可以是任何映射 (mapping) 物件。" -#: ../../library/functions.rst:507 +#: ../../library/functions.rst:508 msgid "" "The *expression* argument is parsed and evaluated as a Python expression " "(technically speaking, a condition list) using the *globals* and *locals* " @@ -1076,13 +1078,13 @@ msgstr "" "呼叫的環境中執行運算式。請注意,*eval()* 在封閉環境中無法存取\\ :term:`巢狀" "域 ` (non-locals)。" -#: ../../library/functions.rst:522 +#: ../../library/functions.rst:523 msgid "" "The return value is the result of the evaluated expression. Syntax errors " "are reported as exceptions. Example:" msgstr "" -#: ../../library/functions.rst:529 +#: ../../library/functions.rst:530 msgid "" "This function can also be used to execute arbitrary code objects (such as " "those created by :func:`compile`). In this case, pass a code object instead " @@ -1093,7 +1095,7 @@ msgstr "" "情況下,傳入的引數是程式碼物件而不是字串。如果編譯該物件時的 *mode* 引數是 " "``'exec'``,那麼 :func:`eval` 回傳值為 ``None``。" -#: ../../library/functions.rst:534 +#: ../../library/functions.rst:535 msgid "" "Hints: dynamic execution of statements is supported by the :func:`exec` " "function. The :func:`globals` and :func:`locals` functions return the " @@ -1104,13 +1106,13 @@ msgstr "" "`locals` 函式分別回傳當前的全域性和局部性 dictionary,它們對於將引數傳遞給 :" "func:`eval` 或 :func:`exec` 可能會方便許多。" -#: ../../library/functions.rst:539 +#: ../../library/functions.rst:540 msgid "" "If the given source is a string, then leading and trailing spaces and tabs " "are stripped." msgstr "" -#: ../../library/functions.rst:542 +#: ../../library/functions.rst:543 msgid "" "See :func:`ast.literal_eval` for a function that can safely evaluate strings " "with expressions containing only literals." @@ -1118,19 +1120,19 @@ msgstr "" "另外可以參閱 :func:`ast.literal_eval`,該函式可以安全執行僅包含文字的運算式字" "串。" -#: ../../library/functions.rst:545 ../../library/functions.rst:581 +#: ../../library/functions.rst:546 ../../library/functions.rst:582 msgid "" "Raises an :ref:`auditing event ` ``exec`` with argument " "``code_object``." msgstr "" -#: ../../library/functions.rst:547 ../../library/functions.rst:583 +#: ../../library/functions.rst:548 ../../library/functions.rst:584 msgid "" "Raises an :ref:`auditing event ` ``exec`` with the code object as " "the argument. Code compilation events may also be raised." msgstr "" -#: ../../library/functions.rst:554 +#: ../../library/functions.rst:555 msgid "" "This function supports dynamic execution of Python code. *object* must be " "either a string or a code object. If it is a string, the string is parsed " @@ -1150,7 +1152,7 @@ msgstr "" "`yield` 和 :keyword:`return` 陳述式也不能在函式之外使用。該函式回傳值是 " "``None``。" -#: ../../library/functions.rst:565 +#: ../../library/functions.rst:566 msgid "" "In all cases, if the optional parts are omitted, the code is executed in the " "current scope. If only *globals* is provided, it must be a dictionary (and " @@ -1169,7 +1171,7 @@ msgstr "" "地變數是相同的 dictionary。如果 exec 有兩個不同的 *globals* 和 *locals* 物" "件,程式碼就像嵌入在 class 定義中一樣執行。" -#: ../../library/functions.rst:575 +#: ../../library/functions.rst:576 msgid "" "If the *globals* dictionary does not contain a value for the key " "``__builtins__``, a reference to the dictionary of the built-in module :mod:" @@ -1182,7 +1184,7 @@ msgstr "" "func:`exec` 之前,可以通過將自己的 ``__builtins__`` dictionary 插入到 " "*globals* 中來控制可以使用哪些內建程式碼。" -#: ../../library/functions.rst:588 +#: ../../library/functions.rst:589 msgid "" "The built-in functions :func:`globals` and :func:`locals` return the current " "global and local dictionary, respectively, which may be useful to pass " @@ -1191,7 +1193,7 @@ msgstr "" "內建 :func:`globals` 和 :func:`locals` 函式各自回傳當前的全域性和本地 " "dictionary,因此可以將它們傳遞給 :func:`exec` 的第二個和第三個引數。" -#: ../../library/functions.rst:594 +#: ../../library/functions.rst:595 msgid "" "The default *locals* act as described for function :func:`locals` below: " "modifications to the default *locals* dictionary should not be attempted. " @@ -1202,7 +1204,7 @@ msgstr "" "預設的 *locals* dictionary。如果您想在 :func:`exec` 函式回傳時知道程式碼對 " "*locals* 的變動,請明確地傳遞 *locals* dictionary 。" -#: ../../library/functions.rst:602 +#: ../../library/functions.rst:603 msgid "" "Construct an iterator from those elements of *iterable* for which *function* " "returns true. *iterable* may be either a sequence, a container which " @@ -1215,7 +1217,7 @@ msgstr "" "*function* 是 ``None``,則會假設它是一個恆等函數,即 *iterable* 中所有假值元" "素會被移除。" -#: ../../library/functions.rst:608 +#: ../../library/functions.rst:609 msgid "" "Note that ``filter(function, iterable)`` is equivalent to the generator " "expression ``(item for item in iterable if function(item))`` if function is " @@ -1226,7 +1228,7 @@ msgstr "" "是 ``None`` 的時候為 ``(item for item in iterable if function(item))``;" "function 是 ``None`` 的時候為 ``(item for item in iterable if item)``。" -#: ../../library/functions.rst:613 +#: ../../library/functions.rst:614 msgid "" "See :func:`itertools.filterfalse` for the complementary function that " "returns elements of *iterable* for which *function* returns false." @@ -1234,11 +1236,11 @@ msgstr "" "請參閱 :func:`itertools.filterfalse`,只有 *function* 回傳 false 時才選取 " "*iterable* 中元素的互補函數。" -#: ../../library/functions.rst:623 +#: ../../library/functions.rst:624 msgid "Return a floating point number constructed from a number or string *x*." msgstr "回傳從數字或字串 *x* 生成的浮點數。" -#: ../../library/functions.rst:625 +#: ../../library/functions.rst:626 msgid "" "If the argument is a string, it should contain a decimal number, optionally " "preceded by a sign, and optionally embedded in whitespace. The optional " @@ -1253,7 +1255,7 @@ msgstr "" "數也可以是 NaN(非數字)或正負無窮大的字串。確切地說,除去首尾的空格後,輸入" "必須遵循以下語法:" -#: ../../library/functions.rst:640 +#: ../../library/functions.rst:641 msgid "" "Here ``floatnumber`` is the form of a Python floating-point literal, " "described in :ref:`floating`. Case is not significant, so, for example, " @@ -1264,7 +1266,7 @@ msgstr "" "都可以,例如,\"inf\"、\"Inf\"、\"INFINITY\"、\"iNfINity\" 都可以表示正無窮" "大。" -#: ../../library/functions.rst:645 +#: ../../library/functions.rst:646 msgid "" "Otherwise, if the argument is an integer or a floating point number, a " "floating point number with the same value (within Python's floating point " @@ -1274,7 +1276,7 @@ msgstr "" "否則,如果引數是整數或浮點數,則回傳具有相同值(在 Python 浮點精度範圍內)的" "浮點數。如果引數在 Python 浮點精度範圍外,則會觸發 :exc:`OverflowError`。" -#: ../../library/functions.rst:650 +#: ../../library/functions.rst:651 msgid "" "For a general Python object ``x``, ``float(x)`` delegates to ``x." "__float__()``. If ``__float__()`` is not defined then it falls back to :" @@ -1283,26 +1285,26 @@ msgstr "" "對於一般的 Python 物件 ``x``,``float(x)`` 指派給 ``x.__float__()``。如果未定" "義 ``__float__()`` 則使用 :meth:`__index__`。" -#: ../../library/functions.rst:654 +#: ../../library/functions.rst:655 msgid "If no argument is given, ``0.0`` is returned." msgstr "如果沒有引數,則回傳 ``0.0``。" -#: ../../library/functions.rst:656 +#: ../../library/functions.rst:657 msgid "Examples::" msgstr "" "例如:\n" "\n" "::" -#: ../../library/functions.rst:669 +#: ../../library/functions.rst:670 msgid "The float type is described in :ref:`typesnumeric`." msgstr ":ref:`typesnumeric` 描述了浮點數型別。" -#: ../../library/functions.rst:677 +#: ../../library/functions.rst:678 msgid "Falls back to :meth:`__index__` if :meth:`__float__` is not defined." msgstr "" -#: ../../library/functions.rst:687 +#: ../../library/functions.rst:688 msgid "" "Convert a *value* to a \"formatted\" representation, as controlled by " "*format_spec*. The interpretation of *format_spec* will depend on the type " @@ -1313,7 +1315,7 @@ msgstr "" "取決於 *value* 引數的型別,但是大多數內建型別使用標準格式化語法::ref:" "`formatspec`。" -#: ../../library/functions.rst:692 +#: ../../library/functions.rst:693 msgid "" "The default *format_spec* is an empty string which usually gives the same " "effect as calling :func:`str(value) `." @@ -1321,7 +1323,7 @@ msgstr "" "預設的 *format_spec* 是一個空字串,它通常和呼叫 :func:`str(value) ` 的效" "果相同。" -#: ../../library/functions.rst:695 +#: ../../library/functions.rst:696 msgid "" "A call to ``format(value, format_spec)`` is translated to ``type(value)." "__format__(value, format_spec)`` which bypasses the instance dictionary when " @@ -1335,7 +1337,7 @@ msgstr "" "字典。如果搜尋到 :mod:`object` 這個 method 但 *format_spec* 不為空,或是 " "*format_spec* 或回傳值不是字串,則會觸發 :exc:`TypeError`。" -#: ../../library/functions.rst:702 +#: ../../library/functions.rst:703 msgid "" "``object().__format__(format_spec)`` raises :exc:`TypeError` if " "*format_spec* is not an empty string." @@ -1343,7 +1345,7 @@ msgstr "" "當 *format_spec* 不是空字串時,``object().__format__(format_spec)`` 會觸發 :" "exc:`TypeError`。" -#: ../../library/functions.rst:711 +#: ../../library/functions.rst:712 msgid "" "Return a new :class:`frozenset` object, optionally with elements taken from " "*iterable*. ``frozenset`` is a built-in class. See :class:`frozenset` and :" @@ -1353,7 +1355,7 @@ msgstr "" "素。\\ ``frozenset`` 是一個內建的 class。有關此 class 的文件,請參閱 :class:" "`frozenset` 和 :ref:`types-set`。" -#: ../../library/functions.rst:715 +#: ../../library/functions.rst:716 msgid "" "For other containers see the built-in :class:`set`, :class:`list`, :class:" "`tuple`, and :class:`dict` classes, as well as the :mod:`collections` module." @@ -1361,21 +1363,22 @@ msgstr "" "請參閱內建的 :class:`set`、:class:`list`、:class:`tuple` 和 :class:`dict` " "class,以及 :mod:`collections` module 來了解其它的容器。" -#: ../../library/functions.rst:722 +#: ../../library/functions.rst:723 msgid "" "Return the value of the named attribute of *object*. *name* must be a " "string. If the string is the name of one of the object's attributes, the " "result is the value of that attribute. For example, ``getattr(x, " "'foobar')`` is equivalent to ``x.foobar``. If the named attribute does not " "exist, *default* is returned if provided, otherwise :exc:`AttributeError` is " -"raised." +"raised. *name* need not be a Python identifier (see :func:`setattr`)." msgstr "" "回傳 *object* 之具名屬性的值。*name* 必須是字串。如果該字串是物件屬性之一的名" "稱,則回傳該屬性的值。例如,``getattr(x, 'foobar')`` 等同於 ``x.foobar``。如" "果指定的屬性不存在,且提供了 *default* 值,則回傳其值,否則觸發 :exc:" -"`AttributeError`。" +"`AttributeError`。*name* 不必是個 Python 識別符 (identifier)(請見 :func:" +"`setattr`)。" -#: ../../library/functions.rst:730 +#: ../../library/functions.rst:732 msgid "" "Since :ref:`private name mangling ` happens at " "compilation time, one must manually mangle a private attribute's (attributes " @@ -1383,7 +1386,7 @@ msgid "" "`getattr`." msgstr "" -#: ../../library/functions.rst:738 +#: ../../library/functions.rst:740 msgid "" "Return the dictionary implementing the current module namespace. For code " "within functions, this is set when the function is defined and remains the " @@ -1392,7 +1395,7 @@ msgstr "" "回傳代表當前 module 命名空間的 dictionary。對於在函式中的程式碼來說,這在定義" "函式時設定且不論該函式是在何處呼叫都會保持相同。" -#: ../../library/functions.rst:745 +#: ../../library/functions.rst:747 msgid "" "The arguments are an object and a string. The result is ``True`` if the " "string is the name of one of the object's attributes, ``False`` if not. " @@ -1403,7 +1406,7 @@ msgstr "" "則回傳 ``False``。(此功能是通過呼叫 ``getattr(object, name)`` 看是否有 :exc:" "`AttributeError` 來實現的。)" -#: ../../library/functions.rst:753 +#: ../../library/functions.rst:755 msgid "" "Return the hash value of the object (if it has one). Hash values are " "integers. They are used to quickly compare dictionary keys during a " @@ -1414,7 +1417,7 @@ msgstr "" "時用來快速比較 dictionary 的鍵。相同大小的數字數值有相同的雜湊值(即使它們型" "別不同,如 1 和 1.0)。" -#: ../../library/functions.rst:760 +#: ../../library/functions.rst:762 msgid "" "For objects with custom :meth:`__hash__` methods, note that :func:`hash` " "truncates the return value based on the bit width of the host machine. See :" @@ -1423,7 +1426,7 @@ msgstr "" "請注意,如果物件實現了自己的 :meth:`__hash__` method,:func:`hash` 根據執行機" "器的位元長度來擷取回傳值。另請參閱 :meth:`__hash__`。" -#: ../../library/functions.rst:766 +#: ../../library/functions.rst:768 msgid "" "Invoke the built-in help system. (This function is intended for interactive " "use.) If no argument is given, the interactive help system starts on the " @@ -1437,7 +1440,7 @@ msgstr "" "鍵字或文件主題中搜索該字串,並在控制台上列印幫助資訊。如果引數是其他任意物" "件,則會生成該物件的幫助頁。" -#: ../../library/functions.rst:773 +#: ../../library/functions.rst:775 msgid "" "Note that if a slash(/) appears in the parameter list of a function when " "invoking :func:`help`, it means that the parameters prior to the slash are " @@ -1445,12 +1448,12 @@ msgid "" "parameters `." msgstr "" -#: ../../library/functions.rst:778 +#: ../../library/functions.rst:780 msgid "" "This function is added to the built-in namespace by the :mod:`site` module." msgstr "該函式透過 :mod:`site` module 加入到內建命名空間。" -#: ../../library/functions.rst:780 +#: ../../library/functions.rst:782 msgid "" "Changes to :mod:`pydoc` and :mod:`inspect` mean that the reported signatures " "for callables are now more comprehensive and consistent." @@ -1458,7 +1461,7 @@ msgstr "" "變更至 :mod:`pydoc` 和 :mod:`inspect` 使得可呼叫物件的簽名信息 (signature) 更" "加全面和一致。" -#: ../../library/functions.rst:787 +#: ../../library/functions.rst:789 msgid "" "Convert an integer number to a lowercase hexadecimal string prefixed with " "\"0x\". If *x* is not a Python :class:`int` object, it has to define an :" @@ -1468,7 +1471,7 @@ msgstr "" "class:`int` 物件,則必須定義一個 :meth:`__index__` method 並且回傳一個整數。" "舉例來說:" -#: ../../library/functions.rst:796 +#: ../../library/functions.rst:798 msgid "" "If you want to convert an integer number to an uppercase or lower " "hexadecimal string with prefix or not, you can use either of the following " @@ -1477,20 +1480,20 @@ msgstr "" "如果要將整數轉換為大寫或小寫的十六進位制字串,並可選擇有無 \"0x\" 前綴,則可" "以使用如下方法:" -#: ../../library/functions.rst:808 +#: ../../library/functions.rst:810 msgid "" "See also :func:`int` for converting a hexadecimal string to an integer using " "a base of 16." msgstr "另請參閱 :func:`int` 將十六進位制字串轉換為以 16 為基數的整數。" -#: ../../library/functions.rst:813 +#: ../../library/functions.rst:815 msgid "" "To obtain a hexadecimal string representation for a float, use the :meth:" "`float.hex` method." msgstr "" "如果要獲取浮點數的十六進位制字串形式,請使用 :meth:`float.hex` method。" -#: ../../library/functions.rst:819 +#: ../../library/functions.rst:821 msgid "" "Return the \"identity\" of an object. This is an integer which is " "guaranteed to be unique and constant for this object during its lifetime. " @@ -1500,13 +1503,13 @@ msgstr "" "回傳物件的 \"標識值\" 。該值是一個整數,在此物件的生命週期中保證是唯一且恆定" "的。兩個生命期不重疊的物件可能具有相同的 :func:`id` 值。" -#: ../../library/functions.rst:826 +#: ../../library/functions.rst:828 msgid "" "Raises an :ref:`auditing event ` ``builtins.id`` with argument " "``id``." msgstr "" -#: ../../library/functions.rst:831 +#: ../../library/functions.rst:833 msgid "" "If the *prompt* argument is present, it is written to standard output " "without a trailing newline. The function then reads a line from input, " @@ -1519,7 +1522,7 @@ msgstr "" "\n" "::" -#: ../../library/functions.rst:841 +#: ../../library/functions.rst:843 msgid "" "If the :mod:`readline` module was loaded, then :func:`input` will use it to " "provide elaborate line editing and history features." @@ -1527,31 +1530,31 @@ msgstr "" "如果載入了 :mod:`readline` module,:func:`input` 將使用它來提供複雜的行編輯和" "歷史記錄功能。" -#: ../../library/functions.rst:844 +#: ../../library/functions.rst:846 msgid "" "Raises an :ref:`auditing event ` ``builtins.input`` with argument " "``prompt``." msgstr "" -#: ../../library/functions.rst:846 +#: ../../library/functions.rst:848 msgid "" "Raises an :ref:`auditing event ` ``builtins.input`` with argument " "``prompt`` before reading input" msgstr "" -#: ../../library/functions.rst:849 +#: ../../library/functions.rst:851 msgid "" "Raises an :ref:`auditing event ` ``builtins.input/result`` with " "argument ``result``." msgstr "" -#: ../../library/functions.rst:851 +#: ../../library/functions.rst:853 msgid "" "Raises an :ref:`auditing event ` ``builtins.input/result`` with " "the result after successfully reading input." msgstr "" -#: ../../library/functions.rst:858 +#: ../../library/functions.rst:860 msgid "" "Return an integer object constructed from a number or string *x*, or return " "``0`` if no arguments are given. If *x* defines :meth:`__int__`, ``int(x)`` " @@ -1564,7 +1567,7 @@ msgstr "" "了 :meth:`__index__` 則回傳 ``x.__index__()``。如果 *x* 定義了 :meth:" "`__trunc__` 則回傳 ``x.__trunc__()``。對於浮點數則向零舍入。" -#: ../../library/functions.rst:865 +#: ../../library/functions.rst:867 msgid "" "If *x* is not a number or if *base* is given, then *x* must be a string, :" "class:`bytes`, or :class:`bytearray` instance representing an :ref:`integer " @@ -1589,11 +1592,11 @@ msgstr "" "2、8、10、16 進制中的一個,所以 ``int('010', 0)`` 是非法的,但 " "``int('010')`` 和 ``int('010', 8)`` 是有效的。" -#: ../../library/functions.rst:878 +#: ../../library/functions.rst:880 msgid "The integer type is described in :ref:`typesnumeric`." msgstr "整數型別定義請參閱 :ref:`typesnumeric`。" -#: ../../library/functions.rst:880 +#: ../../library/functions.rst:882 msgid "" "If *base* is not an instance of :class:`int` and the *base* object has a :" "meth:`base.__index__ ` method, that method is called to " @@ -1605,11 +1608,11 @@ msgstr "" "使用 :meth:`base.__int__ ` 而不是 :meth:`base.__index__ " "`。" -#: ../../library/functions.rst:893 +#: ../../library/functions.rst:895 msgid "Falls back to :meth:`__index__` if :meth:`__int__` is not defined." msgstr "" -#: ../../library/functions.rst:896 +#: ../../library/functions.rst:898 msgid "" ":class:`int` string inputs and string representations can be limited to help " "avoid denial of service attacks. A :exc:`ValueError` is raised when the " @@ -1619,7 +1622,7 @@ msgid "" "documentation." msgstr "" -#: ../../library/functions.rst:907 +#: ../../library/functions.rst:909 msgid "" "Return ``True`` if the *object* argument is an instance of the *classinfo* " "argument, or of a (direct, indirect, or :term:`virtual `) of *classinfo*. A class is considered a " @@ -1657,7 +1660,7 @@ msgstr "" "*class* 是 *classinfo* 中任一元素的 subclass 時則回傳 ``True``。其他情況,會" "觸發 :exc:`TypeError`。" -#: ../../library/functions.rst:937 +#: ../../library/functions.rst:939 msgid "" "Return an :term:`iterator` object. The first argument is interpreted very " "differently depending on the presence of the second argument. Without a " @@ -1680,18 +1683,18 @@ msgstr "" "帶引數地呼叫 *object*\\ ;如果回傳的結果是 *sentinel* 則觸發 :exc:" "`StopIteration`,否則回傳呼叫結果。" -#: ../../library/functions.rst:950 +#: ../../library/functions.rst:952 msgid "See also :ref:`typeiter`." msgstr "另請參閱 :ref:`typeiter`。" -#: ../../library/functions.rst:952 +#: ../../library/functions.rst:954 msgid "" "One useful application of the second form of :func:`iter` is to build a " "block-reader. For example, reading fixed-width blocks from a binary database " "file until the end of file is reached::" msgstr "" -#: ../../library/functions.rst:964 +#: ../../library/functions.rst:966 msgid "" "Return the length (the number of items) of an object. The argument may be a " "sequence (such as a string, bytes, tuple, list, or range) or a collection " @@ -1700,13 +1703,13 @@ msgstr "" "回傳物件的長度(元素個數)。引數可以是序列(如 string、bytes、tuple、list 或 " "range)或集合(如 dictionary、set 或 frozen set)。" -#: ../../library/functions.rst:970 +#: ../../library/functions.rst:972 msgid "" "``len`` raises :exc:`OverflowError` on lengths larger than :data:`sys." "maxsize`, such as :class:`range(2 ** 100) `." msgstr "" -#: ../../library/functions.rst:978 +#: ../../library/functions.rst:980 msgid "" "Rather than being a function, :class:`list` is actually a mutable sequence " "type, as documented in :ref:`typesseq-list` and :ref:`typesseq`." @@ -1714,7 +1717,7 @@ msgstr "" "除了是函式,:class:`list` 也是可變序列型別,詳情請參閱 :ref:`typesseq-list` " "和 :ref:`typesseq`。" -#: ../../library/functions.rst:984 +#: ../../library/functions.rst:986 msgid "" "Update and return a dictionary representing the current local symbol table. " "Free variables are returned by :func:`locals` when it is called in function " @@ -1725,7 +1728,7 @@ msgstr "" "叫 :func:`locals` 時會回傳自由變數。請注意,在 module 階層中,\\ :func:" "`locals` 和 :func:`globals` 是相同的 dictionary。" -#: ../../library/functions.rst:990 +#: ../../library/functions.rst:992 msgid "" "The contents of this dictionary should not be modified; changes may not " "affect the values of local and free variables used by the interpreter." @@ -1733,7 +1736,7 @@ msgstr "" "此 dictionary 的內容不應該被更動;更改可能不會影響直譯器使用的本地變數或自由" "變數的值。" -#: ../../library/functions.rst:995 +#: ../../library/functions.rst:997 msgid "" "Return an iterator that applies *function* to every item of *iterable*, " "yielding the results. If additional *iterable* arguments are passed, " @@ -1748,13 +1751,13 @@ msgstr "" "iteratable 耗盡時 iterator 也會結束。如果函式的輸入已經是 tuple 的引數,請參" "閱 :func:`itertools.starmap`\\。" -#: ../../library/functions.rst:1006 +#: ../../library/functions.rst:1008 msgid "" "Return the largest item in an iterable or the largest of two or more " "arguments." msgstr "回傳 iterable 中最大的元素,或者回傳兩個及以上引數中最大的。" -#: ../../library/functions.rst:1009 +#: ../../library/functions.rst:1011 msgid "" "If one positional argument is provided, it should be an :term:`iterable`. " "The largest item in the iterable is returned. If two or more positional " @@ -1763,7 +1766,7 @@ msgstr "" "如果只提供了一個位置引數,它必須是個 :term:`iterable`,iterable 中最大的元素" "會被回傳。如果提供了兩個或以上的位置引數,則回傳最大的位置引數。" -#: ../../library/functions.rst:1014 ../../library/functions.rst:1051 +#: ../../library/functions.rst:1016 ../../library/functions.rst:1053 msgid "" "There are two optional keyword-only arguments. The *key* argument specifies " "a one-argument ordering function like that used for :meth:`list.sort`. The " @@ -1775,7 +1778,7 @@ msgstr "" "式,如同 :meth:`list.sort` 使用方式。*default* 引數是當 iterable 為空時回傳的" "值。如果 iterable 為空,並且沒有提供 *default*,則會觸發 :exc:`ValueError`。" -#: ../../library/functions.rst:1020 +#: ../../library/functions.rst:1022 msgid "" "If multiple items are maximal, the function returns the first one " "encountered. This is consistent with other sort-stability preserving tools " @@ -1786,15 +1789,15 @@ msgstr "" "``sorted(iterable, key=keyfunc, reverse=True)[0]`` 和 ``heapq.nlargest(1, " "iterable, key=keyfunc)`` 一致。" -#: ../../library/functions.rst:1025 ../../library/functions.rst:1062 +#: ../../library/functions.rst:1027 ../../library/functions.rst:1064 msgid "The *default* keyword-only argument." msgstr "*default* 僅限關鍵字引數。" -#: ../../library/functions.rst:1028 ../../library/functions.rst:1065 +#: ../../library/functions.rst:1030 ../../library/functions.rst:1067 msgid "The *key* can be ``None``." msgstr "" -#: ../../library/functions.rst:1036 +#: ../../library/functions.rst:1038 msgid "" "Return a \"memory view\" object created from the given argument. See :ref:" "`typememoryview` for more information." @@ -1802,13 +1805,13 @@ msgstr "" "回傳由給定的引數建立之 \"memory view\" 物件。有關詳細資訊,請參閱 :ref:" "`typememoryview`。" -#: ../../library/functions.rst:1043 +#: ../../library/functions.rst:1045 msgid "" "Return the smallest item in an iterable or the smallest of two or more " "arguments." msgstr "回傳 iterable 中最小的元素,或者回傳兩個及以上引數中最小的。" -#: ../../library/functions.rst:1046 +#: ../../library/functions.rst:1048 msgid "" "If one positional argument is provided, it should be an :term:`iterable`. " "The smallest item in the iterable is returned. If two or more positional " @@ -1817,7 +1820,7 @@ msgstr "" "如果只提供了一個位置引數,它必須是 :term:`iterable`,iterable 中最小的元素會" "被回傳。如果提供了兩個或以上的位置引數,則回傳最小的位置引數。" -#: ../../library/functions.rst:1057 +#: ../../library/functions.rst:1059 msgid "" "If multiple items are minimal, the function returns the first one " "encountered. This is consistent with other sort-stability preserving tools " @@ -1828,7 +1831,7 @@ msgstr "" "``sorted(iterable, key=keyfunc)[0]`` 和 ``heapq.nsmallest(1, iterable, " "key=keyfunc)`` 一致。" -#: ../../library/functions.rst:1071 +#: ../../library/functions.rst:1073 msgid "" "Retrieve the next item from the :term:`iterator` by calling its :meth:" "`~iterator.__next__` method. If *default* is given, it is returned if the " @@ -1838,7 +1841,7 @@ msgstr "" "素。如果 iterator 耗盡,則回傳給定的預設值 *default*,如果沒有預設值則觸發 :" "exc:`StopIteration`。" -#: ../../library/functions.rst:1078 +#: ../../library/functions.rst:1080 msgid "" "Return a new featureless object. :class:`object` is a base for all classes. " "It has methods that are common to all instances of Python classes. This " @@ -1847,7 +1850,7 @@ msgstr "" "回傳一個沒有特徵的新物件。:class:`object` 是所有 class 的基礎,它具有所有 " "Python class 實例的通用 method。這個函式不接受任何引數。" -#: ../../library/functions.rst:1084 +#: ../../library/functions.rst:1086 msgid "" ":class:`object` does *not* have a :attr:`~object.__dict__`, so you can't " "assign arbitrary attributes to an instance of the :class:`object` class." @@ -1855,7 +1858,7 @@ msgstr "" "由於 :class:`object` *沒有* :attr:`~object.__dict__`,因此無法將任意屬性賦" "給 :class:`object` class 的實例。" -#: ../../library/functions.rst:1090 +#: ../../library/functions.rst:1092 msgid "" "Convert an integer number to an octal string prefixed with \"0o\". The " "result is a valid Python expression. If *x* is not a Python :class:`int` " @@ -1866,7 +1869,7 @@ msgstr "" "Python 運算式。如果 *x* 不是 Python 的 :class:`int` 物件,那它需要定義 :meth:" "`__index__` method 回傳一個整數。舉例來說:" -#: ../../library/functions.rst:1100 +#: ../../library/functions.rst:1102 msgid "" "If you want to convert an integer number to an octal string either with the " "prefix \"0o\" or not, you can use either of the following ways." @@ -1874,7 +1877,7 @@ msgstr "" "如果要將整數轉換為八進位制字串,不論是否具備 \"0o\" 前綴,都可以使用下面的方" "法。" -#: ../../library/functions.rst:1117 +#: ../../library/functions.rst:1119 msgid "" "Open *file* and return a corresponding :term:`file object`. If the file " "cannot be opened, an :exc:`OSError` is raised. See :ref:`tut-files` for more " @@ -1883,7 +1886,7 @@ msgstr "" "開啟 *file* 並回傳對應的 :term:`file object`。如果該檔案不能開啟,則觸發 :" "exc:`OSError`。關於使用此函式的更多方法請參閱\\ :ref:`tut-files`。" -#: ../../library/functions.rst:1121 +#: ../../library/functions.rst:1123 msgid "" "*file* is a :term:`path-like object` giving the pathname (absolute or " "relative to the current working directory) of the file to be opened or an " @@ -1896,7 +1899,7 @@ msgstr "" "果有提供檔案描述器,它會隨著回傳的 I/O 物件關閉而關閉,除非 *closefd* 被設為 " "``False``。)" -#: ../../library/functions.rst:1127 +#: ../../library/functions.rst:1129 msgid "" "*mode* is an optional string that specifies the mode in which the file is " "opened. It defaults to ``'r'`` which means open for reading in text mode. " @@ -1917,71 +1920,71 @@ msgstr "" "getpreferredencoding(False)`` 來獲取當前的本地編碼。(要讀取和寫入原始 " "bytes,請使用二進位制模式且不要指定 *encoding*。)可用的模式有:" -#: ../../library/functions.rst:1144 +#: ../../library/functions.rst:1146 msgid "Character" msgstr "字元" -#: ../../library/functions.rst:1144 +#: ../../library/functions.rst:1146 msgid "Meaning" msgstr "意義" -#: ../../library/functions.rst:1146 +#: ../../library/functions.rst:1148 msgid "``'r'``" msgstr "``'r'``" -#: ../../library/functions.rst:1146 +#: ../../library/functions.rst:1148 msgid "open for reading (default)" msgstr "讀取(預設)" -#: ../../library/functions.rst:1147 +#: ../../library/functions.rst:1149 msgid "``'w'``" msgstr "``'w'``" -#: ../../library/functions.rst:1147 +#: ../../library/functions.rst:1149 msgid "open for writing, truncating the file first" msgstr "" -#: ../../library/functions.rst:1148 +#: ../../library/functions.rst:1150 msgid "``'x'``" msgstr "``'x'``" -#: ../../library/functions.rst:1148 +#: ../../library/functions.rst:1150 msgid "open for exclusive creation, failing if the file already exists" msgstr "唯一性創建,如果文件已存在則會失敗" -#: ../../library/functions.rst:1149 +#: ../../library/functions.rst:1151 msgid "``'a'``" msgstr "``'a'``" -#: ../../library/functions.rst:1149 +#: ../../library/functions.rst:1151 msgid "open for writing, appending to the end of file if it exists" msgstr "寫入,如果文件存在則在末尾追加寫入內容" -#: ../../library/functions.rst:1150 +#: ../../library/functions.rst:1152 msgid "``'b'``" msgstr "``'b'``" -#: ../../library/functions.rst:1150 +#: ../../library/functions.rst:1152 msgid "binary mode" msgstr "二進制模式" -#: ../../library/functions.rst:1151 +#: ../../library/functions.rst:1153 msgid "``'t'``" msgstr "``'t'``" -#: ../../library/functions.rst:1151 +#: ../../library/functions.rst:1153 msgid "text mode (default)" msgstr "文字模式(預設)" -#: ../../library/functions.rst:1152 +#: ../../library/functions.rst:1154 msgid "``'+'``" msgstr "``'+'``" -#: ../../library/functions.rst:1152 +#: ../../library/functions.rst:1154 msgid "open for updating (reading and writing)" msgstr "更新(讀取並寫入)" -#: ../../library/functions.rst:1155 +#: ../../library/functions.rst:1157 msgid "" "The default mode is ``'r'`` (open for reading text, a synonym of ``'rt'``). " "Modes ``'w+'`` and ``'w+b'`` open and truncate the file. Modes ``'r+'`` and " @@ -1990,7 +1993,7 @@ msgstr "" "預設的模式是 ``'r'``\\ (開啟並讀取文字,同 ``'rt'``)。對於二進位制寫入," "``'w+b'`` 模式開啟並把檔案內容變成 0 bytes,``'r+b'`` 則不會捨棄原始內容。" -#: ../../library/functions.rst:1159 +#: ../../library/functions.rst:1161 msgid "" "As mentioned in the :ref:`io-overview`, Python distinguishes between binary " "and text I/O. Files opened in binary mode (including ``'b'`` in the *mode* " @@ -2001,7 +2004,7 @@ msgid "" "specified *encoding* if given." msgstr "" -#: ../../library/functions.rst:1167 +#: ../../library/functions.rst:1169 msgid "" "There is an additional mode character permitted, ``'U'``, which no longer " "has any effect, and is considered deprecated. It previously enabled :term:" @@ -2010,14 +2013,14 @@ msgid "" "parameter>` parameter for further details." msgstr "" -#: ../../library/functions.rst:1175 +#: ../../library/functions.rst:1177 msgid "" "Python doesn't depend on the underlying operating system's notion of text " "files; all the processing is done by Python itself, and is therefore " "platform-independent." msgstr "" -#: ../../library/functions.rst:1179 +#: ../../library/functions.rst:1181 msgid "" "*buffering* is an optional integer used to set the buffering policy. Pass 0 " "to switch buffering off (only allowed in binary mode), 1 to select line " @@ -2030,7 +2033,7 @@ msgid "" "given, the default buffering policy works as follows:" msgstr "" -#: ../../library/functions.rst:1189 +#: ../../library/functions.rst:1191 msgid "" "Binary files are buffered in fixed-size chunks; the size of the buffer is " "chosen using a heuristic trying to determine the underlying device's \"block " @@ -2038,14 +2041,14 @@ msgid "" "the buffer will typically be 4096 or 8192 bytes long." msgstr "" -#: ../../library/functions.rst:1194 +#: ../../library/functions.rst:1196 msgid "" "\"Interactive\" text files (files for which :meth:`~io.IOBase.isatty` " "returns ``True``) use line buffering. Other text files use the policy " "described above for binary files." msgstr "" -#: ../../library/functions.rst:1198 +#: ../../library/functions.rst:1200 msgid "" "*encoding* is the name of the encoding used to decode or encode the file. " "This should only be used in text mode. The default encoding is platform " @@ -2054,7 +2057,7 @@ msgid "" "module for the list of supported encodings." msgstr "" -#: ../../library/functions.rst:1205 +#: ../../library/functions.rst:1207 msgid "" "*errors* is an optional string that specifies how encoding and decoding " "errors are to be handled—this cannot be used in binary mode. A variety of " @@ -2063,25 +2066,25 @@ msgid "" "register_error` is also valid. The standard names include:" msgstr "" -#: ../../library/functions.rst:1213 +#: ../../library/functions.rst:1215 msgid "" "``'strict'`` to raise a :exc:`ValueError` exception if there is an encoding " "error. The default value of ``None`` has the same effect." msgstr "" -#: ../../library/functions.rst:1217 +#: ../../library/functions.rst:1219 msgid "" "``'ignore'`` ignores errors. Note that ignoring encoding errors can lead to " "data loss." msgstr "" -#: ../../library/functions.rst:1220 +#: ../../library/functions.rst:1222 msgid "" "``'replace'`` causes a replacement marker (such as ``'?'``) to be inserted " "where there is malformed data." msgstr "" -#: ../../library/functions.rst:1223 +#: ../../library/functions.rst:1225 msgid "" "``'surrogateescape'`` will represent any incorrect bytes as low surrogate " "code units ranging from U+DC80 to U+DCFF. These surrogate code units will " @@ -2090,33 +2093,33 @@ msgid "" "an unknown encoding." msgstr "" -#: ../../library/functions.rst:1230 +#: ../../library/functions.rst:1232 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;``." msgstr "" -#: ../../library/functions.rst:1234 +#: ../../library/functions.rst:1236 msgid "" "``'backslashreplace'`` replaces malformed data by Python's backslashed " "escape sequences." msgstr "" -#: ../../library/functions.rst:1237 +#: ../../library/functions.rst:1239 msgid "" "``'namereplace'`` (also only supported when writing) replaces unsupported " "characters with ``\\N{...}`` escape sequences." msgstr "" -#: ../../library/functions.rst:1245 +#: ../../library/functions.rst:1247 msgid "" "*newline* controls how :term:`universal newlines` mode works (it only " "applies to text mode). It can be ``None``, ``''``, ``'\\n'``, ``'\\r'``, " "and ``'\\r\\n'``. It works as follows:" msgstr "" -#: ../../library/functions.rst:1249 +#: ../../library/functions.rst:1251 msgid "" "When reading input from the stream, if *newline* is ``None``, universal " "newlines mode is enabled. Lines in the input can end in ``'\\n'``, " @@ -2127,7 +2130,7 @@ msgid "" "given string, and the line ending is returned to the caller untranslated." msgstr "" -#: ../../library/functions.rst:1257 +#: ../../library/functions.rst:1259 msgid "" "When writing output to the stream, if *newline* is ``None``, any ``'\\n'`` " "characters written are translated to the system default line separator, :" @@ -2136,7 +2139,7 @@ msgid "" "characters written are translated to the given string." msgstr "" -#: ../../library/functions.rst:1263 +#: ../../library/functions.rst:1265 msgid "" "If *closefd* is ``False`` and a file descriptor rather than a filename was " "given, the underlying file descriptor will be kept open when the file is " @@ -2144,7 +2147,7 @@ msgid "" "otherwise, an error will be raised." msgstr "" -#: ../../library/functions.rst:1268 +#: ../../library/functions.rst:1270 msgid "" "A custom opener can be used by passing a callable as *opener*. The " "underlying file descriptor for the file object is then obtained by calling " @@ -2153,11 +2156,11 @@ msgid "" "similar to passing ``None``)." msgstr "" -#: ../../library/functions.rst:1274 +#: ../../library/functions.rst:1276 msgid "The newly created file is :ref:`non-inheritable `." msgstr "新建立的檔案是\\ :ref:`不可繼承的 `。" -#: ../../library/functions.rst:1276 +#: ../../library/functions.rst:1278 msgid "" "The following example uses the :ref:`dir_fd ` parameter of the :func:" "`os.open` function to open a file relative to a given directory::" @@ -2167,7 +2170,7 @@ msgstr "" "\n" "::" -#: ../../library/functions.rst:1289 +#: ../../library/functions.rst:1291 msgid "" "The type of :term:`file object` returned by the :func:`open` function " "depends on the mode. When :func:`open` is used to open a file in a text " @@ -2182,7 +2185,7 @@ msgid "" "FileIO`, is returned." msgstr "" -#: ../../library/functions.rst:1310 +#: ../../library/functions.rst:1312 msgid "" "See also the file handling modules, such as :mod:`fileinput`, :mod:`io` " "(where :func:`open` is declared), :mod:`os`, :mod:`os.path`, :mod:" @@ -2192,31 +2195,31 @@ msgstr "" "`open` 的 module )、:mod:`os`、:mod:`os.path`、:mod:`tempfile` 以及 :mod:" "`shutil`。" -#: ../../library/functions.rst:1314 +#: ../../library/functions.rst:1316 msgid "" "Raises an :ref:`auditing event ` ``open`` with arguments ``file``, " "``mode``, ``flags``." msgstr "" -#: ../../library/functions.rst:1316 +#: ../../library/functions.rst:1318 msgid "" "The ``mode`` and ``flags`` arguments may have been modified or inferred from " "the original call." msgstr "" -#: ../../library/functions.rst:1322 +#: ../../library/functions.rst:1324 msgid "The *opener* parameter was added." msgstr "增加了 *opener* 參數。" -#: ../../library/functions.rst:1323 +#: ../../library/functions.rst:1325 msgid "The ``'x'`` mode was added." msgstr "增加了 ``'x'`` 模式。" -#: ../../library/functions.rst:1324 +#: ../../library/functions.rst:1326 msgid ":exc:`IOError` used to be raised, it is now an alias of :exc:`OSError`." msgstr "過去觸發的 :exc:`IOError`,現在是 :exc:`OSError` 的別名。" -#: ../../library/functions.rst:1325 +#: ../../library/functions.rst:1327 msgid "" ":exc:`FileExistsError` is now raised if the file opened in exclusive " "creation mode (``'x'``) already exists." @@ -2224,15 +2227,15 @@ msgstr "" "如果檔案已存在但使用了唯一性建立模式 (\\ ``'x'``\\ ),現在會觸發 :exc:" "`FileExistsError`。" -#: ../../library/functions.rst:1331 +#: ../../library/functions.rst:1333 msgid "The file is now non-inheritable." msgstr "檔案在當前版本開始禁止繼承。" -#: ../../library/functions.rst:1335 +#: ../../library/functions.rst:1337 msgid "The ``'U'`` mode." msgstr "``'U'`` 模式。" -#: ../../library/functions.rst:1340 +#: ../../library/functions.rst:1342 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 :" @@ -2241,15 +2244,15 @@ msgstr "" "如果系統呼叫被中斷,但訊號處理程序沒有觸發例外,此函式現在會重試系統呼叫,而" "不是觸發 :exc:`InterruptedError`\\ (原因詳見 :pep:`475`)。" -#: ../../library/functions.rst:1343 +#: ../../library/functions.rst:1345 msgid "The ``'namereplace'`` error handler was added." msgstr "增加了 ``'namereplace'`` 錯誤處理程式。" -#: ../../library/functions.rst:1348 +#: ../../library/functions.rst:1350 msgid "Support added to accept objects implementing :class:`os.PathLike`." msgstr "增加對實現了 :class:`os.PathLike` 物件的支援。" -#: ../../library/functions.rst:1349 +#: ../../library/functions.rst:1351 msgid "" "On Windows, opening a console buffer may return a subclass of :class:`io." "RawIOBase` other than :class:`io.FileIO`." @@ -2257,7 +2260,7 @@ msgstr "" "在 Windows 上,開啟一個控制臺緩衝區可能會回傳 :class:`io.RawIOBase` 的 " "subclass,而不是 :class:`io.FileIO`。" -#: ../../library/functions.rst:1354 +#: ../../library/functions.rst:1356 msgid "" "Given a string representing one Unicode character, return an integer " "representing the Unicode code point of that character. For example, " @@ -2268,7 +2271,7 @@ msgstr "" "``ord('a')`` 回傳整數 ``97``、\\ ``ord('€')``\\ (歐元符號)回傳 ``8364``。這" "是 :func:`chr` 的逆函式。" -#: ../../library/functions.rst:1362 +#: ../../library/functions.rst:1364 msgid "" "Return *base* to the power *exp*; if *mod* is present, return *base* to the " "power *exp*, modulo *mod* (computed more efficiently than ``pow(base, exp) % " @@ -2279,7 +2282,7 @@ msgstr "" "*mod* 取餘數(比直接呼叫 ``pow(base, exp) % mod`` 計算更高效)。兩個引數形式" "的 ``pow(exp, exp)`` 等價於次方運算子:``base**exp``。" -#: ../../library/functions.rst:1367 +#: ../../library/functions.rst:1369 msgid "" "The arguments must have numeric types. With mixed operand types, the " "coercion rules for binary arithmetic operators apply. For :class:`int` " @@ -2292,7 +2295,7 @@ msgid "" "close to ``3j``." msgstr "" -#: ../../library/functions.rst:1377 +#: ../../library/functions.rst:1379 msgid "" "For :class:`int` operands *base* and *exp*, if *mod* is present, *mod* must " "also be of integer type and *mod* must be nonzero. If *mod* is present and " @@ -2301,29 +2304,29 @@ msgid "" "*base* modulo *mod*." msgstr "" -#: ../../library/functions.rst:1383 +#: ../../library/functions.rst:1385 msgid "Here's an example of computing an inverse for ``38`` modulo ``97``::" msgstr "" -#: ../../library/functions.rst:1390 +#: ../../library/functions.rst:1392 msgid "" "For :class:`int` operands, the three-argument form of ``pow`` now allows the " "second argument to be negative, permitting computation of modular inverses." msgstr "" -#: ../../library/functions.rst:1395 +#: ../../library/functions.rst:1397 msgid "" "Allow keyword arguments. Formerly, only positional arguments were supported." msgstr "" -#: ../../library/functions.rst:1402 +#: ../../library/functions.rst:1404 msgid "" "Print *objects* to the text stream *file*, separated by *sep* and followed " "by *end*. *sep*, *end*, *file*, and *flush*, if present, must be given as " "keyword arguments." msgstr "" -#: ../../library/functions.rst:1406 +#: ../../library/functions.rst:1408 msgid "" "All non-keyword arguments are converted to strings like :func:`str` does and " "written to the stream, separated by *sep* and followed by *end*. Both *sep* " @@ -2332,7 +2335,7 @@ msgid "" "*end*." msgstr "" -#: ../../library/functions.rst:1412 +#: ../../library/functions.rst:1414 msgid "" "The *file* argument must be an object with a ``write(string)`` method; if it " "is not present or ``None``, :data:`sys.stdout` will be used. Since printed " @@ -2340,38 +2343,38 @@ msgid "" "binary mode file objects. For these, use ``file.write(...)`` instead." msgstr "" -#: ../../library/functions.rst:1417 +#: ../../library/functions.rst:1419 msgid "" "Whether the output is buffered is usually determined by *file*, but if the " "*flush* keyword argument is true, the stream is forcibly flushed." msgstr "" -#: ../../library/functions.rst:1420 +#: ../../library/functions.rst:1422 msgid "Added the *flush* keyword argument." msgstr "增加了 *flush* 關鍵字引數。" -#: ../../library/functions.rst:1426 +#: ../../library/functions.rst:1428 msgid "Return a property attribute." msgstr "回傳 property 屬性。" -#: ../../library/functions.rst:1428 +#: ../../library/functions.rst:1430 msgid "" "*fget* is a function for getting an attribute value. *fset* is a function " "for setting an attribute value. *fdel* is a function for deleting an " "attribute value. And *doc* creates a docstring for the attribute." msgstr "" -#: ../../library/functions.rst:1432 +#: ../../library/functions.rst:1434 msgid "A typical use is to define a managed attribute ``x``::" msgstr "" -#: ../../library/functions.rst:1449 +#: ../../library/functions.rst:1451 msgid "" "If *c* is an instance of *C*, ``c.x`` will invoke the getter, ``c.x = " "value`` will invoke the setter, and ``del c.x`` the deleter." msgstr "" -#: ../../library/functions.rst:1452 +#: ../../library/functions.rst:1454 msgid "" "If given, *doc* will be the docstring of the property attribute. Otherwise, " "the property will copy *fget*'s docstring (if it exists). This makes it " @@ -2379,14 +2382,14 @@ msgid "" "term:`decorator`::" msgstr "" -#: ../../library/functions.rst:1465 +#: ../../library/functions.rst:1467 msgid "" "The ``@property`` decorator turns the :meth:`voltage` method into a \"getter" "\" for a read-only attribute with the same name, and it sets the docstring " "for *voltage* to \"Get the current voltage.\"" msgstr "" -#: ../../library/functions.rst:1469 +#: ../../library/functions.rst:1471 msgid "" "A property object has :attr:`~property.getter`, :attr:`~property.setter`, " "and :attr:`~property.deleter` methods usable as decorators that create a " @@ -2394,30 +2397,30 @@ msgid "" "decorated function. This is best explained with an example::" msgstr "" -#: ../../library/functions.rst:1491 +#: ../../library/functions.rst:1493 msgid "" "This code is exactly equivalent to the first example. Be sure to give the " "additional functions the same name as the original property (``x`` in this " "case.)" msgstr "" -#: ../../library/functions.rst:1495 +#: ../../library/functions.rst:1497 msgid "" "The returned property object also has the attributes ``fget``, ``fset``, and " "``fdel`` corresponding to the constructor arguments." msgstr "" -#: ../../library/functions.rst:1498 +#: ../../library/functions.rst:1500 msgid "The docstrings of property objects are now writeable." msgstr "" -#: ../../library/functions.rst:1507 +#: ../../library/functions.rst:1509 msgid "" "Rather than being a function, :class:`range` is actually an immutable " "sequence type, as documented in :ref:`typesseq-range` and :ref:`typesseq`." msgstr "" -#: ../../library/functions.rst:1513 +#: ../../library/functions.rst:1515 msgid "" "Return a string containing a printable representation of an object. For " "many types, this function makes an attempt to return a string that would " @@ -2430,7 +2433,7 @@ msgid "" "`RuntimeError`." msgstr "" -#: ../../library/functions.rst:1526 +#: ../../library/functions.rst:1528 msgid "" "Return a reverse :term:`iterator`. *seq* must be an object which has a :" "meth:`__reversed__` method or supports the sequence protocol (the :meth:" @@ -2438,14 +2441,14 @@ msgid "" "starting at ``0``)." msgstr "" -#: ../../library/functions.rst:1534 +#: ../../library/functions.rst:1536 msgid "" "Return *number* rounded to *ndigits* precision after the decimal point. If " "*ndigits* is omitted or is ``None``, it returns the nearest integer to its " "input." msgstr "" -#: ../../library/functions.rst:1538 +#: ../../library/functions.rst:1540 msgid "" "For the built-in types supporting :func:`round`, values are rounded to the " "closest multiple of 10 to the power minus *ndigits*; if two multiples are " @@ -2456,13 +2459,13 @@ msgid "" "``None``. Otherwise, the return value has the same type as *number*." msgstr "" -#: ../../library/functions.rst:1547 +#: ../../library/functions.rst:1549 msgid "" "For a general Python object ``number``, ``round`` delegates to ``number." "__round__``." msgstr "" -#: ../../library/functions.rst:1552 +#: ../../library/functions.rst:1554 msgid "" "The behavior of :func:`round` for floats can be surprising: for example, " "``round(2.675, 2)`` gives ``2.67`` instead of the expected ``2.68``. This is " @@ -2471,21 +2474,21 @@ msgid "" "information." msgstr "" -#: ../../library/functions.rst:1563 +#: ../../library/functions.rst:1565 msgid "" "Return a new :class:`set` object, optionally with elements taken from " "*iterable*. ``set`` is a built-in class. See :class:`set` and :ref:`types-" "set` for documentation about this class." msgstr "" -#: ../../library/functions.rst:1567 +#: ../../library/functions.rst:1569 msgid "" "For other containers see the built-in :class:`frozenset`, :class:`list`, :" "class:`tuple`, and :class:`dict` classes, as well as the :mod:`collections` " "module." msgstr "" -#: ../../library/functions.rst:1574 +#: ../../library/functions.rst:1576 msgid "" "This is the counterpart of :func:`getattr`. The arguments are an object, a " "string, and an arbitrary value. The string may name an existing attribute " @@ -2496,12 +2499,21 @@ msgstr "" #: ../../library/functions.rst:1582 msgid "" +"*name* need not be a Python identifier as defined in :ref:`identifiers` " +"unless the object chooses to enforce that, for example in a custom :meth:" +"`~object.__getattribute__` or via :attr:`~object.__slots__`. An attribute " +"whose name is not an identifier will not be accessible using the dot " +"notation, but is accessible through :func:`getattr` etc.." +msgstr "" + +#: ../../library/functions.rst:1590 +msgid "" "Since :ref:`private name mangling ` happens at " "compilation time, one must manually mangle a private attribute's (attributes " "with two leading underscores) name in order to set it with :func:`setattr`." msgstr "" -#: ../../library/functions.rst:1591 +#: ../../library/functions.rst:1599 msgid "" "Return a :term:`slice` object representing the set of indices specified by " "``range(start, stop, step)``. The *start* and *step* arguments default to " @@ -2514,35 +2526,35 @@ msgid "" "func:`itertools.islice` for an alternate version that returns an iterator." msgstr "" -#: ../../library/functions.rst:1604 +#: ../../library/functions.rst:1612 msgid "Return a new sorted list from the items in *iterable*." msgstr "" -#: ../../library/functions.rst:1606 +#: ../../library/functions.rst:1614 msgid "" "Has two optional arguments which must be specified as keyword arguments." msgstr "有兩個選擇性引數,只能使用關鍵字引數來指定。" -#: ../../library/functions.rst:1608 +#: ../../library/functions.rst:1616 msgid "" "*key* specifies a function of one argument that is used to extract a " "comparison key from each element in *iterable* (for example, ``key=str." "lower``). The default value is ``None`` (compare the elements directly)." msgstr "" -#: ../../library/functions.rst:1612 +#: ../../library/functions.rst:1620 msgid "" "*reverse* is a boolean value. If set to ``True``, then the list elements " "are sorted as if each comparison were reversed." msgstr "" -#: ../../library/functions.rst:1615 +#: ../../library/functions.rst:1623 msgid "" "Use :func:`functools.cmp_to_key` to convert an old-style *cmp* function to a " "*key* function." msgstr "" -#: ../../library/functions.rst:1618 +#: ../../library/functions.rst:1626 msgid "" "The built-in :func:`sorted` function is guaranteed to be stable. A sort is " "stable if it guarantees not to change the relative order of elements that " @@ -2550,7 +2562,7 @@ msgid "" "example, sort by department, then by salary grade)." msgstr "" -#: ../../library/functions.rst:1623 +#: ../../library/functions.rst:1631 msgid "" "The sort algorithm uses only ``<`` comparisons between items. While " "defining an :meth:`~object.__lt__` method will suffice for sorting, :PEP:`8` " @@ -2562,22 +2574,22 @@ msgid "" "method." msgstr "" -#: ../../library/functions.rst:1632 +#: ../../library/functions.rst:1640 msgid "" "For sorting examples and a brief sorting tutorial, see :ref:`sortinghowto`." msgstr "" -#: ../../library/functions.rst:1636 +#: ../../library/functions.rst:1644 msgid "Transform a method into a static method." msgstr "" -#: ../../library/functions.rst:1638 +#: ../../library/functions.rst:1646 msgid "" "A static method does not receive an implicit first argument. To declare a " "static method, use this idiom::" msgstr "" -#: ../../library/functions.rst:1645 +#: ../../library/functions.rst:1653 msgid "" "The ``@staticmethod`` form is a function :term:`decorator` -- see :ref:" "`function` for details." @@ -2585,21 +2597,21 @@ msgstr "" "``@staticmethod`` 語法是一個函式 :term:`decorator` - 參見 :ref:`function` 中" "的詳細介紹。" -#: ../../library/functions.rst:1648 +#: ../../library/functions.rst:1656 msgid "" "A static method can be called either on the class (such as ``C.f()``) or on " "an instance (such as ``C().f()``). Moreover, they can be called as regular " "functions (such as ``f()``)." msgstr "" -#: ../../library/functions.rst:1652 +#: ../../library/functions.rst:1660 msgid "" "Static methods in Python are similar to those found in Java or C++. Also, " "see :func:`classmethod` for a variant that is useful for creating alternate " "class constructors." msgstr "" -#: ../../library/functions.rst:1656 +#: ../../library/functions.rst:1664 msgid "" "Like all decorators, it is also possible to call ``staticmethod`` as a " "regular function and do something with its result. This is needed in some " @@ -2608,36 +2620,36 @@ msgid "" "cases, use this idiom::" msgstr "" -#: ../../library/functions.rst:1668 +#: ../../library/functions.rst:1676 msgid "For more information on static methods, see :ref:`types`." msgstr "關於 static method 的更多資訊,請參考 :ref:`types`。" -#: ../../library/functions.rst:1670 +#: ../../library/functions.rst:1678 msgid "" "Static methods now inherit the method attributes (``__module__``, " "``__name__``, ``__qualname__``, ``__doc__`` and ``__annotations__``), have a " "new ``__wrapped__`` attribute, and are now callable as regular functions." msgstr "" -#: ../../library/functions.rst:1685 +#: ../../library/functions.rst:1693 msgid "" "Return a :class:`str` version of *object*. See :func:`str` for details." msgstr "" -#: ../../library/functions.rst:1687 +#: ../../library/functions.rst:1695 msgid "" "``str`` is the built-in string :term:`class`. For general information about " "strings, see :ref:`textseq`." msgstr "" -#: ../../library/functions.rst:1693 +#: ../../library/functions.rst:1701 msgid "" "Sums *start* and the items of an *iterable* from left to right and returns " "the total. The *iterable*'s items are normally numbers, and the start value " "is not allowed to be a string." msgstr "" -#: ../../library/functions.rst:1697 +#: ../../library/functions.rst:1705 msgid "" "For some use cases, there are good alternatives to :func:`sum`. The " "preferred, fast way to concatenate a sequence of strings is by calling ``''." @@ -2646,31 +2658,31 @@ msgid "" "using :func:`itertools.chain`." msgstr "" -#: ../../library/functions.rst:1703 +#: ../../library/functions.rst:1711 msgid "The *start* parameter can be specified as a keyword argument." msgstr "*start* 參數可被指定為關鍵字引數。" -#: ../../library/functions.rst:1708 +#: ../../library/functions.rst:1716 msgid "" "Return a proxy object that delegates method calls to a parent or sibling " "class of *type*. This is useful for accessing inherited methods that have " "been overridden in a class." msgstr "" -#: ../../library/functions.rst:1712 +#: ../../library/functions.rst:1720 msgid "" "The *object-or-type* determines the :term:`method resolution order` to be " "searched. The search starts from the class right after the *type*." msgstr "" -#: ../../library/functions.rst:1716 +#: ../../library/functions.rst:1724 msgid "" "For example, if :attr:`~class.__mro__` of *object-or-type* is ``D -> B -> C -" "> A -> object`` and the value of *type* is ``B``, then :func:`super` " "searches ``C -> A -> object``." msgstr "" -#: ../../library/functions.rst:1720 +#: ../../library/functions.rst:1728 msgid "" "The :attr:`~class.__mro__` attribute of the *object-or-type* lists the " "method resolution search order used by both :func:`getattr` and :func:" @@ -2678,7 +2690,7 @@ msgid "" "hierarchy is updated." msgstr "" -#: ../../library/functions.rst:1725 +#: ../../library/functions.rst:1733 msgid "" "If the second argument is omitted, the super object returned is unbound. If " "the second argument is an object, ``isinstance(obj, type)`` must be true. " @@ -2686,7 +2698,7 @@ msgid "" "(this is useful for classmethods)." msgstr "" -#: ../../library/functions.rst:1730 +#: ../../library/functions.rst:1738 msgid "" "There are two typical use cases for *super*. In a class hierarchy with " "single inheritance, *super* can be used to refer to parent classes without " @@ -2694,7 +2706,7 @@ msgid "" "closely parallels the use of *super* in other programming languages." msgstr "" -#: ../../library/functions.rst:1735 +#: ../../library/functions.rst:1743 msgid "" "The second use case is to support cooperative multiple inheritance in a " "dynamic execution environment. This use case is unique to Python and is not " @@ -2707,18 +2719,18 @@ msgid "" "classes that are unknown prior to runtime)." msgstr "" -#: ../../library/functions.rst:1745 +#: ../../library/functions.rst:1753 msgid "For both use cases, a typical superclass call looks like this::" msgstr "" -#: ../../library/functions.rst:1752 +#: ../../library/functions.rst:1760 msgid "" "In addition to method lookups, :func:`super` also works for attribute " "lookups. One possible use case for this is calling :term:`descriptors " "` in a parent or sibling class." msgstr "" -#: ../../library/functions.rst:1756 +#: ../../library/functions.rst:1764 msgid "" "Note that :func:`super` is implemented as part of the binding process for " "explicit dotted attribute lookups such as ``super().__getitem__(name)``. It " @@ -2728,7 +2740,7 @@ msgid "" "using statements or operators such as ``super()[name]``." msgstr "" -#: ../../library/functions.rst:1763 +#: ../../library/functions.rst:1771 msgid "" "Also note that, aside from the zero argument form, :func:`super` is not " "limited to use inside methods. The two argument form specifies the " @@ -2738,33 +2750,33 @@ msgid "" "accessing the current instance for ordinary methods." msgstr "" -#: ../../library/functions.rst:1770 +#: ../../library/functions.rst:1778 msgid "" "For practical suggestions on how to design cooperative classes using :func:" "`super`, see `guide to using super() `_." msgstr "" -#: ../../library/functions.rst:1779 +#: ../../library/functions.rst:1787 msgid "" "Rather than being a function, :class:`tuple` is actually an immutable " "sequence type, as documented in :ref:`typesseq-tuple` and :ref:`typesseq`." msgstr "" -#: ../../library/functions.rst:1788 +#: ../../library/functions.rst:1796 msgid "" "With one argument, return the type of an *object*. The return value is a " "type object and generally the same object as returned by :attr:`object." "__class__ `." msgstr "" -#: ../../library/functions.rst:1792 +#: ../../library/functions.rst:1800 msgid "" "The :func:`isinstance` built-in function is recommended for testing the type " "of an object, because it takes subclasses into account." msgstr "" -#: ../../library/functions.rst:1796 +#: ../../library/functions.rst:1804 msgid "" "With three arguments, return a new type object. This is essentially a " "dynamic form of the :keyword:`class` statement. The *name* string is the " @@ -2777,11 +2789,11 @@ msgid "" "identical :class:`type` objects:" msgstr "" -#: ../../library/functions.rst:1811 +#: ../../library/functions.rst:1819 msgid "See also :ref:`bltin-type-objects`." msgstr "另請參閱 :ref:`bltin-type-objects`。" -#: ../../library/functions.rst:1813 +#: ../../library/functions.rst:1821 msgid "" "Keyword arguments provided to the three argument form are passed to the " "appropriate metaclass machinery (usually :meth:`~object.__init_subclass__`) " @@ -2789,23 +2801,23 @@ msgid "" "would." msgstr "" -#: ../../library/functions.rst:1818 +#: ../../library/functions.rst:1826 msgid "See also :ref:`class-customization`." msgstr "另請參閱 :ref:`class-customization`。" -#: ../../library/functions.rst:1820 +#: ../../library/functions.rst:1828 msgid "" "Subclasses of :class:`type` which don't override ``type.__new__`` may no " "longer use the one-argument form to get the type of an object." msgstr "" -#: ../../library/functions.rst:1826 +#: ../../library/functions.rst:1834 msgid "" "Return the :attr:`~object.__dict__` attribute for a module, class, instance, " "or any other object with a :attr:`~object.__dict__` attribute." msgstr "" -#: ../../library/functions.rst:1829 +#: ../../library/functions.rst:1837 msgid "" "Objects such as modules and instances have an updateable :attr:`~object." "__dict__` attribute; however, other objects may have write restrictions on " @@ -2813,54 +2825,54 @@ msgid "" "`types.MappingProxyType` to prevent direct dictionary updates)." msgstr "" -#: ../../library/functions.rst:1834 +#: ../../library/functions.rst:1842 msgid "" "Without an argument, :func:`vars` acts like :func:`locals`. Note, the " "locals dictionary is only useful for reads since updates to the locals " "dictionary are ignored." msgstr "" -#: ../../library/functions.rst:1838 +#: ../../library/functions.rst:1846 msgid "" "A :exc:`TypeError` exception is raised if an object is specified but it " "doesn't have a :attr:`~object.__dict__` attribute (for example, if its class " "defines the :attr:`~object.__slots__` attribute)." msgstr "" -#: ../../library/functions.rst:1844 +#: ../../library/functions.rst:1852 msgid "" "Iterate over several iterables in parallel, producing tuples with an item " "from each one." msgstr "" -#: ../../library/functions.rst:1847 +#: ../../library/functions.rst:1855 msgid "Example::" msgstr "" "例如:\n" "\n" "::" -#: ../../library/functions.rst:1856 +#: ../../library/functions.rst:1864 msgid "" "More formally: :func:`zip` returns an iterator of tuples, where the *i*-th " "tuple contains the *i*-th element from each of the argument iterables." msgstr "" -#: ../../library/functions.rst:1859 +#: ../../library/functions.rst:1867 msgid "" "Another way to think of :func:`zip` is that it turns rows into columns, and " "columns into rows. This is similar to `transposing a matrix `_." msgstr "" -#: ../../library/functions.rst:1863 +#: ../../library/functions.rst:1871 msgid "" ":func:`zip` is lazy: The elements won't be processed until the iterable is " "iterated on, e.g. by a :keyword:`!for` loop or by wrapping in a :class:" "`list`." msgstr "" -#: ../../library/functions.rst:1867 +#: ../../library/functions.rst:1875 msgid "" "One thing to consider is that the iterables passed to :func:`zip` could have " "different lengths; sometimes by design, and sometimes because of a bug in " @@ -2868,51 +2880,51 @@ msgid "" "approaches to dealing with this issue:" msgstr "" -#: ../../library/functions.rst:1872 +#: ../../library/functions.rst:1880 msgid "" "By default, :func:`zip` stops when the shortest iterable is exhausted. It " "will ignore the remaining items in the longer iterables, cutting off the " "result to the length of the shortest iterable::" msgstr "" -#: ../../library/functions.rst:1879 +#: ../../library/functions.rst:1887 msgid "" ":func:`zip` is often used in cases where the iterables are assumed to be of " "equal length. In such cases, it's recommended to use the ``strict=True`` " "option. Its output is the same as regular :func:`zip`::" msgstr "" -#: ../../library/functions.rst:1886 +#: ../../library/functions.rst:1894 msgid "" "Unlike the default behavior, it checks that the lengths of iterables are " "identical, raising a :exc:`ValueError` if they aren't:" msgstr "" -#: ../../library/functions.rst:1894 +#: ../../library/functions.rst:1902 msgid "" "Without the ``strict=True`` argument, any bug that results in iterables of " "different lengths will be silenced, possibly manifesting as a hard-to-find " "bug in another part of the program." msgstr "" -#: ../../library/functions.rst:1898 +#: ../../library/functions.rst:1906 msgid "" "Shorter iterables can be padded with a constant value to make all the " "iterables have the same length. This is done by :func:`itertools." "zip_longest`." msgstr "" -#: ../../library/functions.rst:1902 +#: ../../library/functions.rst:1910 msgid "" "Edge cases: With a single iterable argument, :func:`zip` returns an iterator " "of 1-tuples. With no arguments, it returns an empty iterator." msgstr "" -#: ../../library/functions.rst:1905 +#: ../../library/functions.rst:1913 msgid "Tips and tricks:" msgstr "" -#: ../../library/functions.rst:1907 +#: ../../library/functions.rst:1915 msgid "" "The left-to-right evaluation order of the iterables is guaranteed. This " "makes possible an idiom for clustering a data series into n-length groups " @@ -2921,23 +2933,23 @@ msgid "" "iterator. This has the effect of dividing the input into n-length chunks." msgstr "" -#: ../../library/functions.rst:1913 +#: ../../library/functions.rst:1921 msgid "" ":func:`zip` in conjunction with the ``*`` operator can be used to unzip a " "list::" msgstr "" -#: ../../library/functions.rst:1924 +#: ../../library/functions.rst:1932 msgid "Added the ``strict`` argument." msgstr "增加了 ``strict`` 引數。" -#: ../../library/functions.rst:1936 +#: ../../library/functions.rst:1944 msgid "" "This is an advanced function that is not needed in everyday Python " "programming, unlike :func:`importlib.import_module`." msgstr "" -#: ../../library/functions.rst:1939 +#: ../../library/functions.rst:1947 msgid "" "This function is invoked by the :keyword:`import` statement. It can be " "replaced (by importing the :mod:`builtins` module and assigning to " @@ -2949,7 +2961,7 @@ msgid "" "discouraged in favor of :func:`importlib.import_module`." msgstr "" -#: ../../library/functions.rst:1948 +#: ../../library/functions.rst:1956 msgid "" "The function imports the module *name*, potentially using the given " "*globals* and *locals* to determine how to interpret the name in a package " @@ -2959,7 +2971,7 @@ msgid "" "determine the package context of the :keyword:`import` statement." msgstr "" -#: ../../library/functions.rst:1955 +#: ../../library/functions.rst:1963 msgid "" "*level* specifies whether to use absolute or relative imports. ``0`` (the " "default) means only perform absolute imports. Positive values for *level* " @@ -2968,7 +2980,7 @@ msgid "" "details)." msgstr "" -#: ../../library/functions.rst:1961 +#: ../../library/functions.rst:1969 msgid "" "When the *name* variable is of the form ``package.module``, normally, the " "top-level package (the name up till the first dot) is returned, *not* the " @@ -2976,58 +2988,58 @@ msgid "" "given, the module named by *name* is returned." msgstr "" -#: ../../library/functions.rst:1966 +#: ../../library/functions.rst:1974 msgid "" "For example, the statement ``import spam`` results in bytecode resembling " "the following code::" msgstr "" -#: ../../library/functions.rst:1971 +#: ../../library/functions.rst:1979 msgid "The statement ``import spam.ham`` results in this call::" msgstr "" -#: ../../library/functions.rst:1975 +#: ../../library/functions.rst:1983 msgid "" "Note how :func:`__import__` returns the toplevel module here because this is " "the object that is bound to a name by the :keyword:`import` statement." msgstr "" -#: ../../library/functions.rst:1978 +#: ../../library/functions.rst:1986 msgid "" "On the other hand, the statement ``from spam.ham import eggs, sausage as " "saus`` results in ::" msgstr "" -#: ../../library/functions.rst:1985 +#: ../../library/functions.rst:1993 msgid "" "Here, the ``spam.ham`` module is returned from :func:`__import__`. From " "this object, the names to import are retrieved and assigned to their " "respective names." msgstr "" -#: ../../library/functions.rst:1989 +#: ../../library/functions.rst:1997 msgid "" "If you simply want to import a module (potentially within a package) by " "name, use :func:`importlib.import_module`." msgstr "" -#: ../../library/functions.rst:1992 +#: ../../library/functions.rst:2000 msgid "" "Negative values for *level* are no longer supported (which also changes the " "default value to 0)." msgstr "" -#: ../../library/functions.rst:1996 +#: ../../library/functions.rst:2004 msgid "" "When the command line options :option:`-E` or :option:`-I` are being used, " "the environment variable :envvar:`PYTHONCASEOK` is now ignored." msgstr "" -#: ../../library/functions.rst:2001 +#: ../../library/functions.rst:2009 msgid "Footnotes" msgstr "註解" -#: ../../library/functions.rst:2002 +#: ../../library/functions.rst:2010 msgid "" "Note that the parser only accepts the Unix-style end of line convention. If " "you are reading the code from a file, make sure to use newline conversion " diff --git a/library/json.po b/library/json.po index 4d080ca4e5..a7c47437e5 100644 --- a/library/json.po +++ b/library/json.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-09-03 00:15+0000\n" +"POT-Creation-Date: 2022-09-28 00:27+0000\n" "PO-Revision-Date: 2018-05-23 16:04+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -84,7 +84,7 @@ msgstr "更詳盡的文件請見 :ref:`json-commandline`\\ 。" #: ../../library/json.rst:123 msgid "" -"JSON is a subset of `YAML `_ 1.2. The JSON produced by " +"JSON is a subset of `YAML `_ 1.2. The JSON produced by " "this module's default settings (in particular, the default *separators* " "value) is also a subset of YAML 1.0 and 1.1. This module can thus also be " "used as a YAML serializer." diff --git a/library/mailbox.po b/library/mailbox.po index 5887ecb5f9..353b262e2b 100644 --- a/library/mailbox.po +++ b/library/mailbox.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-07-06 00:17+0000\n" +"POT-Creation-Date: 2022-09-28 00:27+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-" @@ -471,7 +471,7 @@ msgstr "" #: ../../library/mailbox.rst:431 msgid "" -"`maildir man page from Courier `_" +"`maildir man page from Courier `_" msgstr "" #: ../../library/mailbox.rst:430 @@ -690,7 +690,7 @@ msgid "" msgstr "" #: ../../library/mailbox.rst:618 -msgid "`nmh - Message Handling System `_" +msgid "`nmh - Message Handling System `_" msgstr "" #: ../../library/mailbox.rst:618 diff --git a/library/multiprocessing.shared_memory.po b/library/multiprocessing.shared_memory.po index b2fc24d4af..881a83cd3e 100644 --- a/library/multiprocessing.shared_memory.po +++ b/library/multiprocessing.shared_memory.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-06-25 00:15+0000\n" +"POT-Creation-Date: 2022-09-26 00:21+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-" @@ -136,8 +136,8 @@ msgstr "" #: ../../library/multiprocessing.shared_memory.rst:127 msgid "" "The following example demonstrates a practical use of the :class:" -"`SharedMemory` class with `NumPy arrays `_, " -"accessing the same ``numpy.ndarray`` from two distinct Python shells:" +"`SharedMemory` class with `NumPy arrays `_, accessing " +"the same ``numpy.ndarray`` from two distinct Python shells:" msgstr "" #: ../../library/multiprocessing.shared_memory.rst:181 diff --git a/library/pickle.po b/library/pickle.po index 3418c64d68..2dfd477a13 100644 --- a/library/pickle.po +++ b/library/pickle.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-05-21 17:35+0000\n" +"POT-Creation-Date: 2022-09-26 00:21+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-" @@ -131,7 +131,7 @@ msgstr "" #: ../../library/pickle.rst:92 msgid "" "There are fundamental differences between the pickle protocols and `JSON " -"(JavaScript Object Notation) `_:" +"(JavaScript Object Notation) `_:" msgstr "" #: ../../library/pickle.rst:95 diff --git a/library/random.po b/library/random.po index 87afcb718b..7da3b88f42 100644 --- a/library/random.po +++ b/library/random.po @@ -8,8 +8,8 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-10-26 16:47+0000\n" -"PO-Revision-Date: 2021-12-17 16:35+0800\n" +"POT-Creation-Date: 2022-09-28 00:27+0000\n" +"PO-Revision-Date: 2022-10-01 14:31+0800\n" "Last-Translator: Allen Wu \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -18,7 +18,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -"X-Generator: Poedit 3.0.1\n" +"X-Generator: Poedit 3.1.1\n" #: ../../library/random.rst:2 msgid ":mod:`random` --- Generate pseudo-random numbers" @@ -724,8 +724,8 @@ msgid "" msgstr "" "`重新取樣排列測試 `_\\ 的範例,來確定觀察到的藥物與安" -"慰劑之間差異的統計學意義或 `p 值 `_" -"\\ :\n" +"慰劑之間差異的統計學意義或 `p 值 `_\\ " +":\n" "\n" "::" @@ -750,27 +750,27 @@ msgstr "" #: ../../library/random.rst:548 msgid "" -"`Economics Simulation `_ a simulation of a marketplace by `Peter Norvig `_ a simulation of a marketplace by `Peter Norvig `_ that shows effective use of many of the tools and " "distributions provided by this module (gauss, uniform, sample, betavariate, " "choice, triangular, and randrange)." msgstr "" -"`Economics Simulation `_\\ 是由 `Peter Norvig `_ 對市場" -"進行的模擬,顯示了該模組提供的許多工具和分佈(高斯、均勻、樣本、 beta 變數、" -"選擇,三角形、隨機數)的有效使用。" +"`Economics Simulation `_\\ 是由 `Peter Norvig `_ 對市" +"場進行的模擬,顯示了該模組提供的許多工具和分佈(高斯、均勻、樣本、 beta 變" +"數、選擇,三角形、隨機數)的有效使用。" #: ../../library/random.rst:555 msgid "" -"`A Concrete Introduction to Probability (using Python) `_ a tutorial by `Peter " -"Norvig `_ covering the basics of probability " +"Norvig `_ covering the basics of probability " "theory, how to write simulations, and how to perform data analysis using " "Python." msgstr "" -"`機率的具體介紹(使用Python) `_\\ 為 `Peter Norvig `_\\ 為 `Peter Norvig `_ 的教學課程,涵蓋了機率理論的基礎知識與如何模擬以及使用 Python 執行數" "據分析。" diff --git a/library/subprocess.po b/library/subprocess.po index b0dc28bb93..de4d482129 100644 --- a/library/subprocess.po +++ b/library/subprocess.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-07-06 00:17+0000\n" +"POT-Creation-Date: 2022-10-01 00:26+0000\n" "PO-Revision-Date: 2018-05-23 16:11+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -155,7 +155,7 @@ msgid "" "that it ran successfully." msgstr "" -#: ../../library/subprocess.rst:124 ../../library/subprocess.rst:894 +#: ../../library/subprocess.rst:124 ../../library/subprocess.rst:899 msgid "" "A negative value ``-N`` indicates that the child was terminated by signal " "``N`` (POSIX only)." @@ -216,7 +216,7 @@ msgid "" "waiting for a child process." msgstr "" -#: ../../library/subprocess.rst:186 ../../library/subprocess.rst:225 +#: ../../library/subprocess.rst:186 ../../library/subprocess.rst:230 msgid "Command that was used to spawn the child process." msgstr "" @@ -224,44 +224,60 @@ msgstr "" msgid "Timeout in seconds." msgstr "" -#: ../../library/subprocess.rst:194 ../../library/subprocess.rst:229 +#: ../../library/subprocess.rst:194 msgid "" "Output of the child process if it was captured by :func:`run` or :func:" -"`check_output`. Otherwise, ``None``." +"`check_output`. Otherwise, ``None``. This is always :class:`bytes` when " +"any output was captured regardless of the ``text=True`` setting. It may " +"remain ``None`` instead of ``b''`` when no output was observed." msgstr "" -#: ../../library/subprocess.rst:199 ../../library/subprocess.rst:234 +#: ../../library/subprocess.rst:202 ../../library/subprocess.rst:239 msgid "Alias for output, for symmetry with :attr:`stderr`." msgstr "" -#: ../../library/subprocess.rst:203 ../../library/subprocess.rst:238 +#: ../../library/subprocess.rst:206 msgid "" "Stderr output of the child process if it was captured by :func:`run`. " -"Otherwise, ``None``." +"Otherwise, ``None``. This is always :class:`bytes` when stderr output was " +"captured regardless of the ``text=True`` setting. It may remain ``None`` " +"instead of ``b''`` when no stderr output was observed." msgstr "" -#: ../../library/subprocess.rst:208 ../../library/subprocess.rst:241 +#: ../../library/subprocess.rst:213 ../../library/subprocess.rst:246 msgid "*stdout* and *stderr* attributes added" msgstr "" -#: ../../library/subprocess.rst:213 +#: ../../library/subprocess.rst:218 msgid "" "Subclass of :exc:`SubprocessError`, raised when a process run by :func:" "`check_call`, :func:`check_output`, or :func:`run` (with ``check=True``) " "returns a non-zero exit status." msgstr "" -#: ../../library/subprocess.rst:220 +#: ../../library/subprocess.rst:225 msgid "" "Exit status of the child process. If the process exited due to a signal, " "this will be the negative signal number." msgstr "" -#: ../../library/subprocess.rst:248 +#: ../../library/subprocess.rst:234 +msgid "" +"Output of the child process if it was captured by :func:`run` or :func:" +"`check_output`. Otherwise, ``None``." +msgstr "" + +#: ../../library/subprocess.rst:243 +msgid "" +"Stderr output of the child process if it was captured by :func:`run`. " +"Otherwise, ``None``." +msgstr "" + +#: ../../library/subprocess.rst:253 msgid "Frequently Used Arguments" msgstr "" -#: ../../library/subprocess.rst:250 +#: ../../library/subprocess.rst:255 msgid "" "To support a wide variety of use cases, the :class:`Popen` constructor (and " "the convenience functions) accept a large number of optional arguments. For " @@ -269,7 +285,7 @@ msgid "" "default values. The arguments that are most commonly needed are:" msgstr "" -#: ../../library/subprocess.rst:255 +#: ../../library/subprocess.rst:260 msgid "" "*args* is required for all calls and should be a string, or a sequence of " "program arguments. Providing a sequence of arguments is generally preferred, " @@ -279,7 +295,7 @@ msgid "" "simply name the program to be executed without specifying any arguments." msgstr "" -#: ../../library/subprocess.rst:263 +#: ../../library/subprocess.rst:268 msgid "" "*stdin*, *stdout* and *stderr* specify the executed program's standard " "input, standard output and standard error file handles, respectively. Valid " @@ -294,7 +310,7 @@ msgid "" "handle as for *stdout*." msgstr "" -#: ../../library/subprocess.rst:278 +#: ../../library/subprocess.rst:283 msgid "" "If *encoding* or *errors* are specified, or *text* (also known as " "*universal_newlines*) is true, the file objects *stdin*, *stdout* and " @@ -302,7 +318,7 @@ msgid "" "specified in the call or the defaults for :class:`io.TextIOWrapper`." msgstr "" -#: ../../library/subprocess.rst:284 +#: ../../library/subprocess.rst:289 msgid "" "For *stdin*, line ending characters ``'\\n'`` in the input will be converted " "to the default line separator :data:`os.linesep`. For *stdout* and *stderr*, " @@ -311,28 +327,28 @@ msgid "" "when the *newline* argument to its constructor is ``None``." msgstr "" -#: ../../library/subprocess.rst:290 +#: ../../library/subprocess.rst:295 msgid "" "If text mode is not used, *stdin*, *stdout* and *stderr* will be opened as " "binary streams. No encoding or line ending conversion is performed." msgstr "" -#: ../../library/subprocess.rst:293 +#: ../../library/subprocess.rst:298 msgid "Added *encoding* and *errors* parameters." msgstr "新增 *encoding* 與 *errors* 參數。" -#: ../../library/subprocess.rst:296 +#: ../../library/subprocess.rst:301 msgid "Added the *text* parameter as an alias for *universal_newlines*." msgstr "" -#: ../../library/subprocess.rst:301 +#: ../../library/subprocess.rst:306 msgid "" "The newlines attribute of the file objects :attr:`Popen.stdin`, :attr:`Popen." "stdout` and :attr:`Popen.stderr` are not updated by the :meth:`Popen." "communicate` method." msgstr "" -#: ../../library/subprocess.rst:305 +#: ../../library/subprocess.rst:310 msgid "" "If *shell* is ``True``, the specified command will be executed through the " "shell. This can be useful if you are using Python primarily for the " @@ -345,7 +361,7 @@ msgid "" "expanduser`, and :mod:`shutil`)." msgstr "" -#: ../../library/subprocess.rst:315 +#: ../../library/subprocess.rst:320 msgid "" "When *universal_newlines* is ``True``, the class uses the encoding :func:" "`locale.getpreferredencoding(False) ` instead " @@ -353,22 +369,22 @@ msgid "" "class for more information on this change." msgstr "" -#: ../../library/subprocess.rst:323 ../../library/subprocess.rst:443 +#: ../../library/subprocess.rst:328 ../../library/subprocess.rst:448 msgid "" "Read the `Security Considerations`_ section before using ``shell=True``." msgstr "" -#: ../../library/subprocess.rst:325 +#: ../../library/subprocess.rst:330 msgid "" "These options, along with all of the other options, are described in more " "detail in the :class:`Popen` constructor documentation." msgstr "" -#: ../../library/subprocess.rst:330 +#: ../../library/subprocess.rst:335 msgid "Popen Constructor" msgstr "" -#: ../../library/subprocess.rst:332 +#: ../../library/subprocess.rst:337 msgid "" "The underlying process creation and management in this module is handled by " "the :class:`Popen` class. It offers a lot of flexibility so that developers " @@ -376,7 +392,7 @@ msgid "" "functions." msgstr "" -#: ../../library/subprocess.rst:346 +#: ../../library/subprocess.rst:351 msgid "" "Execute a child program in a new process. On POSIX, the class uses :meth:" "`os.execvpe`-like behavior to execute the child program. On Windows, the " @@ -384,7 +400,7 @@ msgid "" "class:`Popen` are as follows." msgstr "" -#: ../../library/subprocess.rst:351 +#: ../../library/subprocess.rst:356 msgid "" "*args* should be a sequence of program arguments or else a single string or :" "term:`path-like object`. By default, the program to execute is the first " @@ -395,7 +411,7 @@ msgid "" "sequence." msgstr "" -#: ../../library/subprocess.rst:361 +#: ../../library/subprocess.rst:366 msgid "" "For maximum reliability, use a fully qualified path for the executable. To " "search for an unqualified name on :envvar:`PATH`, use :meth:`shutil.which`. " @@ -404,7 +420,7 @@ msgid "" "format to launch an installed module." msgstr "" -#: ../../library/subprocess.rst:367 +#: ../../library/subprocess.rst:372 msgid "" "Resolving the path of *executable* (or the first item of *args*) is platform " "dependent. For POSIX, see :meth:`os.execvpe`, and note that when resolving " @@ -418,27 +434,27 @@ msgid "" "variations." msgstr "" -#: ../../library/subprocess.rst:378 +#: ../../library/subprocess.rst:383 msgid "" "An example of passing some arguments to an external program as a sequence " "is::" msgstr "" -#: ../../library/subprocess.rst:383 +#: ../../library/subprocess.rst:388 msgid "" "On POSIX, if *args* is a string, the string is interpreted as the name or " "path of the program to execute. However, this can only be done if not " "passing arguments to the program." msgstr "" -#: ../../library/subprocess.rst:389 +#: ../../library/subprocess.rst:394 msgid "" "It may not be obvious how to break a shell command into a sequence of " "arguments, especially in complex cases. :meth:`shlex.split` can illustrate " "how to determine the correct tokenization for *args*::" msgstr "" -#: ../../library/subprocess.rst:401 +#: ../../library/subprocess.rst:406 msgid "" "Note in particular that options (such as *-input*) and arguments (such as " "*eggs.txt*) that are separated by whitespace in the shell go in separate " @@ -447,33 +463,33 @@ msgid "" "shown above) are single list elements." msgstr "" -#: ../../library/subprocess.rst:407 +#: ../../library/subprocess.rst:412 msgid "" "On Windows, if *args* is a sequence, it will be converted to a string in a " "manner described in :ref:`converting-argument-sequence`. This is because " "the underlying ``CreateProcess()`` operates on strings." msgstr "" -#: ../../library/subprocess.rst:411 +#: ../../library/subprocess.rst:416 msgid "" "*args* parameter accepts a :term:`path-like object` if *shell* is ``False`` " "and a sequence containing path-like objects on POSIX." msgstr "" -#: ../../library/subprocess.rst:415 +#: ../../library/subprocess.rst:420 msgid "" "*args* parameter accepts a :term:`path-like object` if *shell* is ``False`` " "and a sequence containing bytes and path-like objects on Windows." msgstr "" -#: ../../library/subprocess.rst:420 +#: ../../library/subprocess.rst:425 msgid "" "The *shell* argument (which defaults to ``False``) specifies whether to use " "the shell as the program to execute. If *shell* is ``True``, it is " "recommended to pass *args* as a string rather than as a sequence." msgstr "" -#: ../../library/subprocess.rst:424 +#: ../../library/subprocess.rst:429 msgid "" "On POSIX with ``shell=True``, the shell defaults to :file:`/bin/sh`. If " "*args* is a string, the string specifies the command to execute through the " @@ -485,7 +501,7 @@ msgid "" "class:`Popen` does the equivalent of::" msgstr "" -#: ../../library/subprocess.rst:435 +#: ../../library/subprocess.rst:440 msgid "" "On Windows with ``shell=True``, the :envvar:`COMSPEC` environment variable " "specifies the default shell. The only time you need to specify " @@ -494,35 +510,35 @@ msgid "" "``shell=True`` to run a batch file or console-based executable." msgstr "" -#: ../../library/subprocess.rst:445 +#: ../../library/subprocess.rst:450 msgid "" "*bufsize* will be supplied as the corresponding argument to the :func:`open` " "function when creating the stdin/stdout/stderr pipe file objects:" msgstr "" -#: ../../library/subprocess.rst:449 +#: ../../library/subprocess.rst:454 msgid "" ":const:`0` means unbuffered (read and write are one system call and can " "return short)" msgstr "" -#: ../../library/subprocess.rst:451 +#: ../../library/subprocess.rst:456 msgid "" ":const:`1` means line buffered (only usable if ``universal_newlines=True`` i." "e., in a text mode)" msgstr "" -#: ../../library/subprocess.rst:453 +#: ../../library/subprocess.rst:458 msgid "any other positive value means use a buffer of approximately that size" msgstr "" -#: ../../library/subprocess.rst:455 +#: ../../library/subprocess.rst:460 msgid "" "negative bufsize (the default) means the system default of io." "DEFAULT_BUFFER_SIZE will be used." msgstr "" -#: ../../library/subprocess.rst:458 +#: ../../library/subprocess.rst:463 msgid "" "*bufsize* now defaults to -1 to enable buffering by default to match the " "behavior that most code expects. In versions prior to Python 3.2.4 and " @@ -531,7 +547,7 @@ msgid "" "of Python 2 as most code expected." msgstr "" -#: ../../library/subprocess.rst:465 +#: ../../library/subprocess.rst:470 msgid "" "The *executable* argument specifies a replacement program to execute. It " "is very seldom needed. When ``shell=False``, *executable* replaces the " @@ -544,17 +560,17 @@ msgid "" "default :file:`/bin/sh`." msgstr "" -#: ../../library/subprocess.rst:475 +#: ../../library/subprocess.rst:480 msgid "*executable* parameter accepts a :term:`path-like object` on POSIX." msgstr "" -#: ../../library/subprocess.rst:478 +#: ../../library/subprocess.rst:483 msgid "" "*executable* parameter accepts a bytes and :term:`path-like object` on " "Windows." msgstr "" -#: ../../library/subprocess.rst:482 +#: ../../library/subprocess.rst:487 msgid "" "*stdin*, *stdout* and *stderr* specify the executed program's standard " "input, standard output and standard error file handles, respectively. Valid " @@ -569,13 +585,13 @@ msgid "" "handle as for stdout." msgstr "" -#: ../../library/subprocess.rst:494 +#: ../../library/subprocess.rst:499 msgid "" "If *preexec_fn* is set to a callable object, this object will be called in " "the child process just before the child is executed. (POSIX only)" msgstr "" -#: ../../library/subprocess.rst:500 +#: ../../library/subprocess.rst:505 msgid "" "The *preexec_fn* parameter is not safe to use in the presence of threads in " "your application. The child process could deadlock before exec is called. " @@ -583,7 +599,7 @@ msgid "" "call into." msgstr "" -#: ../../library/subprocess.rst:508 +#: ../../library/subprocess.rst:513 msgid "" "If you need to modify the environment for the child use the *env* parameter " "rather than doing it in a *preexec_fn*. The *start_new_session* parameter " @@ -591,7 +607,7 @@ msgid "" "setsid() in the child." msgstr "" -#: ../../library/subprocess.rst:515 +#: ../../library/subprocess.rst:520 msgid "" "The *preexec_fn* parameter is no longer supported in subinterpreters. The " "use of the parameter in a subinterpreter raises :exc:`RuntimeError`. The new " @@ -599,7 +615,7 @@ msgid "" "and other embedded environments." msgstr "" -#: ../../library/subprocess.rst:520 +#: ../../library/subprocess.rst:525 msgid "" "If *close_fds* is true, all file descriptors except :const:`0`, :const:`1` " "and :const:`2` will be closed before the child process is executed. " @@ -607,38 +623,38 @@ msgid "" "flag as described in :ref:`fd_inheritance`." msgstr "" -#: ../../library/subprocess.rst:525 +#: ../../library/subprocess.rst:530 msgid "" "On Windows, if *close_fds* is true then no handles will be inherited by the " "child process unless explicitly passed in the ``handle_list`` element of :" "attr:`STARTUPINFO.lpAttributeList`, or by standard handle redirection." msgstr "" -#: ../../library/subprocess.rst:529 +#: ../../library/subprocess.rst:534 msgid "" "The default for *close_fds* was changed from :const:`False` to what is " "described above." msgstr "" -#: ../../library/subprocess.rst:533 +#: ../../library/subprocess.rst:538 msgid "" "On Windows the default for *close_fds* was changed from :const:`False` to :" "const:`True` when redirecting the standard handles. It's now possible to set " "*close_fds* to :const:`True` when redirecting the standard handles." msgstr "" -#: ../../library/subprocess.rst:538 +#: ../../library/subprocess.rst:543 msgid "" "*pass_fds* is an optional sequence of file descriptors to keep open between " "the parent and child. Providing any *pass_fds* forces *close_fds* to be :" "const:`True`. (POSIX only)" msgstr "" -#: ../../library/subprocess.rst:542 +#: ../../library/subprocess.rst:547 msgid "The *pass_fds* parameter was added." msgstr "新增 *pass_fds* 參數。" -#: ../../library/subprocess.rst:545 +#: ../../library/subprocess.rst:550 msgid "" "If *cwd* is not ``None``, the function changes the working directory to " "*cwd* before executing the child. *cwd* can be a string, bytes or :term:" @@ -647,40 +663,40 @@ msgid "" "executable path is a relative path." msgstr "" -#: ../../library/subprocess.rst:551 +#: ../../library/subprocess.rst:556 msgid "*cwd* parameter accepts a :term:`path-like object` on POSIX." msgstr "" -#: ../../library/subprocess.rst:554 +#: ../../library/subprocess.rst:559 msgid "*cwd* parameter accepts a :term:`path-like object` on Windows." msgstr "" -#: ../../library/subprocess.rst:557 +#: ../../library/subprocess.rst:562 msgid "*cwd* parameter accepts a bytes object on Windows." msgstr "" -#: ../../library/subprocess.rst:560 +#: ../../library/subprocess.rst:565 msgid "" "If *restore_signals* is true (the default) all signals that Python has set " "to SIG_IGN are restored to SIG_DFL in the child process before the exec. " "Currently this includes the SIGPIPE, SIGXFZ and SIGXFSZ signals. (POSIX only)" msgstr "" -#: ../../library/subprocess.rst:565 +#: ../../library/subprocess.rst:570 msgid "*restore_signals* was added." msgstr "新增 *restore_signals*\\ 。" -#: ../../library/subprocess.rst:568 +#: ../../library/subprocess.rst:573 msgid "" "If *start_new_session* is true the setsid() system call will be made in the " "child process prior to the execution of the subprocess. (POSIX only)" msgstr "" -#: ../../library/subprocess.rst:571 +#: ../../library/subprocess.rst:576 msgid "*start_new_session* was added." msgstr "新增 *start_new_session*\\ 。" -#: ../../library/subprocess.rst:574 +#: ../../library/subprocess.rst:579 msgid "" "If *group* is not ``None``, the setregid() system call will be made in the " "child process prior to the execution of the subprocess. If the provided " @@ -689,12 +705,12 @@ msgid "" "passed verbatim. (POSIX only)" msgstr "" -#: ../../library/subprocess.rst:580 ../../library/subprocess.rst:589 -#: ../../library/subprocess.rst:598 ../../library/subprocess.rst:604 +#: ../../library/subprocess.rst:585 ../../library/subprocess.rst:594 +#: ../../library/subprocess.rst:603 ../../library/subprocess.rst:609 msgid ":ref:`Availability `: POSIX" msgstr ":ref:`適用 `:POSIX" -#: ../../library/subprocess.rst:583 +#: ../../library/subprocess.rst:588 msgid "" "If *extra_groups* is not ``None``, the setgroups() system call will be made " "in the child process prior to the execution of the subprocess. Strings " @@ -703,7 +719,7 @@ msgid "" "verbatim. (POSIX only)" msgstr "" -#: ../../library/subprocess.rst:592 +#: ../../library/subprocess.rst:597 msgid "" "If *user* is not ``None``, the setreuid() system call will be made in the " "child process prior to the execution of the subprocess. If the provided " @@ -712,27 +728,27 @@ msgid "" "passed verbatim. (POSIX only)" msgstr "" -#: ../../library/subprocess.rst:601 +#: ../../library/subprocess.rst:606 msgid "" "If *umask* is not negative, the umask() system call will be made in the " "child process prior to the execution of the subprocess." msgstr "" -#: ../../library/subprocess.rst:607 +#: ../../library/subprocess.rst:612 msgid "" "If *env* is not ``None``, it must be a mapping that defines the environment " "variables for the new process; these are used instead of the default " "behavior of inheriting the current process' environment." msgstr "" -#: ../../library/subprocess.rst:613 +#: ../../library/subprocess.rst:618 msgid "" "If specified, *env* must provide any variables required for the program to " "execute. On Windows, in order to run a `side-by-side assembly`_ the " "specified *env* **must** include a valid :envvar:`SystemRoot`." msgstr "" -#: ../../library/subprocess.rst:619 +#: ../../library/subprocess.rst:624 msgid "" "If *encoding* or *errors* are specified, or *text* is true, the file objects " "*stdin*, *stdout* and *stderr* are opened in text mode with the specified " @@ -742,70 +758,70 @@ msgid "" "in binary mode." msgstr "" -#: ../../library/subprocess.rst:625 +#: ../../library/subprocess.rst:630 msgid "*encoding* and *errors* were added." msgstr "新增 *encoding* 與 *errors*\\ 。" -#: ../../library/subprocess.rst:628 ../../library/subprocess.rst:1229 +#: ../../library/subprocess.rst:633 ../../library/subprocess.rst:1234 msgid "*text* was added as a more readable alias for *universal_newlines*." msgstr "" -#: ../../library/subprocess.rst:631 +#: ../../library/subprocess.rst:636 msgid "" "If given, *startupinfo* will be a :class:`STARTUPINFO` object, which is " "passed to the underlying ``CreateProcess`` function. *creationflags*, if " "given, can be one or more of the following flags:" msgstr "" -#: ../../library/subprocess.rst:635 +#: ../../library/subprocess.rst:640 msgid ":data:`CREATE_NEW_CONSOLE`" msgstr ":data:`CREATE_NEW_CONSOLE`" -#: ../../library/subprocess.rst:636 +#: ../../library/subprocess.rst:641 msgid ":data:`CREATE_NEW_PROCESS_GROUP`" msgstr ":data:`CREATE_NEW_PROCESS_GROUP`" -#: ../../library/subprocess.rst:637 +#: ../../library/subprocess.rst:642 msgid ":data:`ABOVE_NORMAL_PRIORITY_CLASS`" msgstr ":data:`ABOVE_NORMAL_PRIORITY_CLASS`" -#: ../../library/subprocess.rst:638 +#: ../../library/subprocess.rst:643 msgid ":data:`BELOW_NORMAL_PRIORITY_CLASS`" msgstr ":data:`BELOW_NORMAL_PRIORITY_CLASS`" -#: ../../library/subprocess.rst:639 +#: ../../library/subprocess.rst:644 msgid ":data:`HIGH_PRIORITY_CLASS`" msgstr ":data:`HIGH_PRIORITY_CLASS`" -#: ../../library/subprocess.rst:640 +#: ../../library/subprocess.rst:645 msgid ":data:`IDLE_PRIORITY_CLASS`" msgstr ":data:`IDLE_PRIORITY_CLASS`" -#: ../../library/subprocess.rst:641 +#: ../../library/subprocess.rst:646 msgid ":data:`NORMAL_PRIORITY_CLASS`" msgstr ":data:`NORMAL_PRIORITY_CLASS`" -#: ../../library/subprocess.rst:642 +#: ../../library/subprocess.rst:647 msgid ":data:`REALTIME_PRIORITY_CLASS`" msgstr ":data:`REALTIME_PRIORITY_CLASS`" -#: ../../library/subprocess.rst:643 +#: ../../library/subprocess.rst:648 msgid ":data:`CREATE_NO_WINDOW`" msgstr ":data:`CREATE_NO_WINDOW`" -#: ../../library/subprocess.rst:644 +#: ../../library/subprocess.rst:649 msgid ":data:`DETACHED_PROCESS`" msgstr ":data:`DETACHED_PROCESS`" -#: ../../library/subprocess.rst:645 +#: ../../library/subprocess.rst:650 msgid ":data:`CREATE_DEFAULT_ERROR_MODE`" msgstr ":data:`CREATE_DEFAULT_ERROR_MODE`" -#: ../../library/subprocess.rst:646 +#: ../../library/subprocess.rst:651 msgid ":data:`CREATE_BREAKAWAY_FROM_JOB`" msgstr ":data:`CREATE_BREAKAWAY_FROM_JOB`" -#: ../../library/subprocess.rst:648 +#: ../../library/subprocess.rst:653 msgid "" "*pipesize* can be used to change the size of the pipe when :data:`PIPE` is " "used for *stdin*, *stdout* or *stderr*. The size of the pipe is only changed " @@ -813,24 +829,24 @@ msgid "" "platforms will ignore this parameter." msgstr "" -#: ../../library/subprocess.rst:653 +#: ../../library/subprocess.rst:658 msgid "The ``pipesize`` parameter was added." msgstr "新增 ``pipesize`` 參數。" -#: ../../library/subprocess.rst:656 +#: ../../library/subprocess.rst:661 msgid "" "Popen objects are supported as context managers via the :keyword:`with` " "statement: on exit, standard file descriptors are closed, and the process is " "waited for. ::" msgstr "" -#: ../../library/subprocess.rst:663 +#: ../../library/subprocess.rst:668 msgid "" "Raises an :ref:`auditing event ` ``subprocess.Popen`` with " "arguments ``executable``, ``args``, ``cwd``, ``env``." msgstr "" -#: ../../library/subprocess.rst:665 +#: ../../library/subprocess.rst:670 msgid "" "Popen and the other functions in this module that use it raise an :ref:" "`auditing event ` ``subprocess.Popen`` with arguments " @@ -838,17 +854,17 @@ msgid "" "be a single string or a list of strings, depending on platform." msgstr "" -#: ../../library/subprocess.rst:670 +#: ../../library/subprocess.rst:675 msgid "Added context manager support." msgstr "" -#: ../../library/subprocess.rst:673 +#: ../../library/subprocess.rst:678 msgid "" "Popen destructor now emits a :exc:`ResourceWarning` warning if the child " "process is still running." msgstr "" -#: ../../library/subprocess.rst:677 +#: ../../library/subprocess.rst:682 msgid "" "Popen can use :func:`os.posix_spawn` in some cases for better performance. " "On Windows Subsystem for Linux and QEMU User Emulation, Popen constructor " @@ -857,17 +873,17 @@ msgid "" "returncode`." msgstr "" -#: ../../library/subprocess.rst:686 +#: ../../library/subprocess.rst:691 msgid "Exceptions" msgstr "例外" -#: ../../library/subprocess.rst:688 +#: ../../library/subprocess.rst:693 msgid "" "Exceptions raised in the child process, before the new program has started " "to execute, will be re-raised in the parent." msgstr "" -#: ../../library/subprocess.rst:691 +#: ../../library/subprocess.rst:696 msgid "" "The most common exception raised is :exc:`OSError`. This occurs, for " "example, when trying to execute a non-existent file. Applications should " @@ -878,39 +894,39 @@ msgid "" "subprocess." msgstr "" -#: ../../library/subprocess.rst:698 +#: ../../library/subprocess.rst:703 msgid "" "A :exc:`ValueError` will be raised if :class:`Popen` is called with invalid " "arguments." msgstr "" -#: ../../library/subprocess.rst:701 +#: ../../library/subprocess.rst:706 msgid "" ":func:`check_call` and :func:`check_output` will raise :exc:" "`CalledProcessError` if the called process returns a non-zero return code." msgstr "" -#: ../../library/subprocess.rst:705 +#: ../../library/subprocess.rst:710 msgid "" "All of the functions and methods that accept a *timeout* parameter, such as :" "func:`call` and :meth:`Popen.communicate` will raise :exc:`TimeoutExpired` " "if the timeout expires before the process exits." msgstr "" -#: ../../library/subprocess.rst:709 +#: ../../library/subprocess.rst:714 msgid "" "Exceptions defined in this module all inherit from :exc:`SubprocessError`." msgstr "" -#: ../../library/subprocess.rst:711 +#: ../../library/subprocess.rst:716 msgid "The :exc:`SubprocessError` base class was added." msgstr "" -#: ../../library/subprocess.rst:717 +#: ../../library/subprocess.rst:722 msgid "Security Considerations" msgstr "" -#: ../../library/subprocess.rst:719 +#: ../../library/subprocess.rst:724 msgid "" "Unlike some other popen functions, this implementation will never implicitly " "call a system shell. This means that all characters, including shell " @@ -923,34 +939,34 @@ msgid "" "escaping." msgstr "" -#: ../../library/subprocess.rst:731 +#: ../../library/subprocess.rst:736 msgid "Popen Objects" msgstr "" -#: ../../library/subprocess.rst:733 +#: ../../library/subprocess.rst:738 msgid "Instances of the :class:`Popen` class have the following methods:" msgstr "" -#: ../../library/subprocess.rst:738 +#: ../../library/subprocess.rst:743 msgid "" "Check if child process has terminated. Set and return :attr:`~Popen." "returncode` attribute. Otherwise, returns ``None``." msgstr "" -#: ../../library/subprocess.rst:744 +#: ../../library/subprocess.rst:749 msgid "" "Wait for child process to terminate. Set and return :attr:`~Popen." "returncode` attribute." msgstr "" -#: ../../library/subprocess.rst:747 +#: ../../library/subprocess.rst:752 msgid "" "If the process does not terminate after *timeout* seconds, raise a :exc:" "`TimeoutExpired` exception. It is safe to catch this exception and retry " "the wait." msgstr "" -#: ../../library/subprocess.rst:753 +#: ../../library/subprocess.rst:758 msgid "" "This will deadlock when using ``stdout=PIPE`` or ``stderr=PIPE`` and the " "child process generates enough output to a pipe such that it blocks waiting " @@ -958,20 +974,20 @@ msgid "" "when using pipes to avoid that." msgstr "" -#: ../../library/subprocess.rst:760 +#: ../../library/subprocess.rst:765 msgid "" "The function is implemented using a busy loop (non-blocking call and short " "sleeps). Use the :mod:`asyncio` module for an asynchronous wait: see :class:" "`asyncio.create_subprocess_exec`." msgstr "" -#: ../../library/subprocess.rst:764 ../../library/subprocess.rst:805 -#: ../../library/subprocess.rst:1142 ../../library/subprocess.rst:1174 -#: ../../library/subprocess.rst:1220 +#: ../../library/subprocess.rst:769 ../../library/subprocess.rst:810 +#: ../../library/subprocess.rst:1147 ../../library/subprocess.rst:1179 +#: ../../library/subprocess.rst:1225 msgid "*timeout* was added." msgstr "新增 *timeout*\\ 。" -#: ../../library/subprocess.rst:769 +#: ../../library/subprocess.rst:774 msgid "" "Interact with process: Send data to stdin. Read data from stdout and " "stderr, until end-of-file is reached. Wait for process to terminate and set " @@ -981,13 +997,13 @@ msgid "" "must be a string. Otherwise, it must be bytes." msgstr "" -#: ../../library/subprocess.rst:776 +#: ../../library/subprocess.rst:781 msgid "" ":meth:`communicate` returns a tuple ``(stdout_data, stderr_data)``. The data " "will be strings if streams were opened in text mode; otherwise, bytes." msgstr "" -#: ../../library/subprocess.rst:780 +#: ../../library/subprocess.rst:785 msgid "" "Note that if you want to send data to the process's stdin, you need to " "create the Popen object with ``stdin=PIPE``. Similarly, to get anything " @@ -995,65 +1011,65 @@ msgid "" "and/or ``stderr=PIPE`` too." msgstr "" -#: ../../library/subprocess.rst:785 +#: ../../library/subprocess.rst:790 msgid "" "If the process does not terminate after *timeout* seconds, a :exc:" "`TimeoutExpired` exception will be raised. Catching this exception and " "retrying communication will not lose any output." msgstr "" -#: ../../library/subprocess.rst:789 +#: ../../library/subprocess.rst:794 msgid "" "The child process is not killed if the timeout expires, so in order to " "cleanup properly a well-behaved application should kill the child process " "and finish communication::" msgstr "" -#: ../../library/subprocess.rst:802 +#: ../../library/subprocess.rst:807 msgid "" "The data read is buffered in memory, so do not use this method if the data " "size is large or unlimited." msgstr "" -#: ../../library/subprocess.rst:811 +#: ../../library/subprocess.rst:816 msgid "Sends the signal *signal* to the child." msgstr "" -#: ../../library/subprocess.rst:813 +#: ../../library/subprocess.rst:818 msgid "Do nothing if the process completed." msgstr "" -#: ../../library/subprocess.rst:817 +#: ../../library/subprocess.rst:822 msgid "" "On Windows, SIGTERM is an alias for :meth:`terminate`. CTRL_C_EVENT and " "CTRL_BREAK_EVENT can be sent to processes started with a *creationflags* " "parameter which includes `CREATE_NEW_PROCESS_GROUP`." msgstr "" -#: ../../library/subprocess.rst:824 +#: ../../library/subprocess.rst:829 msgid "" "Stop the child. On POSIX OSs the method sends SIGTERM to the child. On " "Windows the Win32 API function :c:func:`TerminateProcess` is called to stop " "the child." msgstr "" -#: ../../library/subprocess.rst:831 +#: ../../library/subprocess.rst:836 msgid "" "Kills the child. On POSIX OSs the function sends SIGKILL to the child. On " "Windows :meth:`kill` is an alias for :meth:`terminate`." msgstr "" -#: ../../library/subprocess.rst:835 +#: ../../library/subprocess.rst:840 msgid "The following attributes are also available:" msgstr "" -#: ../../library/subprocess.rst:839 +#: ../../library/subprocess.rst:844 msgid "" "The *args* argument as it was passed to :class:`Popen` -- a sequence of " "program arguments or else a single string." msgstr "" -#: ../../library/subprocess.rst:846 +#: ../../library/subprocess.rst:851 msgid "" "If the *stdin* argument was :data:`PIPE`, this attribute is a writeable " "stream object as returned by :func:`open`. If the *encoding* or *errors* " @@ -1062,7 +1078,7 @@ msgid "" "argument was not :data:`PIPE`, this attribute is ``None``." msgstr "" -#: ../../library/subprocess.rst:855 +#: ../../library/subprocess.rst:860 msgid "" "If the *stdout* argument was :data:`PIPE`, this attribute is a readable " "stream object as returned by :func:`open`. Reading from the stream provides " @@ -1072,7 +1088,7 @@ msgid "" "not :data:`PIPE`, this attribute is ``None``." msgstr "" -#: ../../library/subprocess.rst:865 +#: ../../library/subprocess.rst:870 msgid "" "If the *stderr* argument was :data:`PIPE`, this attribute is a readable " "stream object as returned by :func:`open`. Reading from the stream provides " @@ -1082,7 +1098,7 @@ msgid "" "was not :data:`PIPE`, this attribute is ``None``." msgstr "" -#: ../../library/subprocess.rst:874 +#: ../../library/subprocess.rst:879 msgid "" "Use :meth:`~Popen.communicate` rather than :attr:`.stdin.write `, :attr:`.stdout.read ` or :attr:`.stderr.read `__ structure is used for :class:`Popen` " @@ -1125,38 +1141,38 @@ msgid "" "only arguments." msgstr "" -#: ../../library/subprocess.rst:912 +#: ../../library/subprocess.rst:917 msgid "Keyword-only argument support was added." msgstr "" -#: ../../library/subprocess.rst:917 +#: ../../library/subprocess.rst:922 msgid "" "A bit field that determines whether certain :class:`STARTUPINFO` attributes " "are used when the process creates a window. ::" msgstr "" -#: ../../library/subprocess.rst:925 +#: ../../library/subprocess.rst:930 msgid "" "If :attr:`dwFlags` specifies :data:`STARTF_USESTDHANDLES`, this attribute is " "the standard input handle for the process. If :data:`STARTF_USESTDHANDLES` " "is not specified, the default for standard input is the keyboard buffer." msgstr "" -#: ../../library/subprocess.rst:932 +#: ../../library/subprocess.rst:937 msgid "" "If :attr:`dwFlags` specifies :data:`STARTF_USESTDHANDLES`, this attribute is " "the standard output handle for the process. Otherwise, this attribute is " "ignored and the default for standard output is the console window's buffer." msgstr "" -#: ../../library/subprocess.rst:939 +#: ../../library/subprocess.rst:944 msgid "" "If :attr:`dwFlags` specifies :data:`STARTF_USESTDHANDLES`, this attribute is " "the standard error handle for the process. Otherwise, this attribute is " "ignored and the default for standard error is the console window's buffer." msgstr "" -#: ../../library/subprocess.rst:945 +#: ../../library/subprocess.rst:950 msgid "" "If :attr:`dwFlags` specifies :data:`STARTF_USESHOWWINDOW`, this attribute " "can be any of the values that can be specified in the ``nCmdShow`` parameter " @@ -1165,34 +1181,34 @@ msgid "" "Otherwise, this attribute is ignored." msgstr "" -#: ../../library/subprocess.rst:952 +#: ../../library/subprocess.rst:957 msgid "" ":data:`SW_HIDE` is provided for this attribute. It is used when :class:" "`Popen` is called with ``shell=True``." msgstr "" -#: ../../library/subprocess.rst:957 +#: ../../library/subprocess.rst:962 msgid "" "A dictionary of additional attributes for process creation as given in " "``STARTUPINFOEX``, see `UpdateProcThreadAttribute `__." msgstr "" -#: ../../library/subprocess.rst:961 +#: ../../library/subprocess.rst:966 msgid "Supported attributes:" msgstr "" -#: ../../library/subprocess.rst:979 +#: ../../library/subprocess.rst:984 msgid "**handle_list**" msgstr "**handle_list**" -#: ../../library/subprocess.rst:964 +#: ../../library/subprocess.rst:969 msgid "" "Sequence of handles that will be inherited. *close_fds* must be true if non-" "empty." msgstr "" -#: ../../library/subprocess.rst:967 +#: ../../library/subprocess.rst:972 msgid "" "The handles must be temporarily made inheritable by :func:`os." "set_handle_inheritable` when passed to the :class:`Popen` constructor, else :" @@ -1200,7 +1216,7 @@ msgid "" "``ERROR_INVALID_PARAMETER`` (87)." msgstr "" -#: ../../library/subprocess.rst:974 +#: ../../library/subprocess.rst:979 msgid "" "In a multithreaded process, use caution to avoid leaking handles that are " "marked inheritable when combining this feature with concurrent calls to " @@ -1209,97 +1225,97 @@ msgid "" "temporarily creates inheritable handles." msgstr "" -#: ../../library/subprocess.rst:984 +#: ../../library/subprocess.rst:989 msgid "Windows Constants" msgstr "" -#: ../../library/subprocess.rst:986 +#: ../../library/subprocess.rst:991 msgid "The :mod:`subprocess` module exposes the following constants." msgstr "" -#: ../../library/subprocess.rst:990 +#: ../../library/subprocess.rst:995 msgid "" "The standard input device. Initially, this is the console input buffer, " "``CONIN$``." msgstr "" -#: ../../library/subprocess.rst:995 +#: ../../library/subprocess.rst:1000 msgid "" "The standard output device. Initially, this is the active console screen " "buffer, ``CONOUT$``." msgstr "" -#: ../../library/subprocess.rst:1000 +#: ../../library/subprocess.rst:1005 msgid "" "The standard error device. Initially, this is the active console screen " "buffer, ``CONOUT$``." msgstr "" -#: ../../library/subprocess.rst:1005 +#: ../../library/subprocess.rst:1010 msgid "Hides the window. Another window will be activated." msgstr "" -#: ../../library/subprocess.rst:1009 +#: ../../library/subprocess.rst:1014 msgid "" "Specifies that the :attr:`STARTUPINFO.hStdInput`, :attr:`STARTUPINFO." "hStdOutput`, and :attr:`STARTUPINFO.hStdError` attributes contain additional " "information." msgstr "" -#: ../../library/subprocess.rst:1015 +#: ../../library/subprocess.rst:1020 msgid "" "Specifies that the :attr:`STARTUPINFO.wShowWindow` attribute contains " "additional information." msgstr "" -#: ../../library/subprocess.rst:1020 +#: ../../library/subprocess.rst:1025 msgid "" "The new process has a new console, instead of inheriting its parent's " "console (the default)." msgstr "" -#: ../../library/subprocess.rst:1025 +#: ../../library/subprocess.rst:1030 msgid "" "A :class:`Popen` ``creationflags`` parameter to specify that a new process " "group will be created. This flag is necessary for using :func:`os.kill` on " "the subprocess." msgstr "" -#: ../../library/subprocess.rst:1029 +#: ../../library/subprocess.rst:1034 msgid "This flag is ignored if :data:`CREATE_NEW_CONSOLE` is specified." msgstr "" -#: ../../library/subprocess.rst:1033 +#: ../../library/subprocess.rst:1038 msgid "" "A :class:`Popen` ``creationflags`` parameter to specify that a new process " "will have an above average priority." msgstr "" -#: ../../library/subprocess.rst:1040 +#: ../../library/subprocess.rst:1045 msgid "" "A :class:`Popen` ``creationflags`` parameter to specify that a new process " "will have a below average priority." msgstr "" -#: ../../library/subprocess.rst:1047 +#: ../../library/subprocess.rst:1052 msgid "" "A :class:`Popen` ``creationflags`` parameter to specify that a new process " "will have a high priority." msgstr "" -#: ../../library/subprocess.rst:1054 +#: ../../library/subprocess.rst:1059 msgid "" "A :class:`Popen` ``creationflags`` parameter to specify that a new process " "will have an idle (lowest) priority." msgstr "" -#: ../../library/subprocess.rst:1061 +#: ../../library/subprocess.rst:1066 msgid "" "A :class:`Popen` ``creationflags`` parameter to specify that a new process " "will have an normal priority. (default)" msgstr "" -#: ../../library/subprocess.rst:1068 +#: ../../library/subprocess.rst:1073 msgid "" "A :class:`Popen` ``creationflags`` parameter to specify that a new process " "will have realtime priority. You should almost never use " @@ -1309,20 +1325,20 @@ msgid "" "perform brief tasks that should have limited interruptions." msgstr "" -#: ../../library/subprocess.rst:1079 +#: ../../library/subprocess.rst:1084 msgid "" "A :class:`Popen` ``creationflags`` parameter to specify that a new process " "will not create a window." msgstr "" -#: ../../library/subprocess.rst:1086 +#: ../../library/subprocess.rst:1091 msgid "" "A :class:`Popen` ``creationflags`` parameter to specify that a new process " "will not inherit its parent's console. This value cannot be used with " "CREATE_NEW_CONSOLE." msgstr "" -#: ../../library/subprocess.rst:1094 +#: ../../library/subprocess.rst:1099 msgid "" "A :class:`Popen` ``creationflags`` parameter to specify that a new process " "does not inherit the error mode of the calling process. Instead, the new " @@ -1330,39 +1346,39 @@ msgid "" "multithreaded shell applications that run with hard errors disabled." msgstr "" -#: ../../library/subprocess.rst:1104 +#: ../../library/subprocess.rst:1109 msgid "" "A :class:`Popen` ``creationflags`` parameter to specify that a new process " "is not associated with the job." msgstr "" -#: ../../library/subprocess.rst:1112 +#: ../../library/subprocess.rst:1117 msgid "Older high-level API" msgstr "" -#: ../../library/subprocess.rst:1114 +#: ../../library/subprocess.rst:1119 msgid "" "Prior to Python 3.5, these three functions comprised the high level API to " "subprocess. You can now use :func:`run` in many cases, but lots of existing " "code calls these functions." msgstr "" -#: ../../library/subprocess.rst:1121 +#: ../../library/subprocess.rst:1126 msgid "" "Run the command described by *args*. Wait for command to complete, then " "return the :attr:`~Popen.returncode` attribute." msgstr "" -#: ../../library/subprocess.rst:1124 ../../library/subprocess.rst:1156 +#: ../../library/subprocess.rst:1129 ../../library/subprocess.rst:1161 msgid "" "Code needing to capture stdout or stderr should use :func:`run` instead::" msgstr "" -#: ../../library/subprocess.rst:1128 ../../library/subprocess.rst:1160 +#: ../../library/subprocess.rst:1133 ../../library/subprocess.rst:1165 msgid "To suppress stdout or stderr, supply a value of :data:`DEVNULL`." msgstr "" -#: ../../library/subprocess.rst:1130 ../../library/subprocess.rst:1162 +#: ../../library/subprocess.rst:1135 ../../library/subprocess.rst:1167 msgid "" "The arguments shown above are merely some common ones. The full function " "signature is the same as that of the :class:`Popen` constructor - this " @@ -1370,14 +1386,14 @@ msgid "" "to that interface." msgstr "" -#: ../../library/subprocess.rst:1137 ../../library/subprocess.rst:1169 +#: ../../library/subprocess.rst:1142 ../../library/subprocess.rst:1174 msgid "" "Do not use ``stdout=PIPE`` or ``stderr=PIPE`` with this function. The child " "process will block if it generates enough output to a pipe to fill up the OS " "pipe buffer as the pipes are not being read from." msgstr "" -#: ../../library/subprocess.rst:1149 +#: ../../library/subprocess.rst:1154 msgid "" "Run command with arguments. Wait for command to complete. If the return " "code was zero then return, otherwise raise :exc:`CalledProcessError`. The :" @@ -1386,11 +1402,11 @@ msgid "" "to start the process it will propagate the exception that was raised." msgstr "" -#: ../../library/subprocess.rst:1183 +#: ../../library/subprocess.rst:1188 msgid "Run command with arguments and return its output." msgstr "" -#: ../../library/subprocess.rst:1185 +#: ../../library/subprocess.rst:1190 msgid "" "If the return code was non-zero it raises a :exc:`CalledProcessError`. The :" "exc:`CalledProcessError` object will have the return code in the :attr:" @@ -1398,11 +1414,11 @@ msgid "" "`~CalledProcessError.output` attribute." msgstr "" -#: ../../library/subprocess.rst:1190 +#: ../../library/subprocess.rst:1195 msgid "This is equivalent to::" msgstr "" -#: ../../library/subprocess.rst:1194 +#: ../../library/subprocess.rst:1199 msgid "" "The arguments shown above are merely some common ones. The full function " "signature is largely the same as that of :func:`run` - most arguments are " @@ -1412,52 +1428,52 @@ msgid "" "using the parent's standard input file handle." msgstr "" -#: ../../library/subprocess.rst:1201 +#: ../../library/subprocess.rst:1206 msgid "" "By default, this function will return the data as encoded bytes. The actual " "encoding of the output data may depend on the command being invoked, so the " "decoding to text will often need to be handled at the application level." msgstr "" -#: ../../library/subprocess.rst:1205 +#: ../../library/subprocess.rst:1210 msgid "" "This behaviour may be overridden by setting *text*, *encoding*, *errors*, or " "*universal_newlines* to ``True`` as described in :ref:`frequently-used-" "arguments` and :func:`run`." msgstr "" -#: ../../library/subprocess.rst:1209 +#: ../../library/subprocess.rst:1214 msgid "" "To also capture standard error in the result, use ``stderr=subprocess." "STDOUT``::" msgstr "" -#: ../../library/subprocess.rst:1223 +#: ../../library/subprocess.rst:1228 msgid "Support for the *input* keyword argument was added." msgstr "新增 *input* 關鍵字引數的支援。" -#: ../../library/subprocess.rst:1226 +#: ../../library/subprocess.rst:1231 msgid "*encoding* and *errors* were added. See :func:`run` for details." msgstr "新增 *encoding* 與 *errors*\\ 。細節請見 :func:`run`\\ 。" -#: ../../library/subprocess.rst:1236 +#: ../../library/subprocess.rst:1241 msgid "Replacing Older Functions with the :mod:`subprocess` Module" msgstr "" -#: ../../library/subprocess.rst:1238 +#: ../../library/subprocess.rst:1243 msgid "" "In this section, \"a becomes b\" means that b can be used as a replacement " "for a." msgstr "" -#: ../../library/subprocess.rst:1242 +#: ../../library/subprocess.rst:1247 msgid "" "All \"a\" functions in this section fail (more or less) silently if the " "executed program cannot be found; the \"b\" replacements raise :exc:" "`OSError` instead." msgstr "" -#: ../../library/subprocess.rst:1246 +#: ../../library/subprocess.rst:1251 msgid "" "In addition, the replacements using :func:`check_output` will fail with a :" "exc:`CalledProcessError` if the requested operation produces a non-zero " @@ -1465,143 +1481,143 @@ msgid "" "output` attribute of the raised exception." msgstr "" -#: ../../library/subprocess.rst:1251 +#: ../../library/subprocess.rst:1256 msgid "" "In the following examples, we assume that the relevant functions have " "already been imported from the :mod:`subprocess` module." msgstr "" -#: ../../library/subprocess.rst:1256 +#: ../../library/subprocess.rst:1261 msgid "Replacing :program:`/bin/sh` shell command substitution" msgstr "" -#: ../../library/subprocess.rst:1262 ../../library/subprocess.rst:1273 -#: ../../library/subprocess.rst:1290 +#: ../../library/subprocess.rst:1267 ../../library/subprocess.rst:1278 +#: ../../library/subprocess.rst:1295 msgid "becomes::" msgstr "" "變成:\n" "\n" "::" -#: ../../library/subprocess.rst:1267 +#: ../../library/subprocess.rst:1272 msgid "Replacing shell pipeline" msgstr "" -#: ../../library/subprocess.rst:1280 +#: ../../library/subprocess.rst:1285 msgid "" "The ``p1.stdout.close()`` call after starting the p2 is important in order " "for p1 to receive a SIGPIPE if p2 exits before p1." msgstr "" -#: ../../library/subprocess.rst:1283 +#: ../../library/subprocess.rst:1288 msgid "" "Alternatively, for trusted input, the shell's own pipeline support may still " "be used directly:" msgstr "" -#: ../../library/subprocess.rst:1296 +#: ../../library/subprocess.rst:1301 msgid "Replacing :func:`os.system`" msgstr "" -#: ../../library/subprocess.rst:1304 +#: ../../library/subprocess.rst:1309 msgid "Notes:" msgstr "註解:" -#: ../../library/subprocess.rst:1306 +#: ../../library/subprocess.rst:1311 msgid "Calling the program through the shell is usually not required." msgstr "" -#: ../../library/subprocess.rst:1307 +#: ../../library/subprocess.rst:1312 msgid "" "The :func:`call` return value is encoded differently to that of :func:`os." "system`." msgstr "" -#: ../../library/subprocess.rst:1310 +#: ../../library/subprocess.rst:1315 msgid "" "The :func:`os.system` function ignores SIGINT and SIGQUIT signals while the " "command is running, but the caller must do this separately when using the :" "mod:`subprocess` module." msgstr "" -#: ../../library/subprocess.rst:1314 +#: ../../library/subprocess.rst:1319 msgid "A more realistic example would look like this::" msgstr "" -#: ../../library/subprocess.rst:1327 +#: ../../library/subprocess.rst:1332 msgid "Replacing the :func:`os.spawn ` family" msgstr "" -#: ../../library/subprocess.rst:1329 +#: ../../library/subprocess.rst:1334 msgid "P_NOWAIT example::" msgstr "" "P_NOWAIT 範例:\n" "\n" "::" -#: ../../library/subprocess.rst:1335 +#: ../../library/subprocess.rst:1340 msgid "P_WAIT example::" msgstr "" "P_WAIT 範例:\n" "\n" "::" -#: ../../library/subprocess.rst:1341 +#: ../../library/subprocess.rst:1346 msgid "Vector example::" msgstr "" -#: ../../library/subprocess.rst:1347 +#: ../../library/subprocess.rst:1352 msgid "Environment example::" msgstr "" -#: ../../library/subprocess.rst:1356 +#: ../../library/subprocess.rst:1361 msgid "Replacing :func:`os.popen`, :func:`os.popen2`, :func:`os.popen3`" msgstr "" -#: ../../library/subprocess.rst:1386 +#: ../../library/subprocess.rst:1391 msgid "Return code handling translates as follows::" msgstr "" -#: ../../library/subprocess.rst:1402 +#: ../../library/subprocess.rst:1407 msgid "Replacing functions from the :mod:`popen2` module" msgstr "" -#: ../../library/subprocess.rst:1406 +#: ../../library/subprocess.rst:1411 msgid "" "If the cmd argument to popen2 functions is a string, the command is executed " "through /bin/sh. If it is a list, the command is directly executed." msgstr "" -#: ../../library/subprocess.rst:1425 +#: ../../library/subprocess.rst:1430 msgid "" ":class:`popen2.Popen3` and :class:`popen2.Popen4` basically work as :class:" "`subprocess.Popen`, except that:" msgstr "" -#: ../../library/subprocess.rst:1428 +#: ../../library/subprocess.rst:1433 msgid ":class:`Popen` raises an exception if the execution fails." msgstr "" -#: ../../library/subprocess.rst:1430 +#: ../../library/subprocess.rst:1435 msgid "The *capturestderr* argument is replaced with the *stderr* argument." msgstr "" -#: ../../library/subprocess.rst:1432 +#: ../../library/subprocess.rst:1437 msgid "``stdin=PIPE`` and ``stdout=PIPE`` must be specified." msgstr "" -#: ../../library/subprocess.rst:1434 +#: ../../library/subprocess.rst:1439 msgid "" "popen2 closes all file descriptors by default, but you have to specify " "``close_fds=True`` with :class:`Popen` to guarantee this behavior on all " "platforms or past Python versions." msgstr "" -#: ../../library/subprocess.rst:1440 +#: ../../library/subprocess.rst:1445 msgid "Legacy Shell Invocation Functions" msgstr "" -#: ../../library/subprocess.rst:1442 +#: ../../library/subprocess.rst:1447 msgid "" "This module also provides the following legacy functions from the 2.x " "``commands`` module. These operations implicitly invoke the system shell and " @@ -1609,92 +1625,92 @@ msgid "" "handling consistency are valid for these functions." msgstr "" -#: ../../library/subprocess.rst:1449 +#: ../../library/subprocess.rst:1454 msgid "Return ``(exitcode, output)`` of executing *cmd* in a shell." msgstr "" -#: ../../library/subprocess.rst:1451 +#: ../../library/subprocess.rst:1456 msgid "" "Execute the string *cmd* in a shell with :meth:`Popen.check_output` and " "return a 2-tuple ``(exitcode, output)``. The locale encoding is used; see " "the notes on :ref:`frequently-used-arguments` for more details." msgstr "" -#: ../../library/subprocess.rst:1455 +#: ../../library/subprocess.rst:1460 msgid "" "A trailing newline is stripped from the output. The exit code for the " "command can be interpreted as the return code of subprocess. Example::" msgstr "" -#: ../../library/subprocess.rst:1469 ../../library/subprocess.rst:1489 +#: ../../library/subprocess.rst:1474 ../../library/subprocess.rst:1494 msgid ":ref:`Availability `: POSIX & Windows." msgstr ":ref:`適用 `:POSIX 和 Windows。" -#: ../../library/subprocess.rst:1470 +#: ../../library/subprocess.rst:1475 msgid "Windows support was added." msgstr "" -#: ../../library/subprocess.rst:1473 +#: ../../library/subprocess.rst:1478 msgid "" "The function now returns (exitcode, output) instead of (status, output) as " "it did in Python 3.3.3 and earlier. exitcode has the same value as :attr:" "`~Popen.returncode`." msgstr "" -#: ../../library/subprocess.rst:1480 +#: ../../library/subprocess.rst:1485 msgid "Return output (stdout and stderr) of executing *cmd* in a shell." msgstr "" -#: ../../library/subprocess.rst:1482 +#: ../../library/subprocess.rst:1487 msgid "" "Like :func:`getstatusoutput`, except the exit code is ignored and the return " "value is a string containing the command's output. Example::" msgstr "" -#: ../../library/subprocess.rst:1490 +#: ../../library/subprocess.rst:1495 msgid "Windows support added" msgstr "" -#: ../../library/subprocess.rst:1495 +#: ../../library/subprocess.rst:1500 msgid "Notes" msgstr "註解" -#: ../../library/subprocess.rst:1500 +#: ../../library/subprocess.rst:1505 msgid "Converting an argument sequence to a string on Windows" msgstr "" -#: ../../library/subprocess.rst:1502 +#: ../../library/subprocess.rst:1507 msgid "" "On Windows, an *args* sequence is converted to a string that can be parsed " "using the following rules (which correspond to the rules used by the MS C " "runtime):" msgstr "" -#: ../../library/subprocess.rst:1506 +#: ../../library/subprocess.rst:1511 msgid "" "Arguments are delimited by white space, which is either a space or a tab." msgstr "" -#: ../../library/subprocess.rst:1509 +#: ../../library/subprocess.rst:1514 msgid "" "A string surrounded by double quotation marks is interpreted as a single " "argument, regardless of white space contained within. A quoted string can " "be embedded in an argument." msgstr "" -#: ../../library/subprocess.rst:1514 +#: ../../library/subprocess.rst:1519 msgid "" "A double quotation mark preceded by a backslash is interpreted as a literal " "double quotation mark." msgstr "" -#: ../../library/subprocess.rst:1517 +#: ../../library/subprocess.rst:1522 msgid "" "Backslashes are interpreted literally, unless they immediately precede a " "double quotation mark." msgstr "" -#: ../../library/subprocess.rst:1520 +#: ../../library/subprocess.rst:1525 msgid "" "If backslashes immediately precede a double quotation mark, every pair of " "backslashes is interpreted as a literal backslash. If the number of " @@ -1702,10 +1718,10 @@ msgid "" "mark as described in rule 3." msgstr "" -#: ../../library/subprocess.rst:1529 +#: ../../library/subprocess.rst:1534 msgid ":mod:`shlex`" msgstr ":mod:`shlex`" -#: ../../library/subprocess.rst:1530 +#: ../../library/subprocess.rst:1535 msgid "Module which provides function to parse and escape command lines." msgstr "" diff --git a/library/tkinter.po b/library/tkinter.po index fa79617987..b0be12dc74 100644 --- a/library/tkinter.po +++ b/library/tkinter.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-08-05 00:19+0000\n" +"POT-Creation-Date: 2022-09-28 00:27+0000\n" "PO-Revision-Date: 2018-05-23 16:13+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -68,8 +68,8 @@ msgid "" msgstr "" #: ../../library/tkinter.rst:43 -msgid "`TkDocs `_" -msgstr "`TkDocs `_" +msgid "`TkDocs `_" +msgstr "`TkDocs `_" #: ../../library/tkinter.rst:42 msgid "" diff --git a/library/tkinter.tix.po b/library/tkinter.tix.po index 4823a228fe..1523c57c12 100644 --- a/library/tkinter.tix.po +++ b/library/tkinter.tix.po @@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-20 18:08+0800\n" -"PO-Revision-Date: 2018-05-23 16:13+0000\n" +"POT-Creation-Date: 2022-09-28 00:27+0000\n" +"PO-Revision-Date: 2022-10-01 14:35+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -17,10 +17,11 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Poedit 3.1.1\n" #: ../../library/tkinter.tix.rst:2 msgid ":mod:`tkinter.tix` --- Extension widgets for Tk" -msgstr "" +msgstr ":mod:`tkinter.tix` --- Tk 擴充小工具" #: ../../library/tkinter.tix.rst:9 msgid "**Source code:** :source:`Lib/tkinter/tix.py`" @@ -54,8 +55,8 @@ msgid "" msgstr "" #: ../../library/tkinter.tix.rst:38 -msgid "`Tix Homepage `_" -msgstr "`Tix 首頁 `_" +msgid "`Tix Homepage `_" +msgstr "`Tix 首頁 `_" #: ../../library/tkinter.tix.rst:37 msgid "" @@ -64,8 +65,8 @@ msgid "" msgstr "" #: ../../library/tkinter.tix.rst:41 -msgid "`Tix Man Pages `_" -msgstr "" +msgid "`Tix Man Pages `_" +msgstr "`Tix 首頁 `_" #: ../../library/tkinter.tix.rst:41 msgid "On-line version of the man pages and reference material." @@ -73,9 +74,11 @@ msgstr "" #: ../../library/tkinter.tix.rst:44 msgid "" -"`Tix Programming Guide `_" msgstr "" +"`Tix 程式指南 `_" #: ../../library/tkinter.tix.rst:44 msgid "On-line version of the programmer's reference material." @@ -83,9 +86,10 @@ msgstr "" #: ../../library/tkinter.tix.rst:48 msgid "" -"`Tix Development Applications `_" msgstr "" +"`Tix 開發應用程式 `_" #: ../../library/tkinter.tix.rst:47 msgid "" @@ -126,7 +130,7 @@ msgstr "" #: ../../library/tkinter.tix.rst:83 msgid "" -"`Tix `_ introduces over 40 widget classes to the :mod:`tkinter` repertoire." msgstr "" @@ -136,7 +140,7 @@ msgstr "" #: ../../library/tkinter.tix.rst:93 msgid "" -"A `Balloon `_ that pops up over a widget to provide help. When the user " "moves the cursor inside a widget to which a Balloon widget has been bound, a " "small pop-up window with a descriptive message will be shown on the screen." @@ -144,14 +148,14 @@ msgstr "" #: ../../library/tkinter.tix.rst:105 msgid "" -"The `ButtonBox `_ widget creates a box of buttons, such as is commonly " "used for ``Ok Cancel``." msgstr "" #: ../../library/tkinter.tix.rst:115 msgid "" -"The `ComboBox `_ widget is similar to the combo box control in MS Windows. " "The user can select a choice by either typing in the entry subwidget or " "selecting from the listbox subwidget." @@ -159,7 +163,7 @@ msgstr "" #: ../../library/tkinter.tix.rst:127 msgid "" -"The `Control `_ widget is also known as the :class:`SpinBox` widget. The " "user can adjust the value by pressing the two arrow buttons or by entering " "the value directly into the entry. The new value will be checked against the " @@ -168,7 +172,7 @@ msgstr "" #: ../../library/tkinter.tix.rst:140 msgid "" -"The `LabelEntry `_ widget packages an entry widget and a label into one " "mega widget. It can be used to simplify the creation of \"entry-form\" type " "of interface." @@ -176,7 +180,7 @@ msgstr "" #: ../../library/tkinter.tix.rst:151 msgid "" -"The `LabelFrame `_ widget packages a frame widget and a label into one " "mega widget. To create widgets inside a LabelFrame widget, one creates the " "new widgets relative to the :attr:`frame` subwidget and manage them inside " @@ -185,20 +189,20 @@ msgstr "" #: ../../library/tkinter.tix.rst:163 msgid "" -"The `Meter `_ widget can be used to show the progress of a background job which may " -"take a long time to execute." +"The `Meter `_ widget can be used to show the progress of a background job " +"which may take a long time to execute." msgstr "" #: ../../library/tkinter.tix.rst:174 msgid "" -"The `OptionMenu `_ creates a menu button of options." msgstr "" #: ../../library/tkinter.tix.rst:184 msgid "" -"The `PopupMenu `_ widget can be used as a replacement of the ``tk_popup`` " "command. The advantage of the :mod:`Tix` :class:`PopupMenu` widget is it " "requires less application code to manipulate." @@ -206,14 +210,14 @@ msgstr "" #: ../../library/tkinter.tix.rst:196 msgid "" -"The `Select `_ widget is a container of button subwidgets. It can be used " "to provide radio-box or check-box style of selection options for the user." msgstr "" #: ../../library/tkinter.tix.rst:207 msgid "" -"The `StdButtonBox `_ widget is a group of standard buttons for Motif-like " "dialog boxes." msgstr "" @@ -224,7 +228,7 @@ msgstr "" #: ../../library/tkinter.tix.rst:221 msgid "" -"The `DirList `_ widget displays a list view of a directory, its previous " "directories and its sub-directories. The user can choose one of the " "directories displayed in the list or change to another directory." @@ -232,7 +236,7 @@ msgstr "" #: ../../library/tkinter.tix.rst:233 msgid "" -"The `DirTree `_ widget displays a tree view of a directory, its previous " "directories and its sub-directories. The user can choose one of the " "directories displayed in the list or change to another directory." @@ -240,7 +244,7 @@ msgstr "" #: ../../library/tkinter.tix.rst:245 msgid "" -"The `DirSelectDialog `_ widget presents the directories in the file " "system in a dialog window. The user can use this dialog window to navigate " "through the file system to select the desired directory." @@ -256,7 +260,7 @@ msgstr "" #: ../../library/tkinter.tix.rst:265 msgid "" -"The `ExFileSelectBox `_ widget is usually embedded in a " "tixExFileSelectDialog widget. It provides a convenient method for the user " "to select files. The style of the :class:`ExFileSelectBox` widget is very " @@ -265,7 +269,7 @@ msgstr "" #: ../../library/tkinter.tix.rst:278 msgid "" -"The `FileSelectBox `_ is similar to the standard Motif(TM) file-selection " "box. It is generally used for the user to choose a file. FileSelectBox " "stores the files mostly recently selected into a :class:`ComboBox` widget so " @@ -274,7 +278,7 @@ msgstr "" #: ../../library/tkinter.tix.rst:291 msgid "" -"The `FileEntry `_ widget can be used to input a filename. The user can " "type in the filename manually. Alternatively, the user can press the button " "widget that sits next to the entry, which will bring up a file selection " @@ -287,16 +291,16 @@ msgstr "" #: ../../library/tkinter.tix.rst:307 msgid "" -"The `HList `_ widget can be used to display any data that have a hierarchical " -"structure, for example, file system directory trees. The list entries are " -"indented and connected by branch lines according to their places in the " -"hierarchy." +"The `HList `_ widget can be used to display any data that have a " +"hierarchical structure, for example, file system directory trees. The list " +"entries are indented and connected by branch lines according to their places " +"in the hierarchy." msgstr "" #: ../../library/tkinter.tix.rst:319 msgid "" -"The `CheckList `_ widget displays a list of items to be selected by the " "user. CheckList acts similarly to the Tk checkbutton or radiobutton widgets, " "except it is capable of handling many more items than checkbuttons or " @@ -305,7 +309,7 @@ msgstr "" #: ../../library/tkinter.tix.rst:335 msgid "" -"The `Tree `_ widget can be used to display hierarchical data in a tree form. The " "user can adjust the view of the tree by opening or closing parts of the tree." msgstr "" @@ -316,9 +320,9 @@ msgstr "" #: ../../library/tkinter.tix.rst:352 msgid "" -"The `TList `_ widget can be used to display data in a tabular format. The list " -"entries of a :class:`TList` widget are similar to the entries in the Tk " +"The `TList `_ widget can be used to display data in a tabular format. The " +"list entries of a :class:`TList` widget are similar to the entries in the Tk " "listbox widget. The main differences are (1) the :class:`TList` widget can " "display the list entries in a two dimensional format and (2) you can use " "graphical images as well as multiple colors and fonts for the list entries." @@ -330,7 +334,7 @@ msgstr "" #: ../../library/tkinter.tix.rst:380 msgid "" -"The `PanedWindow `_ widget allows the user to interactively manipulate the " "sizes of several panes. The panes can be arranged either vertically or " "horizontally. The user changes the sizes of the panes by dragging the " @@ -339,7 +343,7 @@ msgstr "" #: ../../library/tkinter.tix.rst:392 msgid "" -"The `ListNoteBook `_ widget is very similar to the :class:`TixNoteBook` " "widget: it can be used to display many windows in a limited space using a " "notebook metaphor. The notebook is divided into a stack of pages (windows). " @@ -350,7 +354,7 @@ msgstr "" #: ../../library/tkinter.tix.rst:406 msgid "" -"The `NoteBook `_ widget can be used to display many windows in a limited " "space using a notebook metaphor. The notebook is divided into a stack of " "pages. At one time only one of these pages can be shown. The user can " @@ -368,14 +372,14 @@ msgstr "" #: ../../library/tkinter.tix.rst:432 msgid "" -"`pixmap `_ capabilities to all :mod:`tkinter.tix` and :mod:`tkinter` widgets to " "create color images from XPM files." msgstr "" #: ../../library/tkinter.tix.rst:441 msgid "" -"`Compound `_ image types can be used to create images that consists of multiple " "horizontal lines; each line is composed of a series of items (texts, " "bitmaps, images or spaces) arranged from left to right. For example, a " @@ -389,7 +393,7 @@ msgstr "" #: ../../library/tkinter.tix.rst:465 msgid "" -"The `InputOnly `_ widgets are to accept inputs from the user, which can be " "done with the ``bind`` command (Unix only)." msgstr "" @@ -404,17 +408,17 @@ msgstr "" #: ../../library/tkinter.tix.rst:479 msgid "" -"The `Form `_ geometry manager based on attachment rules for all Tk widgets." msgstr "" #: ../../library/tkinter.tix.rst:485 msgid "Tix Commands" -msgstr "" +msgstr "Tix 指令" #: ../../library/tkinter.tix.rst:490 msgid "" -"The `tix commands `_ provide access to miscellaneous elements of :mod:`Tix`'s internal " "state and the :mod:`Tix` application context. Most of the information " "manipulated by these methods pertains to the application as a whole, or to a " diff --git a/library/tkinter.ttk.po b/library/tkinter.ttk.po index 2903a2b694..5cb4d23c6c 100644 --- a/library/tkinter.ttk.po +++ b/library/tkinter.ttk.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-07-06 00:17+0000\n" +"POT-Creation-Date: 2022-09-28 00:27+0000\n" "PO-Revision-Date: 2018-05-23 16:13+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -86,7 +86,7 @@ msgstr "" #: ../../library/tkinter.ttk.rst:62 msgid "" -"`Converting existing applications to use Tile widgets `_" msgstr "" @@ -1889,7 +1889,7 @@ msgstr "" #: ../../library/tkinter.ttk.rst:1277 msgid "" -"`Tcl'2004 conference presentation `_" msgstr "" diff --git a/library/xmlrpc.client.po b/library/xmlrpc.client.po index 98604fedf5..c88c0cf644 100644 --- a/library/xmlrpc.client.po +++ b/library/xmlrpc.client.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-08-05 00:19+0000\n" +"POT-Creation-Date: 2022-09-28 00:27+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-" @@ -272,7 +272,8 @@ msgstr "" #: ../../library/xmlrpc.client.rst:167 msgid "" -"`XML-RPC Introspection `_" +"`XML-RPC Introspection `_" msgstr "" #: ../../library/xmlrpc.client.rst:167 diff --git a/tutorial/inputoutput.po b/tutorial/inputoutput.po index 4fc5da01e6..f2ef4dccfe 100644 --- a/tutorial/inputoutput.po +++ b/tutorial/inputoutput.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-09-22 00:19+0000\n" +"POT-Creation-Date: 2022-09-26 00:21+0000\n" "PO-Revision-Date: 2022-06-27 09:44+0800\n" "Last-Translator: Steven Hsu \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -198,8 +198,9 @@ msgid "" "information on the ``=`` specifier. For a reference on these format " "specifications, see the reference guide for the :ref:`formatspec`." msgstr "" -"更多關於 ``=`` 說明符的資訊請見\\ :ref:`自文件性運算式 (self-documenting expressions) `。" -"若要參考這些格式化字串的規格,詳見 :ref:`formatspec` 參考指南。" +"更多關於 ``=`` 說明符的資訊請見\\ :ref:`自文件性運算式 (self-documenting " +"expressions) `。若要參考這些格式化字串的規格,詳見 :ref:" +"`formatspec` 參考指南。" #: ../../tutorial/inputoutput.rst:152 msgid "The String format() Method" @@ -620,7 +621,7 @@ msgstr "" msgid "" "Rather than having users constantly writing and debugging code to save " "complicated data types to files, Python allows you to use the popular data " -"interchange format called `JSON (JavaScript Object Notation) `_. The standard module called :mod:`json` can take Python data " "hierarchies, and convert them to string representations; this process is " "called :dfn:`serializing`. Reconstructing the data from the string " @@ -629,7 +630,7 @@ msgid "" "file or data, or sent over a network connection to some distant machine." msgstr "" "相較於讓使用者不斷地編寫和除錯程式碼才能把複雜的資料類型儲存到檔案,Python 支" -"援一個普及的資料交換格式,稱為 `JSON (JavaScript Object Notation) `_\\ 。標準模組 :mod:`json` 可接收 Python 資料階層,並將它們轉換為字" "串表示法;這個過程稱為 :dfn:`serializing`\\ (序列化)。從字串表示法中重建資" "料則稱為 :dfn:`deserializing`\\ (反序列化)。在序列化和反序列化之間,表示物" diff --git a/using/windows.po b/using/windows.po index ab95aafab1..2a3a2247a1 100644 --- a/using/windows.po +++ b/using/windows.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-08-03 00:18+0000\n" +"POT-Creation-Date: 2022-09-28 00:27+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-" @@ -1878,7 +1878,7 @@ msgstr "" #: ../../using/windows.rst:1168 msgid "" -"`Windows CE `_ is `no longer supported " +"`Windows CE `_ is `no longer supported " "`__ since Python 3 (if it " "ever was)." msgstr "" diff --git a/whatsnew/2.0.po b/whatsnew/2.0.po index c88d956484..cb25c7ee89 100644 --- a/whatsnew/2.0.po +++ b/whatsnew/2.0.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-07-06 00:17+0000\n" +"POT-Creation-Date: 2022-09-28 00:27+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-" @@ -700,7 +700,7 @@ msgid "" "processor, mostly by Trent Mick of ActiveState. (Confusingly, ``sys." "platform`` is still ``'win32'`` on Win64 because it seems that for ease of " "porting, MS Visual C++ treats code as 32 bit on Itanium.) PythonWin also " -"supports Windows CE; see the Python CE page at http://pythonce.sourceforge." +"supports Windows CE; see the Python CE page at https://pythonce.sourceforge." "net/ for more information." msgstr "" diff --git a/whatsnew/2.3.po b/whatsnew/2.3.po index 5aac56d48d..c97396fb4d 100644 --- a/whatsnew/2.3.po +++ b/whatsnew/2.3.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-08-05 00:19+0000\n" +"POT-Creation-Date: 2022-09-28 00:27+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-" @@ -1322,7 +1322,7 @@ msgstr "" #: ../../whatsnew/2.3.rst:1233 msgid "" "The :mod:`bsddb` module has been replaced by version 4.1.6 of the `PyBSDDB " -"`_ package, providing a more complete " +"`_ package, providing a more complete " "interface to the transactional features of the BerkeleyDB library." msgstr "" diff --git a/whatsnew/2.6.po b/whatsnew/2.6.po index 3421852301..2886bca075 100644 --- a/whatsnew/2.6.po +++ b/whatsnew/2.6.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-08-05 00:19+0000\n" +"POT-Creation-Date: 2022-09-26 00:21+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-" @@ -256,7 +256,7 @@ msgstr "" msgid "" "During the 2.6 development cycle, Georg Brandl put a lot of effort into " "building a new toolchain for processing the documentation. The resulting " -"package is called Sphinx, and is available from http://sphinx-doc.org/." +"package is called Sphinx, and is available from https://www.sphinx-doc.org/." msgstr "" #: ../../whatsnew/2.6.rst:222 @@ -284,8 +284,8 @@ msgid "Describes how to write for Python's documentation." msgstr "" #: ../../whatsnew/2.6.rst:239 -msgid "`Sphinx `__" -msgstr "`Sphinx `__" +msgid "`Sphinx `__" +msgstr "" #: ../../whatsnew/2.6.rst:239 msgid "Documentation and code for the Sphinx toolchain." @@ -2108,7 +2108,7 @@ msgstr "" #: ../../whatsnew/2.6.rst:1928 msgid "" "The :mod:`decimal` module was updated to version 1.66 of `the General " -"Decimal Specification `__. " +"Decimal Specification `__. " "New features include some methods for some basic mathematical functions such " "as :meth:`exp` and :meth:`log10`::" msgstr "" @@ -3690,3 +3690,6 @@ msgid "" "Georg Brandl, Steve Brown, Nick Coghlan, Ralph Corderoy, Jim Jewett, Kent " "Johnson, Chris Lambacher, Martin Michlmayr, Antoine Pitrou, Brian Warner." msgstr "" + +#~ msgid "`Sphinx `__" +#~ msgstr "`Sphinx `__" diff --git a/whatsnew/3.1.po b/whatsnew/3.1.po index 85c020ba16..f44129a66c 100644 --- a/whatsnew/3.1.po +++ b/whatsnew/3.1.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-08-05 00:19+0000\n" +"POT-Creation-Date: 2022-09-26 00:21+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-" @@ -555,7 +555,7 @@ msgid "" "The :mod:`json` module now has a C extension to substantially improve its " "performance. In addition, the API was modified so that json works only " "with :class:`str`, not with :class:`bytes`. That change makes the module " -"closely match the `JSON specification `_ which is defined " +"closely match the `JSON specification `_ which is defined " "in terms of Unicode." msgstr "" diff --git a/whatsnew/3.2.po b/whatsnew/3.2.po index 5b03bc422e..a7bb24e3b7 100644 --- a/whatsnew/3.2.po +++ b/whatsnew/3.2.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-08-05 00:19+0000\n" +"POT-Creation-Date: 2022-09-28 00:27+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-" @@ -1054,7 +1054,7 @@ msgstr "" #: ../../whatsnew/3.2.rst:974 msgid "" -"See `Barrier Synchronization Patterns `_ for more examples " "of how barriers can be used in parallel computing. Also, there is a simple " "but thorough explanation of barriers in `The Little Book of Semaphores " @@ -2706,7 +2706,7 @@ msgstr "" #: ../../whatsnew/3.2.rst:2420 msgid "" -"Python has been updated to `Unicode 6.0.0 `_. The update to the standard adds over 2,000 new characters " "including `emoji `_ symbols which are " "important for mobile phones." @@ -2718,7 +2718,7 @@ msgid "" "two Kannada characters (U+0CF1, U+0CF2) and one New Tai Lue numeric " "character (U+19DA), making the former eligible for use in identifiers while " "disqualifying the latter. For more information, see `Unicode Character " -"Database Changes `_." msgstr "" diff --git a/whatsnew/3.4.po b/whatsnew/3.4.po index 51684160bb..42c3c251fa 100644 --- a/whatsnew/3.4.po +++ b/whatsnew/3.4.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-07-06 00:17+0000\n" +"POT-Creation-Date: 2022-09-28 00:27+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-" @@ -2667,7 +2667,7 @@ msgid "" "A new ``make`` target `coverage-report `_ will build python, run " "the test suite, and generate an HTML coverage report for the C codebase " -"using ``gcov`` and `lcov `_." +"using ``gcov`` and `lcov `_." msgstr "" #: ../../whatsnew/3.4.rst:1968 diff --git a/whatsnew/3.5.po b/whatsnew/3.5.po index 23949295d9..b7e6405c63 100644 --- a/whatsnew/3.5.po +++ b/whatsnew/3.5.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-08-05 00:19+0000\n" +"POT-Creation-Date: 2022-09-28 00:27+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-" @@ -2447,7 +2447,7 @@ msgstr "unicodedata" #: ../../whatsnew/3.5.rst:1979 msgid "" -"The :mod:`unicodedata` module now uses data from `Unicode 8.0.0 `_." msgstr "" diff --git a/whatsnew/3.6.po b/whatsnew/3.6.po index 10f9413e14..18c5907e0e 100644 --- a/whatsnew/3.6.po +++ b/whatsnew/3.6.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-06-22 00:18+0000\n" +"POT-Creation-Date: 2022-09-28 00:27+0000\n" "PO-Revision-Date: 2018-07-15 18:56+0800\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -2110,7 +2110,7 @@ msgstr "unicodedata" #: ../../whatsnew/3.6.rst:1646 msgid "" -"The :mod:`unicodedata` module now uses data from `Unicode 9.0.0 `_. (Contributed by Benjamin Peterson.)" msgstr "" diff --git a/whatsnew/3.7.po b/whatsnew/3.7.po index f5e72a49a1..58ec78dd31 100644 --- a/whatsnew/3.7.po +++ b/whatsnew/3.7.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-08-05 00:19+0000\n" +"POT-Creation-Date: 2022-09-28 00:27+0000\n" "PO-Revision-Date: 2018-07-15 18:56+0800\n" "Last-Translator: \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -2117,7 +2117,7 @@ msgstr "unicodedata" #: ../../whatsnew/3.7.rst:1509 msgid "" "The internal :mod:`unicodedata` database has been upgraded to use `Unicode " -"11 `_. (Contributed by " +"11 `_. (Contributed by " "Benjamin Peterson.)" msgstr "" diff --git a/whatsnew/3.8.po b/whatsnew/3.8.po index 380140c9c0..7528171878 100644 --- a/whatsnew/3.8.po +++ b/whatsnew/3.8.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-09-22 00:19+0000\n" +"POT-Creation-Date: 2022-09-28 00:27+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-" @@ -1649,7 +1649,7 @@ msgstr "unicodedata" #: ../../whatsnew/3.8.rst:1350 msgid "" "The :mod:`unicodedata` module has been upgraded to use the `Unicode 12.1.0 " -"`_ release." +"`_ release." msgstr "" #: ../../whatsnew/3.8.rst:1353 pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy