From 7f06f79bb3e23da60b506a7048ff23de6e3725f5 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sat, 1 Oct 2022 07:10:33 +0000 Subject: [PATCH 01/14] sync with cpython 54bbb5e3 --- library/queue.po | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/library/queue.po b/library/queue.po index 62e21869e0..c7bd38b257 100644 --- a/library/queue.po +++ b/library/queue.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-04-15 00:13+0000\n" +"POT-Creation-Date: 2022-10-01 07:08+0000\n" "PO-Revision-Date: 2022-09-27 00:12+0800\n" "Last-Translator: Allen Wu \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -344,19 +344,6 @@ msgstr "" "像是分配記憶體失敗)。可選的 args *block* 和 *timeout* 會被忽略,它們僅是為了" "與 :meth:`Queue.put` 相容才存在。" -#: ../../library/queue.rst:243 -msgid "" -"This method has a C implementation which is reentrant. That is, a ``put()`` " -"or ``get()`` call can be interrupted by another ``put()`` call in the same " -"thread without deadlocking or corrupting internal state inside the queue. " -"This makes it appropriate for use in destructors such as ``__del__`` methods " -"or :mod:`weakref` callbacks." -msgstr "" -"此 method 有一個可重入 (reentrant) 的 C 實作。意思就是,一個 ``put()`` 或 " -"``get()`` 呼叫,可以被同一執行緒中的另一個 ``put()`` 呼叫中斷,而不會造成死" -"鎖 (deadlock) 或損壞佇列中的內部狀態。這使得它適合在解構子 (destructor) 中使" -"用,像是 ``__del__`` method 或 :mod:`weakref` 回呼函式 (callback)。" - #: ../../library/queue.rst:252 msgid "" "Equivalent to ``put(item, block=False)``, provided for compatibility with :" @@ -402,3 +389,15 @@ msgstr "" ":class:`collections.deque` 是無界佇列的替代實作,有快速且具原子性 (atomic) " "的 :meth:`~collections.deque.append` 和 :meth:`~collections.deque.popleft` 操" "作,這些操作不需要鎖定,並且還支持索引。" + +#~ msgid "" +#~ "This method has a C implementation which is reentrant. That is, a " +#~ "``put()`` or ``get()`` call can be interrupted by another ``put()`` call " +#~ "in the same thread without deadlocking or corrupting internal state " +#~ "inside the queue. This makes it appropriate for use in destructors such " +#~ "as ``__del__`` methods or :mod:`weakref` callbacks." +#~ msgstr "" +#~ "此 method 有一個可重入 (reentrant) 的 C 實作。意思就是,一個 ``put()`` 或 " +#~ "``get()`` 呼叫,可以被同一執行緒中的另一個 ``put()`` 呼叫中斷,而不會造成" +#~ "死鎖 (deadlock) 或損壞佇列中的內部狀態。這使得它適合在解構子 (destructor) " +#~ "中使用,像是 ``__del__`` method 或 :mod:`weakref` 回呼函式 (callback)。" From 4ef2dc0067c00dc5c02db5c298bc7c2b46f4cee8 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 2 Oct 2022 00:27:11 +0000 Subject: [PATCH 02/14] sync with cpython 748b2b78 --- library/email.compat32-message.po | 6 +++--- library/email.generator.po | 4 ++-- library/multiprocessing.po | 4 ++-- library/os.path.po | 4 ++-- library/test.po | 4 ++-- whatsnew/3.3.po | 4 ++-- 6 files changed, 13 insertions(+), 13 deletions(-) diff --git a/library/email.compat32-message.po b/library/email.compat32-message.po index 3f1d3e6e13..657b6a9d05 100644 --- a/library/email.compat32-message.po +++ b/library/email.compat32-message.po @@ -5,7 +5,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-10-02 00:25+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" @@ -122,7 +122,7 @@ msgstr "" msgid "" "Note that this method is provided as a convenience and may not always format " "the message the way you want. For example, by default it does not do the " -"mangling of lines that begin with ``From`` that is required by the unix mbox " +"mangling of lines that begin with ``From`` that is required by the Unix mbox " "format. For more flexibility, instantiate a :class:`~email.generator." "Generator` instance and use its :meth:`~email.generator.Generator.flatten` " "method directly. For example::" @@ -160,7 +160,7 @@ msgstr "" msgid "" "Note that this method is provided as a convenience and may not always format " "the message the way you want. For example, by default it does not do the " -"mangling of lines that begin with ``From`` that is required by the unix mbox " +"mangling of lines that begin with ``From`` that is required by the Unix mbox " "format. For more flexibility, instantiate a :class:`~email.generator." "BytesGenerator` instance and use its :meth:`~email.generator.BytesGenerator." "flatten` method directly. For example::" diff --git a/library/email.generator.po b/library/email.generator.po index 02b36e8b0b..b4bcdef429 100644 --- a/library/email.generator.po +++ b/library/email.generator.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-20 18:08+0800\n" +"POT-Creation-Date: 2022-10-02 00:25+0000\n" "PO-Revision-Date: 2018-05-23 14:44+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -86,7 +86,7 @@ msgid "" "defaults to the value of the :attr:`~email.policy.Policy.mangle_from_` " "setting of the *policy* (which is ``True`` for the :data:`~email.policy." "compat32` policy and ``False`` for all others). *mangle_from_* is intended " -"for use when messages are stored in unix mbox format (see :mod:`mailbox` and " +"for use when messages are stored in Unix mbox format (see :mod:`mailbox` and " "`WHY THE CONTENT-LENGTH FORMAT IS BAD `_)." msgstr "" diff --git a/library/multiprocessing.po b/library/multiprocessing.po index 5aeed729f3..3dfc568073 100644 --- a/library/multiprocessing.po +++ b/library/multiprocessing.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-08-22 00:19+0000\n" +"POT-Creation-Date: 2022-10-02 00:25+0000\n" "PO-Revision-Date: 2018-05-23 16:06+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -163,7 +163,7 @@ msgstr "" #: ../../library/multiprocessing.rst:144 msgid "" -"*spawn* added on all unix platforms, and *forkserver* added for some unix " +"*spawn* added on all Unix platforms, and *forkserver* added for some Unix " "platforms. Child processes no longer inherit all of the parents inheritable " "handles on Windows." msgstr "" diff --git a/library/os.path.po b/library/os.path.po index f854edc535..7ba454704a 100644 --- a/library/os.path.po +++ b/library/os.path.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-10-02 00:25+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-" @@ -40,7 +40,7 @@ msgstr "" #: ../../library/os.path.rst:19 msgid "" -"Unlike a unix shell, Python does not do any *automatic* path expansions. " +"Unlike a Unix shell, Python does not do any *automatic* path expansions. " "Functions such as :func:`expanduser` and :func:`expandvars` can be invoked " "explicitly when an application desires shell-like path expansion. (See also " "the :mod:`glob` module.)" diff --git a/library/test.po b/library/test.po index 362f046835..1aa4cb7481 100644 --- a/library/test.po +++ b/library/test.po @@ -7,7 +7,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-10-02 00:25+0000\n" "PO-Revision-Date: 2018-05-23 16:12+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1095,7 +1095,7 @@ msgstr "" #: ../../library/test.rst:1069 msgid "" -"Bind a unix socket, raising :exc:`unittest.SkipTest` if :exc:" +"Bind a Unix socket, raising :exc:`unittest.SkipTest` if :exc:" "`PermissionError` is raised." msgstr "" diff --git a/whatsnew/3.3.po b/whatsnew/3.3.po index 11d2f44d27..bc476ac47e 100644 --- a/whatsnew/3.3.po +++ b/whatsnew/3.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-10-02 00:25+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-" @@ -2769,7 +2769,7 @@ msgstr "" #: ../../whatsnew/3.3.rst:1900 msgid "" "New function :func:`~socket.sethostname` allows the hostname to be set on " -"unix systems if the calling process has sufficient privileges. (Contributed " +"Unix systems if the calling process has sufficient privileges. (Contributed " "by Ross Lagerwall in :issue:`10866`.)" msgstr "" From 1925bd4061d3af1a49963f5b00fa2c1d1239a4f0 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 3 Oct 2022 00:24:10 +0000 Subject: [PATCH 03/14] sync with cpython 72d445a2 --- library/ast.po | 133 +++++++++++++++++++++----------------- library/asyncio-future.po | 83 ++++++++++++------------ library/functions.po | 6 +- library/queue.po | 27 ++++---- library/readline.po | 8 ++- reference/datamodel.po | 13 +++- 6 files changed, 155 insertions(+), 115 deletions(-) diff --git a/library/ast.po b/library/ast.po index 41baf546aa..8b9d0f02c0 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-09-28 00:27+0000\n" +"POT-Creation-Date: 2022-10-03 00:22+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-" @@ -968,7 +968,7 @@ msgid "" "compilation step does." msgstr "" -#: ../../library/ast.rst:1934 ../../library/ast.rst:1973 +#: ../../library/ast.rst:1934 msgid "" "It is possible to crash the Python interpreter with a sufficiently large/" "complex string due to stack depth limitations in Python's AST compiler." @@ -1002,39 +1002,56 @@ msgstr "" #: ../../library/ast.rst:1962 msgid "" -"Safely evaluate an expression node or a string containing a Python literal " -"or container display. The string or node provided may only consist of the " +"Evaluate an expression node or a string containing only a Python literal or " +"container display. The string or node provided may only consist of the " "following Python literal structures: strings, bytes, numbers, tuples, lists, " "dicts, sets, booleans, ``None`` and ``Ellipsis``." msgstr "" #: ../../library/ast.rst:1967 msgid "" -"This can be used for safely evaluating strings containing Python values from " -"untrusted sources without the need to parse the values oneself. It is not " -"capable of evaluating arbitrarily complex expressions, for example involving " -"operators or indexing." +"This can be used for evaluating strings containing Python values without the " +"need to parse the values oneself. It is not capable of evaluating " +"arbitrarily complex expressions, for example involving operators or indexing." msgstr "" -#: ../../library/ast.rst:1977 +#: ../../library/ast.rst:1972 +msgid "" +"This function had been documented as \"safe\" in the past without defining " +"what that meant. That was misleading. This is specifically designed not to " +"execute Python code, unlike the more general :func:`eval`. There is no " +"namespace, no name lookups, or ability to call out. But it is not free from " +"attack: A relatively small input can lead to memory exhaustion or to C stack " +"exhaustion, crashing the process. There is also the possibility for " +"excessive CPU consumption denial of service on some inputs. Calling it on " +"untrusted data is thus not recommended." +msgstr "" + +#: ../../library/ast.rst:1982 +msgid "" +"It is possible to crash the Python interpreter due to stack depth " +"limitations in Python's AST compiler." +msgstr "" + +#: ../../library/ast.rst:1985 msgid "" "It can raise :exc:`ValueError`, :exc:`TypeError`, :exc:`SyntaxError`, :exc:" "`MemoryError` and :exc:`RecursionError` depending on the malformed input." msgstr "" -#: ../../library/ast.rst:1981 +#: ../../library/ast.rst:1989 msgid "Now allows bytes and set literals." msgstr "" -#: ../../library/ast.rst:1984 +#: ../../library/ast.rst:1992 msgid "Now supports creating empty sets with ``'set()'``." msgstr "" -#: ../../library/ast.rst:1987 +#: ../../library/ast.rst:1995 msgid "For string inputs, leading spaces and tabs are now stripped." msgstr "" -#: ../../library/ast.rst:1993 +#: ../../library/ast.rst:2001 msgid "" "Return the docstring of the given *node* (which must be a :class:" "`FunctionDef`, :class:`AsyncFunctionDef`, :class:`ClassDef`, or :class:" @@ -1042,24 +1059,24 @@ msgid "" "clean up the docstring's indentation with :func:`inspect.cleandoc`." msgstr "" -#: ../../library/ast.rst:1999 +#: ../../library/ast.rst:2007 msgid ":class:`AsyncFunctionDef` is now supported." msgstr "目前已支援 :class:`AsyncFunctionDef`\\ 。" -#: ../../library/ast.rst:2005 +#: ../../library/ast.rst:2013 msgid "" "Get source code segment of the *source* that generated *node*. If some " "location information (:attr:`lineno`, :attr:`end_lineno`, :attr:" "`col_offset`, or :attr:`end_col_offset`) is missing, return ``None``." msgstr "" -#: ../../library/ast.rst:2009 +#: ../../library/ast.rst:2017 msgid "" "If *padded* is ``True``, the first line of a multi-line statement will be " "padded with spaces to match its original position." msgstr "" -#: ../../library/ast.rst:2017 +#: ../../library/ast.rst:2025 msgid "" "When you compile a node tree with :func:`compile`, the compiler expects :" "attr:`lineno` and :attr:`col_offset` attributes for every node that supports " @@ -1068,77 +1085,77 @@ msgid "" "the values of the parent node. It works recursively starting at *node*." msgstr "" -#: ../../library/ast.rst:2026 +#: ../../library/ast.rst:2034 msgid "" "Increment the line number and end line number of each node in the tree " "starting at *node* by *n*. This is useful to \"move code\" to a different " "location in a file." msgstr "" -#: ../../library/ast.rst:2033 +#: ../../library/ast.rst:2041 msgid "" "Copy source location (:attr:`lineno`, :attr:`col_offset`, :attr:" "`end_lineno`, and :attr:`end_col_offset`) from *old_node* to *new_node* if " "possible, and return *new_node*." msgstr "" -#: ../../library/ast.rst:2040 +#: ../../library/ast.rst:2048 msgid "" "Yield a tuple of ``(fieldname, value)`` for each field in ``node._fields`` " "that is present on *node*." msgstr "" -#: ../../library/ast.rst:2046 +#: ../../library/ast.rst:2054 msgid "" "Yield all direct child nodes of *node*, that is, all fields that are nodes " "and all items of fields that are lists of nodes." msgstr "" -#: ../../library/ast.rst:2052 +#: ../../library/ast.rst:2060 msgid "" "Recursively yield all descendant nodes in the tree starting at *node* " "(including *node* itself), in no specified order. This is useful if you " "only want to modify nodes in place and don't care about the context." msgstr "" -#: ../../library/ast.rst:2059 +#: ../../library/ast.rst:2067 msgid "" "A node visitor base class that walks the abstract syntax tree and calls a " "visitor function for every node found. This function may return a value " "which is forwarded by the :meth:`visit` method." msgstr "" -#: ../../library/ast.rst:2063 +#: ../../library/ast.rst:2071 msgid "" "This class is meant to be subclassed, with the subclass adding visitor " "methods." msgstr "" -#: ../../library/ast.rst:2068 +#: ../../library/ast.rst:2076 msgid "" "Visit a node. The default implementation calls the method called :samp:" "`self.visit_{classname}` where *classname* is the name of the node class, " "or :meth:`generic_visit` if that method doesn't exist." msgstr "" -#: ../../library/ast.rst:2074 +#: ../../library/ast.rst:2082 msgid "This visitor calls :meth:`visit` on all children of the node." msgstr "" -#: ../../library/ast.rst:2076 +#: ../../library/ast.rst:2084 msgid "" "Note that child nodes of nodes that have a custom visitor method won't be " "visited unless the visitor calls :meth:`generic_visit` or visits them itself." msgstr "" -#: ../../library/ast.rst:2080 +#: ../../library/ast.rst:2088 msgid "" "Don't use the :class:`NodeVisitor` if you want to apply changes to nodes " "during traversal. For this a special visitor exists (:class:" "`NodeTransformer`) that allows modifications." msgstr "" -#: ../../library/ast.rst:2086 +#: ../../library/ast.rst:2094 msgid "" "Methods :meth:`visit_Num`, :meth:`visit_Str`, :meth:`visit_Bytes`, :meth:" "`visit_NameConstant` and :meth:`visit_Ellipsis` are deprecated now and will " @@ -1146,13 +1163,13 @@ msgid "" "method to handle all constant nodes." msgstr "" -#: ../../library/ast.rst:2094 +#: ../../library/ast.rst:2102 msgid "" "A :class:`NodeVisitor` subclass that walks the abstract syntax tree and " "allows modification of nodes." msgstr "" -#: ../../library/ast.rst:2097 +#: ../../library/ast.rst:2105 msgid "" "The :class:`NodeTransformer` will walk the AST and use the return value of " "the visitor methods to replace or remove the old node. If the return value " @@ -1161,27 +1178,27 @@ msgid "" "may be the original node in which case no replacement takes place." msgstr "" -#: ../../library/ast.rst:2103 +#: ../../library/ast.rst:2111 msgid "" "Here is an example transformer that rewrites all occurrences of name lookups " "(``foo``) to ``data['foo']``::" msgstr "" -#: ../../library/ast.rst:2115 +#: ../../library/ast.rst:2123 msgid "" "Keep in mind that if the node you're operating on has child nodes you must " "either transform the child nodes yourself or call the :meth:`generic_visit` " "method for the node first." msgstr "" -#: ../../library/ast.rst:2119 +#: ../../library/ast.rst:2127 msgid "" "For nodes that were part of a collection of statements (that applies to all " "statement nodes), the visitor may also return a list of nodes rather than " "just a single node." msgstr "" -#: ../../library/ast.rst:2123 +#: ../../library/ast.rst:2131 msgid "" "If :class:`NodeTransformer` introduces new nodes (that weren't part of " "original tree) without giving them location information (such as :attr:" @@ -1189,11 +1206,11 @@ msgid "" "tree to recalculate the location information::" msgstr "" -#: ../../library/ast.rst:2131 +#: ../../library/ast.rst:2139 msgid "Usually you use the transformer like this::" msgstr "" -#: ../../library/ast.rst:2138 +#: ../../library/ast.rst:2146 msgid "" "Return a formatted dump of the tree in *node*. This is mainly useful for " "debugging purposes. If *annotate_fields* is true (by default), the returned " @@ -1204,7 +1221,7 @@ msgid "" "true." msgstr "" -#: ../../library/ast.rst:2146 +#: ../../library/ast.rst:2154 msgid "" "If *indent* is a non-negative integer or string, then the tree will be " "pretty-printed with that indent level. An indent level of 0, negative, or ``" @@ -1214,87 +1231,87 @@ msgid "" "string is used to indent each level." msgstr "" -#: ../../library/ast.rst:2153 +#: ../../library/ast.rst:2161 msgid "Added the *indent* option." msgstr "新增 *indent* 選項。" -#: ../../library/ast.rst:2160 +#: ../../library/ast.rst:2168 msgid "Compiler Flags" msgstr "" -#: ../../library/ast.rst:2162 +#: ../../library/ast.rst:2170 msgid "" "The following flags may be passed to :func:`compile` in order to change " "effects on the compilation of a program:" msgstr "" -#: ../../library/ast.rst:2167 +#: ../../library/ast.rst:2175 msgid "" "Enables support for top-level ``await``, ``async for``, ``async with`` and " "async comprehensions." msgstr "" -#: ../../library/ast.rst:2174 +#: ../../library/ast.rst:2182 msgid "" "Generates and returns an abstract syntax tree instead of returning a " "compiled code object." msgstr "" -#: ../../library/ast.rst:2179 +#: ../../library/ast.rst:2187 msgid "" "Enables support for :pep:`484` and :pep:`526` style type comments (``# type: " "``, ``# type: ignore ``)." msgstr "" -#: ../../library/ast.rst:2188 +#: ../../library/ast.rst:2196 msgid "Command-Line Usage" msgstr "" -#: ../../library/ast.rst:2192 +#: ../../library/ast.rst:2200 msgid "" "The :mod:`ast` module can be executed as a script from the command line. It " "is as simple as:" msgstr "" -#: ../../library/ast.rst:2199 +#: ../../library/ast.rst:2207 msgid "The following options are accepted:" msgstr "" -#: ../../library/ast.rst:2205 +#: ../../library/ast.rst:2213 msgid "Show the help message and exit." msgstr "" -#: ../../library/ast.rst:2210 +#: ../../library/ast.rst:2218 msgid "" "Specify what kind of code must be compiled, like the *mode* argument in :" "func:`parse`." msgstr "" -#: ../../library/ast.rst:2215 +#: ../../library/ast.rst:2223 msgid "Don't parse type comments." msgstr "" -#: ../../library/ast.rst:2219 +#: ../../library/ast.rst:2227 msgid "Include attributes such as line numbers and column offsets." msgstr "" -#: ../../library/ast.rst:2224 +#: ../../library/ast.rst:2232 msgid "Indentation of nodes in AST (number of spaces)." msgstr "" -#: ../../library/ast.rst:2226 +#: ../../library/ast.rst:2234 msgid "" "If :file:`infile` is specified its contents are parsed to AST and dumped to " "stdout. Otherwise, the content is read from stdin." msgstr "" -#: ../../library/ast.rst:2232 +#: ../../library/ast.rst:2240 msgid "" "`Green Tree Snakes `_, an external " "documentation resource, has good details on working with Python ASTs." msgstr "" -#: ../../library/ast.rst:2235 +#: ../../library/ast.rst:2243 msgid "" "`ASTTokens `_ " "annotates Python ASTs with the positions of tokens and text in the source " @@ -1302,21 +1319,21 @@ msgid "" "transformations." msgstr "" -#: ../../library/ast.rst:2240 +#: ../../library/ast.rst:2248 msgid "" "`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 "" -#: ../../library/ast.rst:2244 +#: ../../library/ast.rst:2252 msgid "" "`LibCST `_ parses code as a Concrete Syntax " "Tree that looks like an ast tree and keeps all formatting details. It's " "useful for building automated refactoring (codemod) applications and linters." msgstr "" -#: ../../library/ast.rst:2249 +#: ../../library/ast.rst:2257 msgid "" "`Parso `_ is a Python parser that supports " "error recovery and round-trip parsing for different Python versions (in " diff --git a/library/asyncio-future.po b/library/asyncio-future.po index 1c6def3cb2..6348b4ed73 100644 --- a/library/asyncio-future.po +++ b/library/asyncio-future.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-09-11 00:18+0000\n" +"POT-Creation-Date: 2022-10-03 00:22+0000\n" "PO-Revision-Date: 2022-01-25 01:29+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -144,15 +144,16 @@ msgstr "" "一個 Future 代表一個非同步運算的最終結果。並不支援執行緒安全 (thread-safe)。" #: ../../library/asyncio-future.rst:86 +#, fuzzy msgid "" "Future is an :term:`awaitable` object. Coroutines can await on Future " "objects until they either have a result or an exception set, or until they " -"are cancelled." +"are cancelled. A Future can be awaited multiple times and the result is same." msgstr "" "Future 是一個 :term:`awaitable` 物件。協程可以等待 Future 物件直到它們有結果" "或例外被設置、或者被取消。" -#: ../../library/asyncio-future.rst:90 +#: ../../library/asyncio-future.rst:91 msgid "" "Typically Futures are used to enable low-level callback-based code (e.g. in " "protocols implemented using asyncio :ref:`transports `\\ )能夠與高階 async/await 程式互" "動。" -#: ../../library/asyncio-future.rst:95 +#: ../../library/asyncio-future.rst:96 msgid "" "The rule of thumb is to never expose Future objects in user-facing APIs, and " "the recommended way to create a Future object is to call :meth:`loop." @@ -173,21 +174,21 @@ msgstr "" "meth:`loop.create_future` 來建立 Future 物件。如此一來,不同實作的事件迴圈可" "以注入自己最佳化實作的 Future 物件。" -#: ../../library/asyncio-future.rst:101 +#: ../../library/asyncio-future.rst:102 msgid "Added support for the :mod:`contextvars` module." msgstr "加入對 :mod:`contextvars` 模組的支援。" -#: ../../library/asyncio-future.rst:104 +#: ../../library/asyncio-future.rst:105 msgid "" "Deprecation warning is emitted if *loop* is not specified and there is no " "running event loop." msgstr "如果未指定 *loop* 並且沒有正在執行的事件迴圈則會發出棄用警告。" -#: ../../library/asyncio-future.rst:110 +#: ../../library/asyncio-future.rst:111 msgid "Return the result of the Future." msgstr "回傳 Future 的結果。" -#: ../../library/asyncio-future.rst:112 +#: ../../library/asyncio-future.rst:113 msgid "" "If the Future is *done* and has a result set by the :meth:`set_result` " "method, the result value is returned." @@ -195,7 +196,7 @@ msgstr "" "如果 Future 狀態為 *done*\\ (完成),並擁有 :meth:`set_result` 方法設定的一" "個結果,則回傳該結果之值。" -#: ../../library/asyncio-future.rst:115 +#: ../../library/asyncio-future.rst:116 msgid "" "If the Future is *done* and has an exception set by the :meth:" "`set_exception` method, this method raises the exception." @@ -203,7 +204,7 @@ msgstr "" "如果 Future 狀態為 *done*\\ ,並擁有 :meth:`set_exception` 方法設定的一個例" "外,那麼這個方法會引發該例外。" -#: ../../library/asyncio-future.rst:118 ../../library/asyncio-future.rst:206 +#: ../../library/asyncio-future.rst:119 ../../library/asyncio-future.rst:207 msgid "" "If the Future has been *cancelled*, this method raises a :exc:" "`CancelledError` exception." @@ -211,31 +212,31 @@ msgstr "" "如果 Future 已被 *cancelled*\\ (取消),此方法會引發一個 :exc:" "`CancelledError` 例外。" -#: ../../library/asyncio-future.rst:121 +#: ../../library/asyncio-future.rst:122 msgid "" "If the Future's result isn't yet available, this method raises a :exc:" "`InvalidStateError` exception." msgstr "" "如果 Future 的結果還不可用,此方法會引發一個 :exc:`InvalidStateError` 例外。" -#: ../../library/asyncio-future.rst:126 +#: ../../library/asyncio-future.rst:127 msgid "Mark the Future as *done* and set its result." msgstr "將 Future 標記為 *done* 並設定其結果。" -#: ../../library/asyncio-future.rst:128 ../../library/asyncio-future.rst:135 +#: ../../library/asyncio-future.rst:129 ../../library/asyncio-future.rst:136 msgid "" "Raises a :exc:`InvalidStateError` error if the Future is already *done*." msgstr "如果 Future 已經 *done* 則引發一個 :exc:`InvalidStateError` 錯誤。" -#: ../../library/asyncio-future.rst:133 +#: ../../library/asyncio-future.rst:134 msgid "Mark the Future as *done* and set an exception." msgstr "將 Future 標記為 *done* 並設定一個例外。" -#: ../../library/asyncio-future.rst:140 +#: ../../library/asyncio-future.rst:141 msgid "Return ``True`` if the Future is *done*." msgstr "如果 Future 已為 *done* 則回傳 ``True``\\ 。" -#: ../../library/asyncio-future.rst:142 +#: ../../library/asyncio-future.rst:143 msgid "" "A Future is *done* if it was *cancelled* or if it has a result or an " "exception set with :meth:`set_result` or :meth:`set_exception` calls." @@ -243,11 +244,11 @@ msgstr "" "如果 Future 有被 *cancelled*\\ 、\\ :meth:`set_result` 有被呼叫來為其設定結" "果、或 :meth:`set_exception` 有被呼叫為其設定例外,那麼它就是 *done*\\ 。" -#: ../../library/asyncio-future.rst:148 +#: ../../library/asyncio-future.rst:149 msgid "Return ``True`` if the Future was *cancelled*." msgstr "如果 Future 已經被 *cancelled* 則回傳 ``True``\\ 。" -#: ../../library/asyncio-future.rst:150 +#: ../../library/asyncio-future.rst:151 msgid "" "The method is usually used to check if a Future is not *cancelled* before " "setting a result or an exception for it::" @@ -256,15 +257,15 @@ msgstr "" "\n" "::" -#: ../../library/asyncio-future.rst:158 +#: ../../library/asyncio-future.rst:159 msgid "Add a callback to be run when the Future is *done*." msgstr "新增一個在 Future 為 *done* 時執行的回呼函式。" -#: ../../library/asyncio-future.rst:160 +#: ../../library/asyncio-future.rst:161 msgid "The *callback* is called with the Future object as its only argument." msgstr "呼叫 *callback* 並附帶做為唯一引數的 Future 物件。" -#: ../../library/asyncio-future.rst:163 +#: ../../library/asyncio-future.rst:164 msgid "" "If the Future is already *done* when this method is called, the callback is " "scheduled with :meth:`loop.call_soon`." @@ -272,7 +273,7 @@ msgstr "" "如果呼叫這個方法時 Future 已經為 *done*\\ ,回呼函式會被 :meth:`loop." "call_soon` 排程。" -#: ../../library/asyncio-future.rst:166 +#: ../../library/asyncio-future.rst:167 msgid "" "An optional keyword-only *context* argument allows specifying a custom :" "class:`contextvars.Context` for the *callback* to run in. The current " @@ -281,7 +282,7 @@ msgstr "" "可選僅限關鍵字引數 *context* 用來指定一個讓 *callback* 執行於其中的客製化 :" "class:`contextvars.Context` 物件。如果沒有提供 *context*\\ ,則使用當前情境。" -#: ../../library/asyncio-future.rst:170 +#: ../../library/asyncio-future.rst:171 msgid "" ":func:`functools.partial` can be used to pass parameters to the callback, e." "g.::" @@ -290,27 +291,27 @@ msgstr "" "\n" "::" -#: ../../library/asyncio-future.rst:177 +#: ../../library/asyncio-future.rst:178 msgid "" "The *context* keyword-only parameter was added. See :pep:`567` for more " "details." msgstr "加入僅限關鍵字參數 *context*\\ 。更多細節請參閱 :pep:`567`\\ 。" -#: ../../library/asyncio-future.rst:183 +#: ../../library/asyncio-future.rst:184 msgid "Remove *callback* from the callbacks list." msgstr "從回呼列表中移除 *callback*\\ 。" -#: ../../library/asyncio-future.rst:185 +#: ../../library/asyncio-future.rst:186 msgid "" "Returns the number of callbacks removed, which is typically 1, unless a " "callback was added more than once." msgstr "回傳被移除的回呼函式數量,通常為 1,除非一個回呼函式被多次加入。" -#: ../../library/asyncio-future.rst:190 +#: ../../library/asyncio-future.rst:191 msgid "Cancel the Future and schedule callbacks." msgstr "取消 Future 並為回呼函式排程。" -#: ../../library/asyncio-future.rst:192 +#: ../../library/asyncio-future.rst:193 msgid "" "If the Future is already *done* or *cancelled*, return ``False``. Otherwise, " "change the Future's state to *cancelled*, schedule the callbacks, and return " @@ -319,22 +320,22 @@ msgstr "" "如果 Future 已經是 *done* 或 *cancelled*\\ ,回傳 ``False``\\ 。否則將 " "Future 狀態改為 *cancelled* 並在為回呼函式排程後回傳 ``True``\\ 。" -#: ../../library/asyncio-future.rst:196 +#: ../../library/asyncio-future.rst:197 msgid "Added the *msg* parameter." msgstr "新增 *msg* 參數。" -#: ../../library/asyncio-future.rst:201 +#: ../../library/asyncio-future.rst:202 msgid "Return the exception that was set on this Future." msgstr "回傳被設定於此 Future 的例外。" -#: ../../library/asyncio-future.rst:203 +#: ../../library/asyncio-future.rst:204 msgid "" "The exception (or ``None`` if no exception was set) is returned only if the " "Future is *done*." msgstr "" "只有 Future 在 *done* 時才回傳例外(如果沒有設定例外則回傳 ``None``\\ )。" -#: ../../library/asyncio-future.rst:209 +#: ../../library/asyncio-future.rst:210 msgid "" "If the Future isn't *done* yet, this method raises an :exc:" "`InvalidStateError` exception." @@ -342,11 +343,11 @@ msgstr "" "如果 Future 還不為 *done*\\ ,此方法會引發一個 :exc:`InvalidStateError` 例" "外。" -#: ../../library/asyncio-future.rst:214 +#: ../../library/asyncio-future.rst:215 msgid "Return the event loop the Future object is bound to." msgstr "回傳已被 Future 物件繫結 (bind) 的事件迴圈。" -#: ../../library/asyncio-future.rst:221 +#: ../../library/asyncio-future.rst:222 msgid "" "This example creates a Future object, creates and schedules an asynchronous " "Task to set result for the Future, and waits until the Future has a result::" @@ -356,7 +357,7 @@ msgstr "" "\n" "::" -#: ../../library/asyncio-future.rst:256 +#: ../../library/asyncio-future.rst:257 msgid "" "The Future object was designed to mimic :class:`concurrent.futures.Future`. " "Key differences include:" @@ -364,7 +365,7 @@ msgstr "" "該 Future 物件是為了模仿 :class:`concurrent.futures.Future` 而設計。主要差異" "包含:" -#: ../../library/asyncio-future.rst:259 +#: ../../library/asyncio-future.rst:260 msgid "" "unlike asyncio Futures, :class:`concurrent.futures.Future` instances cannot " "be awaited." @@ -372,7 +373,7 @@ msgstr "" "與 asyncio 的 Future 不同,\\ :class:`concurrent.futures.Future` 實例不可被等" "待。" -#: ../../library/asyncio-future.rst:262 +#: ../../library/asyncio-future.rst:263 msgid "" ":meth:`asyncio.Future.result` and :meth:`asyncio.Future.exception` do not " "accept the *timeout* argument." @@ -380,7 +381,7 @@ msgstr "" ":meth:`asyncio.Future.result` 和 :meth:`asyncio.Future.exception` 不接受 " "*timeout* 引數。" -#: ../../library/asyncio-future.rst:265 +#: ../../library/asyncio-future.rst:266 msgid "" ":meth:`asyncio.Future.result` and :meth:`asyncio.Future.exception` raise an :" "exc:`InvalidStateError` exception when the Future is not *done*." @@ -388,7 +389,7 @@ msgstr "" "Future 不為 *done* 時 :meth:`asyncio.Future.result` 和 :meth:`asyncio.Future." "exception` 會引發一個 :exc:`InvalidStateError` 例外。" -#: ../../library/asyncio-future.rst:269 +#: ../../library/asyncio-future.rst:270 msgid "" "Callbacks registered with :meth:`asyncio.Future.add_done_callback` are not " "called immediately. They are scheduled with :meth:`loop.call_soon` instead." @@ -396,7 +397,7 @@ msgstr "" "使用 :meth:`asyncio.Future.add_done_callback` 註冊的回呼函式不會立即呼叫,而" "是被 :meth:`loop.call_soon` 排程。" -#: ../../library/asyncio-future.rst:273 +#: ../../library/asyncio-future.rst:274 msgid "" "asyncio Future is not compatible with the :func:`concurrent.futures.wait` " "and :func:`concurrent.futures.as_completed` functions." @@ -404,7 +405,7 @@ msgstr "" "asyncio Future 不能與 :func:`concurrent.futures.wait` 和 :func:`concurrent." "futures.as_completed` 函式相容。" -#: ../../library/asyncio-future.rst:277 +#: ../../library/asyncio-future.rst:278 msgid "" ":meth:`asyncio.Future.cancel` accepts an optional ``msg`` argument, but :" "func:`concurrent.futures.cancel` does not." diff --git a/library/functions.po b/library/functions.po index 8d67797a58..584a43da16 100644 --- a/library/functions.po +++ b/library/functions.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-09-30 00:28+0000\n" +"POT-Creation-Date: 2022-10-03 00:22+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-" @@ -1503,6 +1503,10 @@ msgstr "" "回傳物件的 \"標識值\" 。該值是一個整數,在此物件的生命週期中保證是唯一且恆定" "的。兩個生命期不重疊的物件可能具有相同的 :func:`id` 值。" +#: ../../library/functions.rst:826 +msgid "This is the address of the object in memory." +msgstr "" + #: ../../library/functions.rst:828 msgid "" "Raises an :ref:`auditing event ` ``builtins.id`` with argument " diff --git a/library/queue.po b/library/queue.po index c7bd38b257..ffa50b96b5 100644 --- a/library/queue.po +++ b/library/queue.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-01 07:08+0000\n" +"POT-Creation-Date: 2022-10-03 00:22+0000\n" "PO-Revision-Date: 2022-09-27 00:12+0800\n" "Last-Translator: Allen Wu \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -344,6 +344,19 @@ msgstr "" "像是分配記憶體失敗)。可選的 args *block* 和 *timeout* 會被忽略,它們僅是為了" "與 :meth:`Queue.put` 相容才存在。" +#: ../../library/queue.rst:243 +msgid "" +"This method has a C implementation which is reentrant. That is, a ``put()`` " +"or ``get()`` call can be interrupted by another ``put()`` call in the same " +"thread without deadlocking or corrupting internal state inside the queue. " +"This makes it appropriate for use in destructors such as ``__del__`` methods " +"or :mod:`weakref` callbacks." +msgstr "" +"此 method 有一個可重入 (reentrant) 的 C 實作。意思就是,一個 ``put()`` 或 " +"``get()`` 呼叫,可以被同一執行緒中的另一個 ``put()`` 呼叫中斷,而不會造成死" +"鎖 (deadlock) 或損壞佇列中的內部狀態。這使得它適合在解構子 (destructor) 中使" +"用,像是 ``__del__`` method 或 :mod:`weakref` 回呼函式 (callback)。" + #: ../../library/queue.rst:252 msgid "" "Equivalent to ``put(item, block=False)``, provided for compatibility with :" @@ -389,15 +402,3 @@ msgstr "" ":class:`collections.deque` 是無界佇列的替代實作,有快速且具原子性 (atomic) " "的 :meth:`~collections.deque.append` 和 :meth:`~collections.deque.popleft` 操" "作,這些操作不需要鎖定,並且還支持索引。" - -#~ msgid "" -#~ "This method has a C implementation which is reentrant. That is, a " -#~ "``put()`` or ``get()`` call can be interrupted by another ``put()`` call " -#~ "in the same thread without deadlocking or corrupting internal state " -#~ "inside the queue. This makes it appropriate for use in destructors such " -#~ "as ``__del__`` methods or :mod:`weakref` callbacks." -#~ msgstr "" -#~ "此 method 有一個可重入 (reentrant) 的 C 實作。意思就是,一個 ``put()`` 或 " -#~ "``get()`` 呼叫,可以被同一執行緒中的另一個 ``put()`` 呼叫中斷,而不會造成" -#~ "死鎖 (deadlock) 或損壞佇列中的內部狀態。這使得它適合在解構子 (destructor) " -#~ "中使用,像是 ``__del__`` method 或 :mod:`weakref` 回呼函式 (callback)。" diff --git a/library/readline.po b/library/readline.po index 6781a1637c..c0c598f492 100644 --- a/library/readline.po +++ b/library/readline.po @@ -7,7 +7,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-10-03 00:22+0000\n" "PO-Revision-Date: 2018-05-23 16:09+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -205,6 +205,12 @@ msgid "" "when true, enables auto history, and that when false, disables auto history." msgstr "" +#: ../../library/readline.rst:188 +msgid "" +"Auto history is enabled by default, and changes to this do not persist " +"across multiple sessions." +msgstr "" + #: ../../library/readline.rst:193 msgid "Startup hooks" msgstr "" diff --git a/reference/datamodel.po b/reference/datamodel.po index c8ba5ab200..bc7c6ed080 100644 --- a/reference/datamodel.po +++ b/reference/datamodel.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-03 00:22+0000\n" "PO-Revision-Date: 2018-05-23 16:17+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1557,6 +1557,17 @@ msgid "" "``x``'s reference count reaches zero." msgstr "" +#: ../../reference/datamodel.rst:1301 +msgid "" +"It is possible for a reference cycle to prevent the reference count of an " +"object from going to zero. In this case, the cycle will be later detected " +"and deleted by the :term:`cyclic garbage collector `. A " +"common cause of reference cycles is when an exception has been caught in a " +"local variable. The frame's locals then reference the exception, which " +"references its own traceback, which references the locals of all frames " +"caught in the traceback." +msgstr "" + #: ../../reference/datamodel.rst:1311 msgid "Documentation for the :mod:`gc` module." msgstr "" From 6a6c2ec7ac7114869f4dd00a5cf0520e58db6f45 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 4 Oct 2022 00:26:08 +0000 Subject: [PATCH 04/14] sync with cpython 65698374 --- library/http.client.po | 28 +- library/http.cookiejar.po | 6 +- library/importlib.po | 350 +++++++-------- library/multiprocessing.po | 862 ++++++++++++++++++------------------- library/unittest.po | 4 +- 5 files changed, 628 insertions(+), 622 deletions(-) diff --git a/library/http.client.po b/library/http.client.po index 3dec33feb4..b2e42aed8f 100644 --- a/library/http.client.po +++ b/library/http.client.po @@ -7,7 +7,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-10-04 00:24+0000\n" "PO-Revision-Date: 2018-05-23 16:03+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -28,7 +28,7 @@ msgstr "**原始碼:**\\ :source:`Lib/http/client.py`" #: ../../library/http.client.rst:17 msgid "" -"This module defines classes which implement the client side of the HTTP and " +"This module defines classes that implement the client side of the HTTP and " "HTTPS protocols. It is normally not used directly --- the module :mod:" "`urllib.request` uses it to handle URLs that use HTTP and HTTPS." msgstr "" @@ -52,7 +52,7 @@ msgstr "" #: ../../library/http.client.rst:37 msgid "" "An :class:`HTTPConnection` instance represents one transaction with an HTTP " -"server. It should be instantiated passing it a host and optional port " +"server. It should be instantiated by passing it a host and optional port " "number. If no port number is passed, the port is extracted from the host " "string if it has the form ``host:port``, else the default HTTP port (80) is " "used. If the optional *timeout* parameter is given, blocking operations " @@ -76,7 +76,7 @@ msgstr "新增 *source_address*\\ 。" #: ../../library/http.client.rst:60 msgid "" "The *strict* parameter was removed. HTTP 0.9-style \"Simple Responses\" are " -"not longer supported." +"no longer supported." msgstr "" #: ../../library/http.client.rst:64 @@ -512,7 +512,7 @@ msgstr "" msgid "" "Return the value of the header *name*, or *default* if there is no header " "matching *name*. If there is more than one header with the name *name*, " -"return all of the values joined by ', '. If 'default' is any iterable other " +"return all of the values joined by ', '. If *default* is any iterable other " "than a single string, its elements are similarly returned joined by commas." msgstr "" @@ -593,24 +593,24 @@ msgid "" msgstr "" #: ../../library/http.client.rst:579 -msgid "Here is an example session that shows how to ``POST`` requests::" +msgid "Here is an example session that uses the ``POST`` method::" msgstr "" #: ../../library/http.client.rst:595 msgid "" -"Client side ``HTTP PUT`` requests are very similar to ``POST`` requests. The " -"difference lies only the server side where HTTP server will allow resources " -"to be created via ``PUT`` request. It should be noted that custom HTTP " -"methods are also handled in :class:`urllib.request.Request` by setting the " -"appropriate method attribute. Here is an example session that shows how to " -"send a ``PUT`` request using http.client::" +"Client side HTTP ``PUT`` requests are very similar to ``POST`` requests. The " +"difference lies only on the server side where HTTP servers will allow " +"resources to be created via ``PUT`` requests. It should be noted that custom " +"HTTP methods are also handled in :class:`urllib.request.Request` by setting " +"the appropriate method attribute. Here is an example session that uses the " +"``PUT`` method::" msgstr "" -#: ../../library/http.client.rst:617 +#: ../../library/http.client.rst:616 msgid "HTTPMessage Objects" msgstr "HTTPMessage 物件" -#: ../../library/http.client.rst:619 +#: ../../library/http.client.rst:618 msgid "" "An :class:`http.client.HTTPMessage` instance holds the headers from an HTTP " "response. It is implemented using the :class:`email.message.Message` class." diff --git a/library/http.cookiejar.po b/library/http.cookiejar.po index d81c44d846..21ec03aaa1 100644 --- a/library/http.cookiejar.po +++ b/library/http.cookiejar.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-08-06 00:16+0000\n" +"POT-Creation-Date: 2022-10-04 00:24+0000\n" "PO-Revision-Date: 2016-11-19 00:31+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -438,8 +438,8 @@ msgstr "" #: ../../library/http.cookiejar.rst:322 msgid "" "A :class:`FileCookieJar` that can load from and save cookies to disk in the " -"Mozilla ``cookies.txt`` file format (which is also used by the Lynx and " -"Netscape browsers)." +"Mozilla ``cookies.txt`` file format (which is also used by curl and the Lynx " +"and Netscape browsers)." msgstr "" #: ../../library/http.cookiejar.rst:328 diff --git a/library/importlib.po b/library/importlib.po index aef447e603..94daa947b8 100644 --- a/library/importlib.po +++ b/library/importlib.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-04 00:24+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-" @@ -431,8 +431,8 @@ msgid "" msgstr "" #: ../../library/importlib.rst:304 ../../library/importlib.rst:360 -#: ../../library/importlib.rst:368 ../../library/importlib.rst:1188 -#: ../../library/importlib.rst:1245 +#: ../../library/importlib.rst:368 ../../library/importlib.rst:1192 +#: ../../library/importlib.rst:1249 msgid "Use :meth:`find_spec` instead." msgstr "" @@ -510,7 +510,7 @@ msgid "" "definition for a loader." msgstr "" -#: ../../library/importlib.rst:384 ../../library/importlib.rst:909 +#: ../../library/importlib.rst:384 ../../library/importlib.rst:913 msgid "" "Loaders that wish to support resource reading should implement a " "``get_resource_reader(fullname)`` method as specified by :class:`importlib." @@ -902,7 +902,7 @@ msgstr "" msgid "Use :meth:`Loader.exec_module` instead." msgstr "" -#: ../../library/importlib.rst:710 ../../library/importlib.rst:1390 +#: ../../library/importlib.rst:710 ../../library/importlib.rst:1394 msgid "Returns :attr:`path`." msgstr "" @@ -1074,7 +1074,13 @@ msgstr "" msgid "Read contents of self as text." msgstr "" -#: ../../library/importlib.rst:860 +#: ../../library/importlib.rst:857 ../../library/importlib.rst:873 +msgid "" +"Note: In Python 3.11 and later, this class is found in ``importlib.resources." +"abc``." +msgstr "" + +#: ../../library/importlib.rst:862 msgid "" "An abstract base class for resource readers capable of serving the ``files`` " "interface. Subclasses ResourceReader and provides concrete implementations " @@ -1082,21 +1088,21 @@ msgid "" "TraversableReader also supplies ResourceReader." msgstr "" -#: ../../library/importlib.rst:866 +#: ../../library/importlib.rst:868 msgid "" "Loaders that wish to support resource reading are expected to implement this " "interface." msgstr "" -#: ../../library/importlib.rst:873 +#: ../../library/importlib.rst:877 msgid ":mod:`importlib.resources` -- Resources" msgstr "" -#: ../../library/importlib.rst:878 +#: ../../library/importlib.rst:882 msgid "**Source code:** :source:`Lib/importlib/resources.py`" msgstr "**原始碼:**\\ :source:`Lib/importlib/resources.py`" -#: ../../library/importlib.rst:884 +#: ../../library/importlib.rst:888 msgid "" "This module leverages Python's import system to provide access to " "*resources* within *packages*. If you can import a package, you can access " @@ -1104,7 +1110,7 @@ msgid "" "binary or text mode." msgstr "" -#: ../../library/importlib.rst:889 +#: ../../library/importlib.rst:893 msgid "" "Resources are roughly akin to files inside directories, though it's " "important to keep in mind that this is just a metaphor. Resources and " @@ -1112,7 +1118,7 @@ msgid "" "file system." msgstr "" -#: ../../library/importlib.rst:895 +#: ../../library/importlib.rst:899 msgid "" "This module provides functionality similar to `pkg_resources `_ `Basic Resource " @@ -1122,7 +1128,7 @@ msgid "" "consistent semantics." msgstr "" -#: ../../library/importlib.rst:903 +#: ../../library/importlib.rst:907 msgid "" "The standalone backport of this module provides more information on `using " "importlib.resources `_." msgstr "" -#: ../../library/importlib.rst:913 +#: ../../library/importlib.rst:917 msgid "The following types are defined." msgstr "" -#: ../../library/importlib.rst:917 +#: ../../library/importlib.rst:921 msgid "" "The ``Package`` type is defined as ``Union[str, ModuleType]``. This means " "that where the function describes accepting a ``Package``, you can pass in " @@ -1142,55 +1148,55 @@ msgid "" "``__spec__.submodule_search_locations`` that is not ``None``." msgstr "" -#: ../../library/importlib.rst:924 +#: ../../library/importlib.rst:928 msgid "" "This type describes the resource names passed into the various functions in " "this package. This is defined as ``Union[str, os.PathLike]``." msgstr "" -#: ../../library/importlib.rst:928 +#: ../../library/importlib.rst:932 msgid "The following functions are available." msgstr "" -#: ../../library/importlib.rst:933 +#: ../../library/importlib.rst:937 msgid "" -"Returns an :class:`importlib.resources.abc.Traversable` object representing " -"the resource container for the package (think directory) and its resources " +"Returns an :class:`importlib.abc.Traversable` object representing the " +"resource container for the package (think directory) and its resources " "(think files). A Traversable may contain other containers (think " "subdirectories)." msgstr "" -#: ../../library/importlib.rst:938 ../../library/importlib.rst:1039 +#: ../../library/importlib.rst:942 ../../library/importlib.rst:1043 msgid "" "*package* is either a name or a module object which conforms to the " "``Package`` requirements." msgstr "" -#: ../../library/importlib.rst:945 +#: ../../library/importlib.rst:949 msgid "" -"Given a :class:`importlib.resources.abc.Traversable` object representing a " -"file, typically from :func:`importlib.resources.files`, return a context " -"manager for use in a :keyword:`with` statement. The context manager provides " -"a :class:`pathlib.Path` object." +"Given a :class:`importlib.abc.Traversable` object representing a file, " +"typically from :func:`importlib.resources.files`, return a context manager " +"for use in a :keyword:`with` statement. The context manager provides a :" +"class:`pathlib.Path` object." msgstr "" -#: ../../library/importlib.rst:950 +#: ../../library/importlib.rst:954 msgid "" "Exiting the context manager cleans up any temporary file created when the " "resource was extracted from e.g. a zip file." msgstr "" -#: ../../library/importlib.rst:953 +#: ../../library/importlib.rst:957 msgid "" "Use ``as_file`` when the Traversable methods (``read_text``, etc) are " "insufficient and an actual file on the file system is required." msgstr "" -#: ../../library/importlib.rst:961 +#: ../../library/importlib.rst:965 msgid "Open for binary reading the *resource* within *package*." msgstr "" -#: ../../library/importlib.rst:963 +#: ../../library/importlib.rst:967 msgid "" "*package* is either a name or a module object which conforms to the " "``Package`` requirements. *resource* is the name of the resource to open " @@ -1199,13 +1205,13 @@ msgid "" "BinaryIO`` instance, a binary I/O stream open for reading." msgstr "" -#: ../../library/importlib.rst:972 +#: ../../library/importlib.rst:976 msgid "" "Open for text reading the *resource* within *package*. By default, the " "resource is opened for reading as UTF-8." msgstr "" -#: ../../library/importlib.rst:975 +#: ../../library/importlib.rst:979 msgid "" "*package* is either a name or a module object which conforms to the " "``Package`` requirements. *resource* is the name of the resource to open " @@ -1214,18 +1220,18 @@ msgid "" "same meaning as with built-in :func:`open`." msgstr "" -#: ../../library/importlib.rst:981 +#: ../../library/importlib.rst:985 msgid "" "This function returns a ``typing.TextIO`` instance, a text I/O stream open " "for reading." msgstr "" -#: ../../library/importlib.rst:987 +#: ../../library/importlib.rst:991 msgid "" "Read and return the contents of the *resource* within *package* as ``bytes``." msgstr "" -#: ../../library/importlib.rst:990 +#: ../../library/importlib.rst:994 msgid "" "*package* is either a name or a module object which conforms to the " "``Package`` requirements. *resource* is the name of the resource to open " @@ -1234,13 +1240,13 @@ msgid "" "contents of the resource as :class:`bytes`." msgstr "" -#: ../../library/importlib.rst:999 +#: ../../library/importlib.rst:1003 msgid "" "Read and return the contents of *resource* within *package* as a ``str``. By " "default, the contents are read as strict UTF-8." msgstr "" -#: ../../library/importlib.rst:1002 +#: ../../library/importlib.rst:1006 msgid "" "*package* is either a name or a module object which conforms to the " "``Package`` requirements. *resource* is the name of the resource to open " @@ -1250,20 +1256,20 @@ msgid "" "contents of the resource as :class:`str`." msgstr "" -#: ../../library/importlib.rst:1012 +#: ../../library/importlib.rst:1016 msgid "" "Return the path to the *resource* as an actual file system path. This " "function returns a context manager for use in a :keyword:`with` statement. " "The context manager provides a :class:`pathlib.Path` object." msgstr "" -#: ../../library/importlib.rst:1016 +#: ../../library/importlib.rst:1020 msgid "" "Exiting the context manager cleans up any temporary file created when the " "resource needs to be extracted from e.g. a zip file." msgstr "" -#: ../../library/importlib.rst:1019 +#: ../../library/importlib.rst:1023 msgid "" "*package* is either a name or a module object which conforms to the " "``Package`` requirements. *resource* is the name of the resource to open " @@ -1271,7 +1277,7 @@ msgid "" "resources (i.e. it cannot be a directory)." msgstr "" -#: ../../library/importlib.rst:1027 +#: ../../library/importlib.rst:1031 msgid "" "Return ``True`` if there is a resource named *name* in the package, " "otherwise ``False``. Remember that directories are *not* resources! " @@ -1279,66 +1285,66 @@ msgid "" "``Package`` requirements." msgstr "" -#: ../../library/importlib.rst:1035 +#: ../../library/importlib.rst:1039 msgid "" "Return an iterable over the named items within the package. The iterable " "returns :class:`str` resources (e.g. files) and non-resources (e.g. " "directories). The iterable does not recurse into subdirectories." msgstr "" -#: ../../library/importlib.rst:1044 +#: ../../library/importlib.rst:1048 msgid ":mod:`importlib.machinery` -- Importers and path hooks" msgstr "" -#: ../../library/importlib.rst:1049 +#: ../../library/importlib.rst:1053 msgid "**Source code:** :source:`Lib/importlib/machinery.py`" msgstr "**原始碼:**\\ :source:`Lib/importlib/machinery.py`" -#: ../../library/importlib.rst:1053 +#: ../../library/importlib.rst:1057 msgid "" "This module contains the various objects that help :keyword:`import` find " "and load modules." msgstr "" -#: ../../library/importlib.rst:1058 +#: ../../library/importlib.rst:1062 msgid "" "A list of strings representing the recognized file suffixes for source " "modules." msgstr "" -#: ../../library/importlib.rst:1065 +#: ../../library/importlib.rst:1069 msgid "" "A list of strings representing the file suffixes for non-optimized bytecode " "modules." msgstr "" -#: ../../library/importlib.rst:1070 ../../library/importlib.rst:1080 +#: ../../library/importlib.rst:1074 ../../library/importlib.rst:1084 msgid "Use :attr:`BYTECODE_SUFFIXES` instead." msgstr "" -#: ../../library/importlib.rst:1075 +#: ../../library/importlib.rst:1079 msgid "" "A list of strings representing the file suffixes for optimized bytecode " "modules." msgstr "" -#: ../../library/importlib.rst:1085 +#: ../../library/importlib.rst:1089 msgid "" "A list of strings representing the recognized file suffixes for bytecode " "modules (including the leading dot)." msgstr "" -#: ../../library/importlib.rst:1090 +#: ../../library/importlib.rst:1094 msgid "The value is no longer dependent on ``__debug__``." msgstr "" -#: ../../library/importlib.rst:1095 +#: ../../library/importlib.rst:1099 msgid "" "A list of strings representing the recognized file suffixes for extension " "modules." msgstr "" -#: ../../library/importlib.rst:1102 +#: ../../library/importlib.rst:1106 msgid "" "Returns a combined list of strings representing all file suffixes for " "modules recognized by the standard import machinery. This is a helper for " @@ -1347,57 +1353,57 @@ msgid "" "`inspect.getmodulename`)." msgstr "" -#: ../../library/importlib.rst:1113 +#: ../../library/importlib.rst:1117 msgid "" "An :term:`importer` for built-in modules. All known built-in modules are " "listed in :data:`sys.builtin_module_names`. This class implements the :class:" "`importlib.abc.MetaPathFinder` and :class:`importlib.abc.InspectLoader` ABCs." msgstr "" -#: ../../library/importlib.rst:1118 ../../library/importlib.rst:1132 -#: ../../library/importlib.rst:1145 ../../library/importlib.rst:1160 +#: ../../library/importlib.rst:1122 ../../library/importlib.rst:1136 +#: ../../library/importlib.rst:1149 ../../library/importlib.rst:1164 msgid "" "Only class methods are defined by this class to alleviate the need for " "instantiation." msgstr "" -#: ../../library/importlib.rst:1121 +#: ../../library/importlib.rst:1125 msgid "" "As part of :pep:`489`, the builtin importer now implements :meth:`Loader." "create_module` and :meth:`Loader.exec_module`" msgstr "" -#: ../../library/importlib.rst:1128 +#: ../../library/importlib.rst:1132 msgid "" "An :term:`importer` for frozen modules. This class implements the :class:" "`importlib.abc.MetaPathFinder` and :class:`importlib.abc.InspectLoader` ABCs." msgstr "" -#: ../../library/importlib.rst:1135 +#: ../../library/importlib.rst:1139 msgid "" "Gained :meth:`~Loader.create_module` and :meth:`~Loader.exec_module` methods." msgstr "" -#: ../../library/importlib.rst:1142 +#: ../../library/importlib.rst:1146 msgid "" ":term:`Finder ` for modules declared in the Windows registry. This " "class implements the :class:`importlib.abc.MetaPathFinder` ABC." msgstr "" -#: ../../library/importlib.rst:1150 +#: ../../library/importlib.rst:1154 msgid "" "Use :mod:`site` configuration instead. Future versions of Python may not " "enable this finder by default." msgstr "" -#: ../../library/importlib.rst:1157 +#: ../../library/importlib.rst:1161 msgid "" "A :term:`Finder ` for :data:`sys.path` and package ``__path__`` " "attributes. This class implements the :class:`importlib.abc.MetaPathFinder` " "ABC." msgstr "" -#: ../../library/importlib.rst:1165 +#: ../../library/importlib.rst:1169 msgid "" "Class method that attempts to find a :term:`spec ` for the " "module specified by *fullname* on :data:`sys.path` or, if defined, on " @@ -1411,47 +1417,47 @@ msgid "" "cache and returned." msgstr "" -#: ../../library/importlib.rst:1179 +#: ../../library/importlib.rst:1183 msgid "" "If the current working directory -- represented by an empty string -- is no " "longer valid then ``None`` is returned but no value is cached in :data:`sys." "path_importer_cache`." msgstr "" -#: ../../library/importlib.rst:1186 +#: ../../library/importlib.rst:1190 msgid "A legacy wrapper around :meth:`find_spec`." msgstr "" -#: ../../library/importlib.rst:1193 +#: ../../library/importlib.rst:1197 msgid "" "Calls :meth:`importlib.abc.PathEntryFinder.invalidate_caches` on all finders " "stored in :data:`sys.path_importer_cache` that define the method. Otherwise " "entries in :data:`sys.path_importer_cache` set to ``None`` are deleted." msgstr "" -#: ../../library/importlib.rst:1198 +#: ../../library/importlib.rst:1202 msgid "Entries of ``None`` in :data:`sys.path_importer_cache` are deleted." msgstr "" -#: ../../library/importlib.rst:1201 +#: ../../library/importlib.rst:1205 msgid "" "Calls objects in :data:`sys.path_hooks` with the current working directory " "for ``''`` (i.e. the empty string)." msgstr "" -#: ../../library/importlib.rst:1208 +#: ../../library/importlib.rst:1212 msgid "" "A concrete implementation of :class:`importlib.abc.PathEntryFinder` which " "caches results from the file system." msgstr "" -#: ../../library/importlib.rst:1211 +#: ../../library/importlib.rst:1215 msgid "" "The *path* argument is the directory for which the finder is in charge of " "searching." msgstr "" -#: ../../library/importlib.rst:1214 +#: ../../library/importlib.rst:1218 msgid "" "The *loader_details* argument is a variable number of 2-item tuples each " "containing a loader and a sequence of file suffixes the loader recognizes. " @@ -1459,7 +1465,7 @@ msgid "" "module's name and the path to the file found." msgstr "" -#: ../../library/importlib.rst:1219 +#: ../../library/importlib.rst:1223 msgid "" "The finder will cache the directory contents as necessary, making stat calls " "for each module search to verify the cache is not outdated. Because cache " @@ -1472,152 +1478,152 @@ msgid "" "to call :func:`importlib.invalidate_caches`." msgstr "" -#: ../../library/importlib.rst:1233 +#: ../../library/importlib.rst:1237 msgid "The path the finder will search in." msgstr "" -#: ../../library/importlib.rst:1237 +#: ../../library/importlib.rst:1241 msgid "Attempt to find the spec to handle *fullname* within :attr:`path`." msgstr "" -#: ../../library/importlib.rst:1243 +#: ../../library/importlib.rst:1247 msgid "Attempt to find the loader to handle *fullname* within :attr:`path`." msgstr "" -#: ../../library/importlib.rst:1250 +#: ../../library/importlib.rst:1254 msgid "Clear out the internal cache." msgstr "" -#: ../../library/importlib.rst:1254 +#: ../../library/importlib.rst:1258 msgid "" "A class method which returns a closure for use on :attr:`sys.path_hooks`. An " "instance of :class:`FileFinder` is returned by the closure using the path " "argument given to the closure directly and *loader_details* indirectly." msgstr "" -#: ../../library/importlib.rst:1259 +#: ../../library/importlib.rst:1263 msgid "" "If the argument to the closure is not an existing directory, :exc:" "`ImportError` is raised." msgstr "" -#: ../../library/importlib.rst:1265 +#: ../../library/importlib.rst:1269 msgid "" "A concrete implementation of :class:`importlib.abc.SourceLoader` by " "subclassing :class:`importlib.abc.FileLoader` and providing some concrete " "implementations of other methods." msgstr "" -#: ../../library/importlib.rst:1273 +#: ../../library/importlib.rst:1277 msgid "The name of the module that this loader will handle." msgstr "" -#: ../../library/importlib.rst:1277 +#: ../../library/importlib.rst:1281 msgid "The path to the source file." msgstr "" -#: ../../library/importlib.rst:1281 +#: ../../library/importlib.rst:1285 msgid "Return ``True`` if :attr:`path` appears to be for a package." msgstr "" -#: ../../library/importlib.rst:1285 +#: ../../library/importlib.rst:1289 msgid "" "Concrete implementation of :meth:`importlib.abc.SourceLoader.path_stats`." msgstr "" -#: ../../library/importlib.rst:1289 +#: ../../library/importlib.rst:1293 msgid "Concrete implementation of :meth:`importlib.abc.SourceLoader.set_data`." msgstr "" -#: ../../library/importlib.rst:1293 ../../library/importlib.rst:1336 +#: ../../library/importlib.rst:1297 ../../library/importlib.rst:1340 msgid "" "Concrete implementation of :meth:`importlib.abc.Loader.load_module` where " "specifying the name of the module to load is optional." msgstr "" -#: ../../library/importlib.rst:1298 ../../library/importlib.rst:1341 +#: ../../library/importlib.rst:1302 ../../library/importlib.rst:1345 msgid "Use :meth:`importlib.abc.Loader.exec_module` instead." msgstr "" -#: ../../library/importlib.rst:1303 +#: ../../library/importlib.rst:1307 msgid "" "A concrete implementation of :class:`importlib.abc.FileLoader` which can " "import bytecode files (i.e. no source code files exist)." msgstr "" -#: ../../library/importlib.rst:1306 +#: ../../library/importlib.rst:1310 msgid "" "Please note that direct use of bytecode files (and thus not source code " "files) inhibits your modules from being usable by all Python implementations " "or new versions of Python which change the bytecode format." msgstr "" -#: ../../library/importlib.rst:1315 +#: ../../library/importlib.rst:1319 msgid "The name of the module the loader will handle." msgstr "" -#: ../../library/importlib.rst:1319 +#: ../../library/importlib.rst:1323 msgid "The path to the bytecode file." msgstr "" -#: ../../library/importlib.rst:1323 +#: ../../library/importlib.rst:1327 msgid "Determines if the module is a package based on :attr:`path`." msgstr "" -#: ../../library/importlib.rst:1327 +#: ../../library/importlib.rst:1331 msgid "Returns the code object for :attr:`name` created from :attr:`path`." msgstr "" -#: ../../library/importlib.rst:1331 +#: ../../library/importlib.rst:1335 msgid "" "Returns ``None`` as bytecode files have no source when this loader is used." msgstr "" -#: ../../library/importlib.rst:1346 +#: ../../library/importlib.rst:1350 msgid "" "A concrete implementation of :class:`importlib.abc.ExecutionLoader` for " "extension modules." msgstr "" -#: ../../library/importlib.rst:1349 +#: ../../library/importlib.rst:1353 msgid "" "The *fullname* argument specifies the name of the module the loader is to " "support. The *path* argument is the path to the extension module's file." msgstr "" -#: ../../library/importlib.rst:1356 +#: ../../library/importlib.rst:1360 msgid "Name of the module the loader supports." msgstr "" -#: ../../library/importlib.rst:1360 +#: ../../library/importlib.rst:1364 msgid "Path to the extension module." msgstr "" -#: ../../library/importlib.rst:1364 +#: ../../library/importlib.rst:1368 msgid "" "Creates the module object from the given specification in accordance with :" "pep:`489`." msgstr "" -#: ../../library/importlib.rst:1371 +#: ../../library/importlib.rst:1375 msgid "Initializes the given module object in accordance with :pep:`489`." msgstr "" -#: ../../library/importlib.rst:1377 +#: ../../library/importlib.rst:1381 msgid "" "Returns ``True`` if the file path points to a package's ``__init__`` module " "based on :attr:`EXTENSION_SUFFIXES`." msgstr "" -#: ../../library/importlib.rst:1382 +#: ../../library/importlib.rst:1386 msgid "Returns ``None`` as extension modules lack a code object." msgstr "" -#: ../../library/importlib.rst:1386 +#: ../../library/importlib.rst:1390 msgid "Returns ``None`` as extension modules do not have source code." msgstr "" -#: ../../library/importlib.rst:1397 +#: ../../library/importlib.rst:1401 msgid "" "A specification for a module's import-system-related state. This is " "typically exposed as the module's ``__spec__`` attribute. In the " @@ -1630,29 +1636,29 @@ msgid "" "``__spec__.submodule_search_locations``." msgstr "" -#: ../../library/importlib.rst:1411 +#: ../../library/importlib.rst:1415 msgid "(``__name__``)" msgstr "(``__name__``)" -#: ../../library/importlib.rst:1413 +#: ../../library/importlib.rst:1417 msgid "A string for the fully qualified name of the module." msgstr "" -#: ../../library/importlib.rst:1417 +#: ../../library/importlib.rst:1421 msgid "(``__loader__``)" msgstr "(``__loader__``)" -#: ../../library/importlib.rst:1419 +#: ../../library/importlib.rst:1423 msgid "" "The :term:`Loader ` that should be used when loading the module. :" "term:`Finders ` should always set this." msgstr "" -#: ../../library/importlib.rst:1424 +#: ../../library/importlib.rst:1428 msgid "(``__file__``)" msgstr "(``__file__``)" -#: ../../library/importlib.rst:1426 +#: ../../library/importlib.rst:1430 msgid "" "Name of the place from which the module is loaded, e.g. \"builtin\" for " "built-in modules and the filename for modules loaded from source. Normally " @@ -1660,67 +1666,67 @@ msgid "" "indicates it is unspecified (e.g. for namespace packages)." msgstr "" -#: ../../library/importlib.rst:1433 +#: ../../library/importlib.rst:1437 msgid "(``__path__``)" msgstr "(``__path__``)" -#: ../../library/importlib.rst:1435 +#: ../../library/importlib.rst:1439 msgid "" "List of strings for where to find submodules, if a package (``None`` " "otherwise)." msgstr "" -#: ../../library/importlib.rst:1440 +#: ../../library/importlib.rst:1444 msgid "" "Container of extra module-specific data for use during loading (or ``None``)." msgstr "" -#: ../../library/importlib.rst:1445 +#: ../../library/importlib.rst:1449 msgid "(``__cached__``)" msgstr "(``__cached__``)" -#: ../../library/importlib.rst:1447 +#: ../../library/importlib.rst:1451 msgid "String for where the compiled module should be stored (or ``None``)." msgstr "" -#: ../../library/importlib.rst:1451 +#: ../../library/importlib.rst:1455 msgid "(``__package__``)" msgstr "(``__package__``)" -#: ../../library/importlib.rst:1453 +#: ../../library/importlib.rst:1457 msgid "" "(Read-only) The fully qualified name of the package under which the module " "should be loaded as a submodule (or the empty string for top-level modules). " "For packages, it is the same as :attr:`__name__`." msgstr "" -#: ../../library/importlib.rst:1459 +#: ../../library/importlib.rst:1463 msgid "" "Boolean indicating whether or not the module's \"origin\" attribute refers " "to a loadable location." msgstr "" -#: ../../library/importlib.rst:1463 +#: ../../library/importlib.rst:1467 msgid ":mod:`importlib.util` -- Utility code for importers" msgstr "" -#: ../../library/importlib.rst:1469 +#: ../../library/importlib.rst:1473 msgid "**Source code:** :source:`Lib/importlib/util.py`" msgstr "**原始碼:**\\ :source:`Lib/importlib/util.py`" -#: ../../library/importlib.rst:1473 +#: ../../library/importlib.rst:1477 msgid "" "This module contains the various objects that help in the construction of " "an :term:`importer`." msgstr "" -#: ../../library/importlib.rst:1478 +#: ../../library/importlib.rst:1482 msgid "" "The bytes which represent the bytecode version number. If you need help with " "loading/writing bytecode then consider :class:`importlib.abc.SourceLoader`." msgstr "" -#: ../../library/importlib.rst:1485 +#: ../../library/importlib.rst:1489 msgid "" "Return the :pep:`3147`/:pep:`488` path to the byte-compiled file associated " "with the source *path*. For example, if *path* is ``/foo/bar/baz.py`` the " @@ -1730,7 +1736,7 @@ msgid "" "`NotImplementedError` will be raised)." msgstr "" -#: ../../library/importlib.rst:1492 +#: ../../library/importlib.rst:1496 msgid "" "The *optimization* parameter is used to specify the optimization level of " "the bytecode file. An empty string represents no optimization, so ``/foo/bar/" @@ -1743,7 +1749,7 @@ msgid "" "be alphanumeric, else :exc:`ValueError` is raised." msgstr "" -#: ../../library/importlib.rst:1502 +#: ../../library/importlib.rst:1506 msgid "" "The *debug_override* parameter is deprecated and can be used to override the " "system's value for ``__debug__``. A ``True`` value is the equivalent of " @@ -1752,18 +1758,18 @@ msgid "" "are not ``None`` then :exc:`TypeError` is raised." msgstr "" -#: ../../library/importlib.rst:1510 +#: ../../library/importlib.rst:1514 msgid "" "The *optimization* parameter was added and the *debug_override* parameter " "was deprecated." msgstr "" -#: ../../library/importlib.rst:1514 ../../library/importlib.rst:1530 -#: ../../library/importlib.rst:1679 +#: ../../library/importlib.rst:1518 ../../library/importlib.rst:1534 +#: ../../library/importlib.rst:1683 msgid "Accepts a :term:`path-like object`." msgstr "" -#: ../../library/importlib.rst:1520 +#: ../../library/importlib.rst:1524 msgid "" "Given the *path* to a :pep:`3147` file name, return the associated source " "code file path. For example, if *path* is ``/foo/bar/__pycache__/baz." @@ -1773,25 +1779,25 @@ msgid "" "cache_tag` is not defined, :exc:`NotImplementedError` is raised." msgstr "" -#: ../../library/importlib.rst:1535 +#: ../../library/importlib.rst:1539 msgid "" "Decode the given bytes representing source code and return it as a string " "with universal newlines (as required by :meth:`importlib.abc.InspectLoader." "get_source`)." msgstr "" -#: ../../library/importlib.rst:1543 +#: ../../library/importlib.rst:1547 msgid "Resolve a relative module name to an absolute one." msgstr "" -#: ../../library/importlib.rst:1545 +#: ../../library/importlib.rst:1549 msgid "" "If **name** has no leading dots, then **name** is simply returned. This " "allows for usage such as ``importlib.util.resolve_name('sys', __spec__." "parent)`` without doing a check to see if the **package** argument is needed." msgstr "" -#: ../../library/importlib.rst:1550 +#: ../../library/importlib.rst:1554 msgid "" ":exc:`ImportError` is raised if **name** is a relative module name but " "**package** is a false value (e.g. ``None`` or the empty string). :exc:" @@ -1799,13 +1805,13 @@ msgid "" "package (e.g. requesting ``..bacon`` from within the ``spam`` package)." msgstr "" -#: ../../library/importlib.rst:1557 +#: ../../library/importlib.rst:1561 msgid "" "To improve consistency with import statements, raise :exc:`ImportError` " "instead of :exc:`ValueError` for invalid relative import attempts." msgstr "" -#: ../../library/importlib.rst:1564 +#: ../../library/importlib.rst:1568 msgid "" "Find the :term:`spec ` for a module, optionally relative to the " "specified **package** name. If the module is in :attr:`sys.modules`, then " @@ -1815,30 +1821,30 @@ msgid "" "if no spec is found." msgstr "" -#: ../../library/importlib.rst:1571 +#: ../../library/importlib.rst:1575 msgid "" "If **name** is for a submodule (contains a dot), the parent module is " "automatically imported." msgstr "" -#: ../../library/importlib.rst:1574 +#: ../../library/importlib.rst:1578 msgid "**name** and **package** work the same as for :func:`import_module`." msgstr "" -#: ../../library/importlib.rst:1578 +#: ../../library/importlib.rst:1582 msgid "" "Raises :exc:`ModuleNotFoundError` instead of :exc:`AttributeError` if " "**package** is in fact not a package (i.e. lacks a :attr:`__path__` " "attribute)." msgstr "" -#: ../../library/importlib.rst:1585 +#: ../../library/importlib.rst:1589 msgid "" "Create a new module based on **spec** and :meth:`spec.loader.create_module " "`." msgstr "" -#: ../../library/importlib.rst:1588 +#: ../../library/importlib.rst:1592 msgid "" "If :meth:`spec.loader.create_module ` " "does not return ``None``, then any pre-existing attributes will not be " @@ -1846,14 +1852,14 @@ msgid "" "accessing **spec** or setting an attribute on the module." msgstr "" -#: ../../library/importlib.rst:1593 +#: ../../library/importlib.rst:1597 msgid "" "This function is preferred over using :class:`types.ModuleType` to create a " "new module as **spec** is used to set as many import-controlled attributes " "on the module as possible." msgstr "" -#: ../../library/importlib.rst:1601 +#: ../../library/importlib.rst:1605 msgid "" "A :term:`decorator` for :meth:`importlib.abc.Loader.load_module` to handle " "selecting the proper module object to load with. The decorated method is " @@ -1863,7 +1869,7 @@ msgid "" "work on static methods because of the assumption of two arguments." msgstr "" -#: ../../library/importlib.rst:1610 +#: ../../library/importlib.rst:1614 msgid "" "The decorated method will take in the **name** of the module to be loaded as " "expected for a :term:`loader`. If the module is not found in :data:`sys." @@ -1873,7 +1879,7 @@ msgid "" "available). These attributes are set unconditionally to support reloading." msgstr "" -#: ../../library/importlib.rst:1618 +#: ../../library/importlib.rst:1622 msgid "" "If an exception is raised by the decorated method and a module was added to :" "data:`sys.modules`, then the module will be removed to prevent a partially " @@ -1881,25 +1887,25 @@ msgid "" "was already in :data:`sys.modules` then it is left alone." msgstr "" -#: ../../library/importlib.rst:1623 +#: ../../library/importlib.rst:1627 msgid "" ":attr:`__loader__` and :attr:`__package__` are automatically set (when " "possible)." msgstr "" -#: ../../library/importlib.rst:1627 +#: ../../library/importlib.rst:1631 msgid "" "Set :attr:`__name__`, :attr:`__loader__` :attr:`__package__` unconditionally " "to support reloading." msgstr "" -#: ../../library/importlib.rst:1631 +#: ../../library/importlib.rst:1635 msgid "" "The import machinery now directly performs all the functionality provided by " "this function." msgstr "" -#: ../../library/importlib.rst:1637 +#: ../../library/importlib.rst:1641 msgid "" "A :term:`decorator` for :meth:`importlib.abc.Loader.load_module` to set the :" "attr:`__loader__` attribute on the returned module. If the attribute is " @@ -1908,23 +1914,23 @@ msgid "" "`__loader__` should be set to." msgstr "" -#: ../../library/importlib.rst:1644 +#: ../../library/importlib.rst:1648 msgid "" "Set ``__loader__`` if set to ``None``, as if the attribute does not exist." msgstr "" -#: ../../library/importlib.rst:1648 ../../library/importlib.rst:1657 +#: ../../library/importlib.rst:1652 ../../library/importlib.rst:1661 msgid "The import machinery takes care of this automatically." msgstr "" -#: ../../library/importlib.rst:1653 +#: ../../library/importlib.rst:1657 msgid "" "A :term:`decorator` for :meth:`importlib.abc.Loader.load_module` to set the :" "attr:`__package__` attribute on the returned module. If :attr:`__package__` " "is set and has a value other than ``None`` it will not be changed." msgstr "" -#: ../../library/importlib.rst:1662 +#: ../../library/importlib.rst:1666 msgid "" "A factory function for creating a :class:`~importlib.machinery.ModuleSpec` " "instance based on a loader. The parameters have the same meaning as they do " @@ -1933,7 +1939,7 @@ msgid "" "spec." msgstr "" -#: ../../library/importlib.rst:1672 +#: ../../library/importlib.rst:1676 msgid "" "A factory function for creating a :class:`~importlib.machinery.ModuleSpec` " "instance based on the path to a file. Missing information will be filled in " @@ -1941,20 +1947,20 @@ msgid "" "module will be file-based." msgstr "" -#: ../../library/importlib.rst:1684 +#: ../../library/importlib.rst:1688 msgid "" "Return the hash of *source_bytes* as bytes. A hash-based ``.pyc`` file " "embeds the :func:`source_hash` of the corresponding source file's contents " "in its header." msgstr "" -#: ../../library/importlib.rst:1692 +#: ../../library/importlib.rst:1696 msgid "" "A class which postpones the execution of the loader of a module until the " "module has an attribute accessed." msgstr "" -#: ../../library/importlib.rst:1695 +#: ../../library/importlib.rst:1699 msgid "" "This class **only** works with loaders that define :meth:`~importlib.abc." "Loader.exec_module` as control over what module type is used for the module " @@ -1967,7 +1973,7 @@ msgid "" "raised if such a substitution is detected." msgstr "" -#: ../../library/importlib.rst:1706 +#: ../../library/importlib.rst:1710 msgid "" "For projects where startup time is critical, this class allows for " "potentially minimizing the cost of loading a module if it is never used. For " @@ -1976,72 +1982,72 @@ msgid "" "postponed and thus occurring out of context." msgstr "" -#: ../../library/importlib.rst:1714 +#: ../../library/importlib.rst:1718 msgid "" "Began calling :meth:`~importlib.abc.Loader.create_module`, removing the " "compatibility warning for :class:`importlib.machinery.BuiltinImporter` and :" "class:`importlib.machinery.ExtensionFileLoader`." msgstr "" -#: ../../library/importlib.rst:1721 +#: ../../library/importlib.rst:1725 msgid "" "A static method which returns a callable that creates a lazy loader. This is " "meant to be used in situations where the loader is passed by class instead " "of by instance. ::" msgstr "" -#: ../../library/importlib.rst:1734 +#: ../../library/importlib.rst:1738 msgid "Examples" msgstr "範例" -#: ../../library/importlib.rst:1737 +#: ../../library/importlib.rst:1741 msgid "Importing programmatically" msgstr "" -#: ../../library/importlib.rst:1739 +#: ../../library/importlib.rst:1743 msgid "" "To programmatically import a module, use :func:`importlib.import_module`. ::" msgstr "" -#: ../../library/importlib.rst:1748 +#: ../../library/importlib.rst:1752 msgid "Checking if a module can be imported" msgstr "" -#: ../../library/importlib.rst:1750 +#: ../../library/importlib.rst:1754 msgid "" "If you need to find out if a module can be imported without actually doing " "the import, then you should use :func:`importlib.util.find_spec`." msgstr "" -#: ../../library/importlib.rst:1753 +#: ../../library/importlib.rst:1757 msgid "" "Note that if ``name`` is a submodule (contains a dot), :func:`importlib.util." "find_spec` will import the parent module. ::" msgstr "" -#: ../../library/importlib.rst:1776 +#: ../../library/importlib.rst:1780 msgid "Importing a source file directly" msgstr "" -#: ../../library/importlib.rst:1778 +#: ../../library/importlib.rst:1782 msgid "" "To import a Python source file directly, use the following recipe (Python " "3.5 and newer only)::" msgstr "" -#: ../../library/importlib.rst:1796 +#: ../../library/importlib.rst:1800 msgid "Implementing lazy imports" msgstr "" -#: ../../library/importlib.rst:1798 +#: ../../library/importlib.rst:1802 msgid "The example below shows how to implement lazy imports::" msgstr "" -#: ../../library/importlib.rst:1820 +#: ../../library/importlib.rst:1824 msgid "Setting up an importer" msgstr "" -#: ../../library/importlib.rst:1822 +#: ../../library/importlib.rst:1826 msgid "" "For deep customizations of import, you typically want to implement an :term:" "`importer`. This means managing both the :term:`finder` and :term:`loader` " @@ -2055,11 +2061,11 @@ msgid "" "for the appropriate classes defined within this package)::" msgstr "" -#: ../../library/importlib.rst:1854 +#: ../../library/importlib.rst:1858 msgid "Approximating :func:`importlib.import_module`" msgstr "" -#: ../../library/importlib.rst:1856 +#: ../../library/importlib.rst:1860 msgid "" "Import itself is implemented in Python code, making it possible to expose " "most of the import machinery through importlib. The following helps " diff --git a/library/multiprocessing.po b/library/multiprocessing.po index 3dfc568073..a056fe99ec 100644 --- a/library/multiprocessing.po +++ b/library/multiprocessing.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-02 00:25+0000\n" +"POT-Creation-Date: 2022-10-04 00:24+0000\n" "PO-Revision-Date: 2018-05-23 16:06+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -154,7 +154,7 @@ msgid "" "pipes." msgstr "" -#: ../../library/multiprocessing.rst:140 ../../library/multiprocessing.rst:1054 +#: ../../library/multiprocessing.rst:140 ../../library/multiprocessing.rst:1053 msgid "" "On macOS, the *spawn* start method is now the default. The *fork* start " "method should be considered unsafe as it can lead to crashes of the " @@ -656,48 +656,48 @@ msgstr "" msgid "Example usage of some of the methods of :class:`Process`:" msgstr "" -#: ../../library/multiprocessing.rst:678 +#: ../../library/multiprocessing.rst:677 msgid "The base class of all :mod:`multiprocessing` exceptions." msgstr "" -#: ../../library/multiprocessing.rst:682 +#: ../../library/multiprocessing.rst:681 msgid "" "Exception raised by :meth:`Connection.recv_bytes_into()` when the supplied " "buffer object is too small for the message read." msgstr "" -#: ../../library/multiprocessing.rst:685 +#: ../../library/multiprocessing.rst:684 msgid "" "If ``e`` is an instance of :exc:`BufferTooShort` then ``e.args[0]`` will " "give the message as a byte string." msgstr "" -#: ../../library/multiprocessing.rst:690 +#: ../../library/multiprocessing.rst:689 msgid "Raised when there is an authentication error." msgstr "" -#: ../../library/multiprocessing.rst:694 +#: ../../library/multiprocessing.rst:693 msgid "Raised by methods with a timeout when the timeout expires." msgstr "" -#: ../../library/multiprocessing.rst:697 +#: ../../library/multiprocessing.rst:696 msgid "Pipes and Queues" msgstr "" -#: ../../library/multiprocessing.rst:699 +#: ../../library/multiprocessing.rst:698 msgid "" "When using multiple processes, one generally uses message passing for " "communication between processes and avoids having to use any synchronization " "primitives like locks." msgstr "" -#: ../../library/multiprocessing.rst:703 +#: ../../library/multiprocessing.rst:702 msgid "" "For passing messages one can use :func:`Pipe` (for a connection between two " "processes) or a queue (which allows multiple producers and consumers)." msgstr "" -#: ../../library/multiprocessing.rst:706 +#: ../../library/multiprocessing.rst:705 msgid "" "The :class:`Queue`, :class:`SimpleQueue` and :class:`JoinableQueue` types " "are multi-producer, multi-consumer :abbr:`FIFO (first-in, first-out)` queues " @@ -707,7 +707,7 @@ msgid "" "Queue` class." msgstr "" -#: ../../library/multiprocessing.rst:713 +#: ../../library/multiprocessing.rst:712 msgid "" "If you use :class:`JoinableQueue` then you **must** call :meth:" "`JoinableQueue.task_done` for each task removed from the queue or else the " @@ -715,20 +715,20 @@ msgid "" "overflow, raising an exception." msgstr "" -#: ../../library/multiprocessing.rst:718 +#: ../../library/multiprocessing.rst:717 msgid "" "Note that one can also create a shared queue by using a manager object -- " "see :ref:`multiprocessing-managers`." msgstr "" -#: ../../library/multiprocessing.rst:723 +#: ../../library/multiprocessing.rst:722 msgid "" ":mod:`multiprocessing` uses the usual :exc:`queue.Empty` and :exc:`queue." "Full` exceptions to signal a timeout. They are not available in the :mod:" "`multiprocessing` namespace so you need to import them from :mod:`queue`." msgstr "" -#: ../../library/multiprocessing.rst:730 +#: ../../library/multiprocessing.rst:729 msgid "" "When an object is put on a queue, the object is pickled and a background " "thread later flushes the pickled data to an underlying pipe. This has some " @@ -737,14 +737,14 @@ msgid "" "a queue created with a :ref:`manager `." msgstr "" -#: ../../library/multiprocessing.rst:737 +#: ../../library/multiprocessing.rst:736 msgid "" "After putting an object on an empty queue there may be an infinitesimal " "delay before the queue's :meth:`~Queue.empty` method returns :const:`False` " "and :meth:`~Queue.get_nowait` can return without raising :exc:`queue.Empty`." msgstr "" -#: ../../library/multiprocessing.rst:742 +#: ../../library/multiprocessing.rst:741 msgid "" "If multiple processes are enqueuing objects, it is possible for the objects " "to be received at the other end out-of-order. However, objects enqueued by " @@ -752,7 +752,7 @@ msgid "" "other." msgstr "" -#: ../../library/multiprocessing.rst:749 +#: ../../library/multiprocessing.rst:748 msgid "" "If a process is killed using :meth:`Process.terminate` or :func:`os.kill` " "while it is trying to use a :class:`Queue`, then the data in the queue is " @@ -760,7 +760,7 @@ msgid "" "exception when it tries to use the queue later on." msgstr "" -#: ../../library/multiprocessing.rst:756 +#: ../../library/multiprocessing.rst:755 msgid "" "As mentioned above, if a child process has put items on a queue (and it has " "not used :meth:`JoinableQueue.cancel_join_thread ` -- see also :ref:`multiprocessing-listeners-clients`." msgstr "" -#: ../../library/multiprocessing.rst:1108 +#: ../../library/multiprocessing.rst:1107 msgid "" "Send an object to the other end of the connection which should be read " "using :meth:`recv`." msgstr "" -#: ../../library/multiprocessing.rst:1111 +#: ../../library/multiprocessing.rst:1110 msgid "" "The object must be picklable. Very large pickles (approximately 32 MiB+, " "though it depends on the OS) may raise a :exc:`ValueError` exception." msgstr "" -#: ../../library/multiprocessing.rst:1116 +#: ../../library/multiprocessing.rst:1115 msgid "" "Return an object sent from the other end of the connection using :meth:" "`send`. Blocks until there is something to receive. Raises :exc:`EOFError` " "if there is nothing left to receive and the other end was closed." msgstr "" -#: ../../library/multiprocessing.rst:1123 +#: ../../library/multiprocessing.rst:1122 msgid "Return the file descriptor or handle used by the connection." msgstr "" -#: ../../library/multiprocessing.rst:1127 +#: ../../library/multiprocessing.rst:1126 msgid "Close the connection." msgstr "" -#: ../../library/multiprocessing.rst:1129 +#: ../../library/multiprocessing.rst:1128 msgid "This is called automatically when the connection is garbage collected." msgstr "" -#: ../../library/multiprocessing.rst:1133 +#: ../../library/multiprocessing.rst:1132 msgid "Return whether there is any data available to be read." msgstr "" -#: ../../library/multiprocessing.rst:1135 +#: ../../library/multiprocessing.rst:1134 msgid "" "If *timeout* is not specified then it will return immediately. If *timeout* " "is a number then this specifies the maximum time in seconds to block. If " "*timeout* is ``None`` then an infinite timeout is used." msgstr "" -#: ../../library/multiprocessing.rst:1139 +#: ../../library/multiprocessing.rst:1138 msgid "" "Note that multiple connection objects may be polled at once by using :func:" "`multiprocessing.connection.wait`." msgstr "" -#: ../../library/multiprocessing.rst:1144 +#: ../../library/multiprocessing.rst:1143 msgid "Send byte data from a :term:`bytes-like object` as a complete message." msgstr "" -#: ../../library/multiprocessing.rst:1146 +#: ../../library/multiprocessing.rst:1145 msgid "" "If *offset* is given then data is read from that position in *buffer*. If " "*size* is given then that many bytes will be read from buffer. Very large " @@ -1238,7 +1238,7 @@ msgid "" "exc:`ValueError` exception" msgstr "" -#: ../../library/multiprocessing.rst:1153 +#: ../../library/multiprocessing.rst:1152 msgid "" "Return a complete message of byte data sent from the other end of the " "connection as a string. Blocks until there is something to receive. Raises :" @@ -1246,19 +1246,19 @@ msgid "" "closed." msgstr "" -#: ../../library/multiprocessing.rst:1158 +#: ../../library/multiprocessing.rst:1157 msgid "" "If *maxlength* is specified and the message is longer than *maxlength* then :" "exc:`OSError` is raised and the connection will no longer be readable." msgstr "" -#: ../../library/multiprocessing.rst:1162 +#: ../../library/multiprocessing.rst:1161 msgid "" "This function used to raise :exc:`IOError`, which is now an alias of :exc:" "`OSError`." msgstr "" -#: ../../library/multiprocessing.rst:1169 +#: ../../library/multiprocessing.rst:1168 msgid "" "Read into *buffer* a complete message of byte data sent from the other end " "of the connection and return the number of bytes in the message. Blocks " @@ -1266,45 +1266,45 @@ msgid "" "nothing left to receive and the other end was closed." msgstr "" -#: ../../library/multiprocessing.rst:1175 +#: ../../library/multiprocessing.rst:1174 msgid "" "*buffer* must be a writable :term:`bytes-like object`. If *offset* is given " "then the message will be written into the buffer from that position. Offset " "must be a non-negative integer less than the length of *buffer* (in bytes)." msgstr "" -#: ../../library/multiprocessing.rst:1180 +#: ../../library/multiprocessing.rst:1179 msgid "" "If the buffer is too short then a :exc:`BufferTooShort` exception is raised " "and the complete message is available as ``e.args[0]`` where ``e`` is the " "exception instance." msgstr "" -#: ../../library/multiprocessing.rst:1184 +#: ../../library/multiprocessing.rst:1183 msgid "" "Connection objects themselves can now be transferred between processes " "using :meth:`Connection.send` and :meth:`Connection.recv`." msgstr "" -#: ../../library/multiprocessing.rst:1188 +#: ../../library/multiprocessing.rst:1187 msgid "" "Connection objects now support the context management protocol -- see :ref:" "`typecontextmanager`. :meth:`~contextmanager.__enter__` returns the " "connection object, and :meth:`~contextmanager.__exit__` calls :meth:`close`." msgstr "" -#: ../../library/multiprocessing.rst:1193 +#: ../../library/multiprocessing.rst:1192 msgid "For example:" msgstr "" -#: ../../library/multiprocessing.rst:1218 +#: ../../library/multiprocessing.rst:1217 msgid "" "The :meth:`Connection.recv` method automatically unpickles the data it " "receives, which can be a security risk unless you can trust the process " "which sent the message." msgstr "" -#: ../../library/multiprocessing.rst:1222 +#: ../../library/multiprocessing.rst:1221 msgid "" "Therefore, unless the connection object was produced using :func:`Pipe` you " "should only use the :meth:`~Connection.recv` and :meth:`~Connection.send` " @@ -1312,73 +1312,73 @@ msgid "" "`multiprocessing-auth-keys`." msgstr "" -#: ../../library/multiprocessing.rst:1229 +#: ../../library/multiprocessing.rst:1228 msgid "" "If a process is killed while it is trying to read or write to a pipe then " "the data in the pipe is likely to become corrupted, because it may become " "impossible to be sure where the message boundaries lie." msgstr "" -#: ../../library/multiprocessing.rst:1235 +#: ../../library/multiprocessing.rst:1234 msgid "Synchronization primitives" msgstr "" -#: ../../library/multiprocessing.rst:1239 +#: ../../library/multiprocessing.rst:1238 msgid "" "Generally synchronization primitives are not as necessary in a multiprocess " "program as they are in a multithreaded program. See the documentation for :" "mod:`threading` module." msgstr "" -#: ../../library/multiprocessing.rst:1243 +#: ../../library/multiprocessing.rst:1242 msgid "" "Note that one can also create synchronization primitives by using a manager " "object -- see :ref:`multiprocessing-managers`." msgstr "" -#: ../../library/multiprocessing.rst:1248 +#: ../../library/multiprocessing.rst:1247 msgid "A barrier object: a clone of :class:`threading.Barrier`." msgstr "" -#: ../../library/multiprocessing.rst:1254 +#: ../../library/multiprocessing.rst:1253 msgid "" "A bounded semaphore object: a close analog of :class:`threading." "BoundedSemaphore`." msgstr "" -#: ../../library/multiprocessing.rst:1257 -#: ../../library/multiprocessing.rst:1395 +#: ../../library/multiprocessing.rst:1256 +#: ../../library/multiprocessing.rst:1394 msgid "" "A solitary difference from its close analog exists: its ``acquire`` method's " "first argument is named *block*, as is consistent with :meth:`Lock.acquire`." msgstr "" -#: ../../library/multiprocessing.rst:1261 +#: ../../library/multiprocessing.rst:1260 msgid "" "On macOS, this is indistinguishable from :class:`Semaphore` because " "``sem_getvalue()`` is not implemented on that platform." msgstr "" -#: ../../library/multiprocessing.rst:1266 +#: ../../library/multiprocessing.rst:1265 msgid "A condition variable: an alias for :class:`threading.Condition`." msgstr "" -#: ../../library/multiprocessing.rst:1268 +#: ../../library/multiprocessing.rst:1267 msgid "" "If *lock* is specified then it should be a :class:`Lock` or :class:`RLock` " "object from :mod:`multiprocessing`." msgstr "" -#: ../../library/multiprocessing.rst:1271 -#: ../../library/multiprocessing.rst:1806 +#: ../../library/multiprocessing.rst:1270 +#: ../../library/multiprocessing.rst:1805 msgid "The :meth:`~threading.Condition.wait_for` method was added." msgstr "" -#: ../../library/multiprocessing.rst:1276 +#: ../../library/multiprocessing.rst:1275 msgid "A clone of :class:`threading.Event`." msgstr "" -#: ../../library/multiprocessing.rst:1281 +#: ../../library/multiprocessing.rst:1280 msgid "" "A non-recursive lock object: a close analog of :class:`threading.Lock`. Once " "a process or thread has acquired a lock, subsequent attempts to acquire it " @@ -1389,25 +1389,25 @@ msgid "" "as noted." msgstr "" -#: ../../library/multiprocessing.rst:1289 +#: ../../library/multiprocessing.rst:1288 msgid "" "Note that :class:`Lock` is actually a factory function which returns an " "instance of ``multiprocessing.synchronize.Lock`` initialized with a default " "context." msgstr "" -#: ../../library/multiprocessing.rst:1293 +#: ../../library/multiprocessing.rst:1292 msgid "" ":class:`Lock` supports the :term:`context manager` protocol and thus may be " "used in :keyword:`with` statements." msgstr "" -#: ../../library/multiprocessing.rst:1298 -#: ../../library/multiprocessing.rst:1349 +#: ../../library/multiprocessing.rst:1297 +#: ../../library/multiprocessing.rst:1348 msgid "Acquire a lock, blocking or non-blocking." msgstr "" -#: ../../library/multiprocessing.rst:1300 +#: ../../library/multiprocessing.rst:1299 msgid "" "With the *block* argument set to ``True`` (the default), the method call " "will block until the lock is in an unlocked state, then set it to locked and " @@ -1415,14 +1415,14 @@ msgid "" "that in :meth:`threading.Lock.acquire`." msgstr "" -#: ../../library/multiprocessing.rst:1305 +#: ../../library/multiprocessing.rst:1304 msgid "" "With the *block* argument set to ``False``, the method call does not block. " "If the lock is currently in a locked state, return ``False``; otherwise set " "the lock to a locked state and return ``True``." msgstr "" -#: ../../library/multiprocessing.rst:1309 +#: ../../library/multiprocessing.rst:1308 msgid "" "When invoked with a positive, floating-point value for *timeout*, block for " "at most the number of seconds specified by *timeout* as long as the lock can " @@ -1436,19 +1436,19 @@ msgid "" "acquired or ``False`` if the timeout period has elapsed." msgstr "" -#: ../../library/multiprocessing.rst:1324 +#: ../../library/multiprocessing.rst:1323 msgid "" "Release a lock. This can be called from any process or thread, not only the " "process or thread which originally acquired the lock." msgstr "" -#: ../../library/multiprocessing.rst:1327 +#: ../../library/multiprocessing.rst:1326 msgid "" "Behavior is the same as in :meth:`threading.Lock.release` except that when " "invoked on an unlocked lock, a :exc:`ValueError` is raised." msgstr "" -#: ../../library/multiprocessing.rst:1333 +#: ../../library/multiprocessing.rst:1332 msgid "" "A recursive lock object: a close analog of :class:`threading.RLock`. A " "recursive lock must be released by the process or thread that acquired it. " @@ -1457,20 +1457,20 @@ msgid "" "release it once for each time it has been acquired." msgstr "" -#: ../../library/multiprocessing.rst:1339 +#: ../../library/multiprocessing.rst:1338 msgid "" "Note that :class:`RLock` is actually a factory function which returns an " "instance of ``multiprocessing.synchronize.RLock`` initialized with a default " "context." msgstr "" -#: ../../library/multiprocessing.rst:1343 +#: ../../library/multiprocessing.rst:1342 msgid "" ":class:`RLock` supports the :term:`context manager` protocol and thus may be " "used in :keyword:`with` statements." msgstr "" -#: ../../library/multiprocessing.rst:1351 +#: ../../library/multiprocessing.rst:1350 msgid "" "When invoked with the *block* argument set to ``True``, block until the lock " "is in an unlocked state (not owned by any process or thread) unless the lock " @@ -1483,7 +1483,7 @@ msgid "" "itself." msgstr "" -#: ../../library/multiprocessing.rst:1361 +#: ../../library/multiprocessing.rst:1360 msgid "" "When invoked with the *block* argument set to ``False``, do not block. If " "the lock has already been acquired (and thus is owned) by another process or " @@ -1494,14 +1494,14 @@ msgid "" "a return value of ``True``." msgstr "" -#: ../../library/multiprocessing.rst:1369 +#: ../../library/multiprocessing.rst:1368 msgid "" "Use and behaviors of the *timeout* argument are the same as in :meth:`Lock." "acquire`. Note that some of these behaviors of *timeout* differ from the " "implemented behaviors in :meth:`threading.RLock.acquire`." msgstr "" -#: ../../library/multiprocessing.rst:1376 +#: ../../library/multiprocessing.rst:1375 msgid "" "Release a lock, decrementing the recursion level. If after the decrement " "the recursion level is zero, reset the lock to unlocked (not owned by any " @@ -1511,7 +1511,7 @@ msgid "" "locked and owned by the calling process or thread." msgstr "" -#: ../../library/multiprocessing.rst:1384 +#: ../../library/multiprocessing.rst:1383 msgid "" "Only call this method when the calling process or thread owns the lock. An :" "exc:`AssertionError` is raised if this method is called by a process or " @@ -1520,17 +1520,17 @@ msgid "" "from the implemented behavior in :meth:`threading.RLock.release`." msgstr "" -#: ../../library/multiprocessing.rst:1393 +#: ../../library/multiprocessing.rst:1392 msgid "A semaphore object: a close analog of :class:`threading.Semaphore`." msgstr "" -#: ../../library/multiprocessing.rst:1400 +#: ../../library/multiprocessing.rst:1399 msgid "" "On macOS, ``sem_timedwait`` is unsupported, so calling ``acquire()`` with a " "timeout will emulate that function's behavior using a sleeping loop." msgstr "" -#: ../../library/multiprocessing.rst:1405 +#: ../../library/multiprocessing.rst:1404 msgid "" "If the SIGINT signal generated by :kbd:`Ctrl-C` arrives while the main " "thread is blocked by a call to :meth:`BoundedSemaphore.acquire`, :meth:`Lock." @@ -1539,13 +1539,13 @@ msgid "" "interrupted and :exc:`KeyboardInterrupt` will be raised." msgstr "" -#: ../../library/multiprocessing.rst:1411 +#: ../../library/multiprocessing.rst:1410 msgid "" "This differs from the behaviour of :mod:`threading` where SIGINT will be " "ignored while the equivalent blocking calls are in progress." msgstr "" -#: ../../library/multiprocessing.rst:1416 +#: ../../library/multiprocessing.rst:1415 msgid "" "Some of this package's functionality requires a functioning shared semaphore " "implementation on the host operating system. Without one, the :mod:" @@ -1554,32 +1554,32 @@ msgid "" "additional information." msgstr "" -#: ../../library/multiprocessing.rst:1424 +#: ../../library/multiprocessing.rst:1423 msgid "Shared :mod:`ctypes` Objects" msgstr "" -#: ../../library/multiprocessing.rst:1426 +#: ../../library/multiprocessing.rst:1425 msgid "" "It is possible to create shared objects using shared memory which can be " "inherited by child processes." msgstr "" -#: ../../library/multiprocessing.rst:1431 +#: ../../library/multiprocessing.rst:1430 msgid "" "Return a :mod:`ctypes` object allocated from shared memory. By default the " "return value is actually a synchronized wrapper for the object. The object " "itself can be accessed via the *value* attribute of a :class:`Value`." msgstr "" -#: ../../library/multiprocessing.rst:1435 -#: ../../library/multiprocessing.rst:1522 +#: ../../library/multiprocessing.rst:1434 +#: ../../library/multiprocessing.rst:1521 msgid "" "*typecode_or_type* determines the type of the returned object: it is either " "a ctypes type or a one character typecode of the kind used by the :mod:" "`array` module. *\\*args* is passed on to the constructor for the type." msgstr "" -#: ../../library/multiprocessing.rst:1439 +#: ../../library/multiprocessing.rst:1438 msgid "" "If *lock* is ``True`` (the default) then a new recursive lock object is " "created to synchronize access to the value. If *lock* is a :class:`Lock` " @@ -1589,32 +1589,32 @@ msgid "" "\"process-safe\"." msgstr "" -#: ../../library/multiprocessing.rst:1446 +#: ../../library/multiprocessing.rst:1445 msgid "" "Operations like ``+=`` which involve a read and write are not atomic. So " "if, for instance, you want to atomically increment a shared value it is " "insufficient to just do ::" msgstr "" -#: ../../library/multiprocessing.rst:1452 +#: ../../library/multiprocessing.rst:1451 msgid "" "Assuming the associated lock is recursive (which it is by default) you can " "instead do ::" msgstr "" -#: ../../library/multiprocessing.rst:1458 -#: ../../library/multiprocessing.rst:1548 -#: ../../library/multiprocessing.rst:1563 +#: ../../library/multiprocessing.rst:1457 +#: ../../library/multiprocessing.rst:1547 +#: ../../library/multiprocessing.rst:1562 msgid "Note that *lock* is a keyword-only argument." msgstr "" -#: ../../library/multiprocessing.rst:1462 +#: ../../library/multiprocessing.rst:1461 msgid "" "Return a ctypes array allocated from shared memory. By default the return " "value is actually a synchronized wrapper for the array." msgstr "" -#: ../../library/multiprocessing.rst:1465 +#: ../../library/multiprocessing.rst:1464 msgid "" "*typecode_or_type* determines the type of the elements of the returned " "array: it is either a ctypes type or a one character typecode of the kind " @@ -1624,7 +1624,7 @@ msgid "" "initialize the array and whose length determines the length of the array." msgstr "" -#: ../../library/multiprocessing.rst:1472 +#: ../../library/multiprocessing.rst:1471 msgid "" "If *lock* is ``True`` (the default) then a new lock object is created to " "synchronize access to the value. If *lock* is a :class:`Lock` or :class:" @@ -1634,28 +1634,28 @@ msgid "" "safe\"." msgstr "" -#: ../../library/multiprocessing.rst:1479 +#: ../../library/multiprocessing.rst:1478 msgid "Note that *lock* is a keyword only argument." msgstr "" -#: ../../library/multiprocessing.rst:1481 +#: ../../library/multiprocessing.rst:1480 msgid "" "Note that an array of :data:`ctypes.c_char` has *value* and *raw* attributes " "which allow one to use it to store and retrieve strings." msgstr "" -#: ../../library/multiprocessing.rst:1486 +#: ../../library/multiprocessing.rst:1485 msgid "The :mod:`multiprocessing.sharedctypes` module" msgstr "" -#: ../../library/multiprocessing.rst:1491 +#: ../../library/multiprocessing.rst:1490 msgid "" "The :mod:`multiprocessing.sharedctypes` module provides functions for " "allocating :mod:`ctypes` objects from shared memory which can be inherited " "by child processes." msgstr "" -#: ../../library/multiprocessing.rst:1497 +#: ../../library/multiprocessing.rst:1496 msgid "" "Although it is possible to store a pointer in shared memory remember that " "this will refer to a location in the address space of a specific process. " @@ -1664,11 +1664,11 @@ msgid "" "may cause a crash." msgstr "" -#: ../../library/multiprocessing.rst:1505 +#: ../../library/multiprocessing.rst:1504 msgid "Return a ctypes array allocated from shared memory." msgstr "" -#: ../../library/multiprocessing.rst:1507 +#: ../../library/multiprocessing.rst:1506 msgid "" "*typecode_or_type* determines the type of the elements of the returned " "array: it is either a ctypes type or a one character typecode of the kind " @@ -1678,40 +1678,40 @@ msgid "" "initialize the array and whose length determines the length of the array." msgstr "" -#: ../../library/multiprocessing.rst:1514 +#: ../../library/multiprocessing.rst:1513 msgid "" "Note that setting and getting an element is potentially non-atomic -- use :" "func:`Array` instead to make sure that access is automatically synchronized " "using a lock." msgstr "" -#: ../../library/multiprocessing.rst:1520 +#: ../../library/multiprocessing.rst:1519 msgid "Return a ctypes object allocated from shared memory." msgstr "" -#: ../../library/multiprocessing.rst:1526 +#: ../../library/multiprocessing.rst:1525 msgid "" "Note that setting and getting the value is potentially non-atomic -- use :" "func:`Value` instead to make sure that access is automatically synchronized " "using a lock." msgstr "" -#: ../../library/multiprocessing.rst:1530 +#: ../../library/multiprocessing.rst:1529 msgid "" "Note that an array of :data:`ctypes.c_char` has ``value`` and ``raw`` " "attributes which allow one to use it to store and retrieve strings -- see " "documentation for :mod:`ctypes`." msgstr "" -#: ../../library/multiprocessing.rst:1536 +#: ../../library/multiprocessing.rst:1535 msgid "" "The same as :func:`RawArray` except that depending on the value of *lock* a " "process-safe synchronization wrapper may be returned instead of a raw ctypes " "array." msgstr "" -#: ../../library/multiprocessing.rst:1540 -#: ../../library/multiprocessing.rst:1556 +#: ../../library/multiprocessing.rst:1539 +#: ../../library/multiprocessing.rst:1555 msgid "" "If *lock* is ``True`` (the default) then a new lock object is created to " "synchronize access to the value. If *lock* is a :class:`~multiprocessing." @@ -1721,121 +1721,121 @@ msgid "" "not necessarily be \"process-safe\"." msgstr "" -#: ../../library/multiprocessing.rst:1552 +#: ../../library/multiprocessing.rst:1551 msgid "" "The same as :func:`RawValue` except that depending on the value of *lock* a " "process-safe synchronization wrapper may be returned instead of a raw ctypes " "object." msgstr "" -#: ../../library/multiprocessing.rst:1567 +#: ../../library/multiprocessing.rst:1566 msgid "" "Return a ctypes object allocated from shared memory which is a copy of the " "ctypes object *obj*." msgstr "" -#: ../../library/multiprocessing.rst:1572 +#: ../../library/multiprocessing.rst:1571 msgid "" "Return a process-safe wrapper object for a ctypes object which uses *lock* " "to synchronize access. If *lock* is ``None`` (the default) then a :class:" "`multiprocessing.RLock` object is created automatically." msgstr "" -#: ../../library/multiprocessing.rst:1576 +#: ../../library/multiprocessing.rst:1575 msgid "" "A synchronized wrapper will have two methods in addition to those of the " "object it wraps: :meth:`get_obj` returns the wrapped object and :meth:" "`get_lock` returns the lock object used for synchronization." msgstr "" -#: ../../library/multiprocessing.rst:1580 +#: ../../library/multiprocessing.rst:1579 msgid "" "Note that accessing the ctypes object through the wrapper can be a lot " "slower than accessing the raw ctypes object." msgstr "" -#: ../../library/multiprocessing.rst:1583 +#: ../../library/multiprocessing.rst:1582 msgid "Synchronized objects support the :term:`context manager` protocol." msgstr "" -#: ../../library/multiprocessing.rst:1587 +#: ../../library/multiprocessing.rst:1586 msgid "" "The table below compares the syntax for creating shared ctypes objects from " "shared memory with the normal ctypes syntax. (In the table ``MyStruct`` is " "some subclass of :class:`ctypes.Structure`.)" msgstr "" -#: ../../library/multiprocessing.rst:1592 +#: ../../library/multiprocessing.rst:1591 msgid "ctypes" msgstr "ctypes" -#: ../../library/multiprocessing.rst:1592 +#: ../../library/multiprocessing.rst:1591 msgid "sharedctypes using type" msgstr "" -#: ../../library/multiprocessing.rst:1592 +#: ../../library/multiprocessing.rst:1591 msgid "sharedctypes using typecode" msgstr "" -#: ../../library/multiprocessing.rst:1594 +#: ../../library/multiprocessing.rst:1593 msgid "c_double(2.4)" msgstr "c_double(2.4)" -#: ../../library/multiprocessing.rst:1594 +#: ../../library/multiprocessing.rst:1593 msgid "RawValue(c_double, 2.4)" msgstr "RawValue(c_double, 2.4)" -#: ../../library/multiprocessing.rst:1594 +#: ../../library/multiprocessing.rst:1593 msgid "RawValue('d', 2.4)" msgstr "RawValue('d', 2.4)" -#: ../../library/multiprocessing.rst:1595 +#: ../../library/multiprocessing.rst:1594 msgid "MyStruct(4, 6)" msgstr "MyStruct(4, 6)" -#: ../../library/multiprocessing.rst:1595 +#: ../../library/multiprocessing.rst:1594 msgid "RawValue(MyStruct, 4, 6)" msgstr "RawValue(MyStruct, 4, 6)" -#: ../../library/multiprocessing.rst:1596 +#: ../../library/multiprocessing.rst:1595 msgid "(c_short * 7)()" msgstr "(c_short * 7)()" -#: ../../library/multiprocessing.rst:1596 +#: ../../library/multiprocessing.rst:1595 msgid "RawArray(c_short, 7)" msgstr "RawArray(c_short, 7)" -#: ../../library/multiprocessing.rst:1596 +#: ../../library/multiprocessing.rst:1595 msgid "RawArray('h', 7)" msgstr "RawArray('h', 7)" -#: ../../library/multiprocessing.rst:1597 +#: ../../library/multiprocessing.rst:1596 msgid "(c_int * 3)(9, 2, 8)" msgstr "(c_int * 3)(9, 2, 8)" -#: ../../library/multiprocessing.rst:1597 +#: ../../library/multiprocessing.rst:1596 msgid "RawArray(c_int, (9, 2, 8))" msgstr "RawArray(c_int, (9, 2, 8))" -#: ../../library/multiprocessing.rst:1597 +#: ../../library/multiprocessing.rst:1596 msgid "RawArray('i', (9, 2, 8))" msgstr "RawArray('i', (9, 2, 8))" -#: ../../library/multiprocessing.rst:1601 +#: ../../library/multiprocessing.rst:1600 msgid "" "Below is an example where a number of ctypes objects are modified by a child " "process::" msgstr "" -#: ../../library/multiprocessing.rst:1639 +#: ../../library/multiprocessing.rst:1638 msgid "The results printed are ::" msgstr "" -#: ../../library/multiprocessing.rst:1652 +#: ../../library/multiprocessing.rst:1651 msgid "Managers" msgstr "" -#: ../../library/multiprocessing.rst:1654 +#: ../../library/multiprocessing.rst:1653 msgid "" "Managers provide a way to create data which can be shared between different " "processes, including sharing over a network between processes running on " @@ -1844,7 +1844,7 @@ msgid "" "proxies." msgstr "" -#: ../../library/multiprocessing.rst:1663 +#: ../../library/multiprocessing.rst:1662 msgid "" "Returns a started :class:`~multiprocessing.managers.SyncManager` object " "which can be used for sharing objects between processes. The returned " @@ -1852,31 +1852,31 @@ msgid "" "will create shared objects and return corresponding proxies." msgstr "" -#: ../../library/multiprocessing.rst:1671 +#: ../../library/multiprocessing.rst:1670 msgid "" "Manager processes will be shutdown as soon as they are garbage collected or " "their parent process exits. The manager classes are defined in the :mod:" "`multiprocessing.managers` module:" msgstr "" -#: ../../library/multiprocessing.rst:1677 +#: ../../library/multiprocessing.rst:1676 msgid "Create a BaseManager object." msgstr "" -#: ../../library/multiprocessing.rst:1679 +#: ../../library/multiprocessing.rst:1678 msgid "" "Once created one should call :meth:`start` or ``get_server()." "serve_forever()`` to ensure that the manager object refers to a started " "manager process." msgstr "" -#: ../../library/multiprocessing.rst:1682 +#: ../../library/multiprocessing.rst:1681 msgid "" "*address* is the address on which the manager process listens for new " "connections. If *address* is ``None`` then an arbitrary one is chosen." msgstr "" -#: ../../library/multiprocessing.rst:1685 +#: ../../library/multiprocessing.rst:1684 msgid "" "*authkey* is the authentication key which will be used to check the validity " "of incoming connections to the server process. If *authkey* is ``None`` " @@ -1884,50 +1884,50 @@ msgid "" "it must be a byte string." msgstr "" -#: ../../library/multiprocessing.rst:1692 +#: ../../library/multiprocessing.rst:1691 msgid "" "Start a subprocess to start the manager. If *initializer* is not ``None`` " "then the subprocess will call ``initializer(*initargs)`` when it starts." msgstr "" -#: ../../library/multiprocessing.rst:1697 +#: ../../library/multiprocessing.rst:1696 msgid "" "Returns a :class:`Server` object which represents the actual server under " "the control of the Manager. The :class:`Server` object supports the :meth:" "`serve_forever` method::" msgstr "" -#: ../../library/multiprocessing.rst:1706 +#: ../../library/multiprocessing.rst:1705 msgid ":class:`Server` additionally has an :attr:`address` attribute." msgstr "" -#: ../../library/multiprocessing.rst:1710 +#: ../../library/multiprocessing.rst:1709 msgid "Connect a local manager object to a remote manager process::" msgstr "" -#: ../../library/multiprocessing.rst:1718 +#: ../../library/multiprocessing.rst:1717 msgid "" "Stop the process used by the manager. This is only available if :meth:" "`start` has been used to start the server process." msgstr "" -#: ../../library/multiprocessing.rst:1721 +#: ../../library/multiprocessing.rst:1720 msgid "This can be called multiple times." msgstr "" -#: ../../library/multiprocessing.rst:1725 +#: ../../library/multiprocessing.rst:1724 msgid "" "A classmethod which can be used for registering a type or callable with the " "manager class." msgstr "" -#: ../../library/multiprocessing.rst:1728 +#: ../../library/multiprocessing.rst:1727 msgid "" "*typeid* is a \"type identifier\" which is used to identify a particular " "type of shared object. This must be a string." msgstr "" -#: ../../library/multiprocessing.rst:1731 +#: ../../library/multiprocessing.rst:1730 msgid "" "*callable* is a callable used for creating objects for this type " "identifier. If a manager instance will be connected to the server using " @@ -1935,14 +1935,14 @@ msgid "" "then this can be left as ``None``." msgstr "" -#: ../../library/multiprocessing.rst:1737 +#: ../../library/multiprocessing.rst:1736 msgid "" "*proxytype* is a subclass of :class:`BaseProxy` which is used to create " "proxies for shared objects with this *typeid*. If ``None`` then a proxy " "class is created automatically." msgstr "" -#: ../../library/multiprocessing.rst:1741 +#: ../../library/multiprocessing.rst:1740 msgid "" "*exposed* is used to specify a sequence of method names which proxies for " "this typeid should be allowed to access using :meth:`BaseProxy." @@ -1953,7 +1953,7 @@ msgid "" "method and whose name does not begin with ``'_'``.)" msgstr "" -#: ../../library/multiprocessing.rst:1750 +#: ../../library/multiprocessing.rst:1749 msgid "" "*method_to_typeid* is a mapping used to specify the return type of those " "exposed methods which should return a proxy. It maps method names to typeid " @@ -1963,22 +1963,22 @@ msgid "" "returned by the method will be copied by value." msgstr "" -#: ../../library/multiprocessing.rst:1757 +#: ../../library/multiprocessing.rst:1756 msgid "" "*create_method* determines whether a method should be created with name " "*typeid* which can be used to tell the server process to create a new shared " "object and return a proxy for it. By default it is ``True``." msgstr "" -#: ../../library/multiprocessing.rst:1761 +#: ../../library/multiprocessing.rst:1760 msgid ":class:`BaseManager` instances also have one read-only property:" msgstr "" -#: ../../library/multiprocessing.rst:1765 +#: ../../library/multiprocessing.rst:1764 msgid "The address used by the manager." msgstr "" -#: ../../library/multiprocessing.rst:1767 +#: ../../library/multiprocessing.rst:1766 msgid "" "Manager objects support the context management protocol -- see :ref:" "`typecontextmanager`. :meth:`~contextmanager.__enter__` starts the server " @@ -1986,173 +1986,173 @@ msgid "" "object. :meth:`~contextmanager.__exit__` calls :meth:`shutdown`." msgstr "" -#: ../../library/multiprocessing.rst:1773 +#: ../../library/multiprocessing.rst:1772 msgid "" "In previous versions :meth:`~contextmanager.__enter__` did not start the " "manager's server process if it was not already started." msgstr "" -#: ../../library/multiprocessing.rst:1778 +#: ../../library/multiprocessing.rst:1777 msgid "" "A subclass of :class:`BaseManager` which can be used for the synchronization " "of processes. Objects of this type are returned by :func:`multiprocessing." "Manager`." msgstr "" -#: ../../library/multiprocessing.rst:1782 +#: ../../library/multiprocessing.rst:1781 msgid "" "Its methods create and return :ref:`multiprocessing-proxy_objects` for a " "number of commonly used data types to be synchronized across processes. This " "notably includes shared lists and dictionaries." msgstr "" -#: ../../library/multiprocessing.rst:1788 +#: ../../library/multiprocessing.rst:1787 msgid "" "Create a shared :class:`threading.Barrier` object and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:1795 +#: ../../library/multiprocessing.rst:1794 msgid "" "Create a shared :class:`threading.BoundedSemaphore` object and return a " "proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:1800 +#: ../../library/multiprocessing.rst:1799 msgid "" "Create a shared :class:`threading.Condition` object and return a proxy for " "it." msgstr "" -#: ../../library/multiprocessing.rst:1803 +#: ../../library/multiprocessing.rst:1802 msgid "" "If *lock* is supplied then it should be a proxy for a :class:`threading." "Lock` or :class:`threading.RLock` object." msgstr "" -#: ../../library/multiprocessing.rst:1811 +#: ../../library/multiprocessing.rst:1810 msgid "" "Create a shared :class:`threading.Event` object and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:1815 +#: ../../library/multiprocessing.rst:1814 msgid "" "Create a shared :class:`threading.Lock` object and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:1819 +#: ../../library/multiprocessing.rst:1818 msgid "Create a shared :class:`Namespace` object and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:1823 +#: ../../library/multiprocessing.rst:1822 msgid "Create a shared :class:`queue.Queue` object and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:1827 +#: ../../library/multiprocessing.rst:1826 msgid "" "Create a shared :class:`threading.RLock` object and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:1831 +#: ../../library/multiprocessing.rst:1830 msgid "" "Create a shared :class:`threading.Semaphore` object and return a proxy for " "it." msgstr "" -#: ../../library/multiprocessing.rst:1836 +#: ../../library/multiprocessing.rst:1835 msgid "Create an array and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:1840 +#: ../../library/multiprocessing.rst:1839 msgid "" "Create an object with a writable ``value`` attribute and return a proxy for " "it." msgstr "" -#: ../../library/multiprocessing.rst:1847 +#: ../../library/multiprocessing.rst:1846 msgid "Create a shared :class:`dict` object and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:1852 +#: ../../library/multiprocessing.rst:1851 msgid "Create a shared :class:`list` object and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:1854 +#: ../../library/multiprocessing.rst:1853 msgid "" "Shared objects are capable of being nested. For example, a shared container " "object such as a shared list can contain other shared objects which will all " "be managed and synchronized by the :class:`SyncManager`." msgstr "" -#: ../../library/multiprocessing.rst:1861 +#: ../../library/multiprocessing.rst:1860 msgid "A type that can register with :class:`SyncManager`." msgstr "" -#: ../../library/multiprocessing.rst:1863 +#: ../../library/multiprocessing.rst:1862 msgid "" "A namespace object has no public methods, but does have writable attributes. " "Its representation shows the values of its attributes." msgstr "" -#: ../../library/multiprocessing.rst:1866 +#: ../../library/multiprocessing.rst:1865 msgid "" "However, when using a proxy for a namespace object, an attribute beginning " "with ``'_'`` will be an attribute of the proxy and not an attribute of the " "referent:" msgstr "" -#: ../../library/multiprocessing.rst:1882 +#: ../../library/multiprocessing.rst:1881 msgid "Customized managers" msgstr "" -#: ../../library/multiprocessing.rst:1884 +#: ../../library/multiprocessing.rst:1883 msgid "" "To create one's own manager, one creates a subclass of :class:`BaseManager` " "and uses the :meth:`~BaseManager.register` classmethod to register new types " "or callables with the manager class. For example::" msgstr "" -#: ../../library/multiprocessing.rst:1909 +#: ../../library/multiprocessing.rst:1908 msgid "Using a remote manager" msgstr "" -#: ../../library/multiprocessing.rst:1911 +#: ../../library/multiprocessing.rst:1910 msgid "" "It is possible to run a manager server on one machine and have clients use " "it from other machines (assuming that the firewalls involved allow it)." msgstr "" -#: ../../library/multiprocessing.rst:1914 +#: ../../library/multiprocessing.rst:1913 msgid "" "Running the following commands creates a server for a single shared queue " "which remote clients can access::" msgstr "" -#: ../../library/multiprocessing.rst:1926 +#: ../../library/multiprocessing.rst:1925 msgid "One client can access the server as follows::" msgstr "" -#: ../../library/multiprocessing.rst:1936 +#: ../../library/multiprocessing.rst:1935 msgid "Another client can also use it::" msgstr "" -#: ../../library/multiprocessing.rst:1947 +#: ../../library/multiprocessing.rst:1946 msgid "" "Local processes can also access that queue, using the code from above on the " "client to access it remotely::" msgstr "" -#: ../../library/multiprocessing.rst:1972 +#: ../../library/multiprocessing.rst:1971 msgid "Proxy Objects" msgstr "" -#: ../../library/multiprocessing.rst:1974 +#: ../../library/multiprocessing.rst:1973 msgid "" "A proxy is an object which *refers* to a shared object which lives " "(presumably) in a different process. The shared object is said to be the " "*referent* of the proxy. Multiple proxy objects may have the same referent." msgstr "" -#: ../../library/multiprocessing.rst:1978 +#: ../../library/multiprocessing.rst:1977 msgid "" "A proxy object has methods which invoke corresponding methods of its " "referent (although not every method of the referent will necessarily be " @@ -2160,14 +2160,14 @@ msgid "" "its referent can:" msgstr "" -#: ../../library/multiprocessing.rst:1996 +#: ../../library/multiprocessing.rst:1995 msgid "" "Notice that applying :func:`str` to a proxy will return the representation " "of the referent, whereas applying :func:`repr` will return the " "representation of the proxy." msgstr "" -#: ../../library/multiprocessing.rst:2000 +#: ../../library/multiprocessing.rst:1999 msgid "" "An important feature of proxy objects is that they are picklable so they can " "be passed between processes. As such, a referent can contain :ref:" @@ -2175,11 +2175,11 @@ msgid "" "lists, dicts, and other :ref:`multiprocessing-proxy_objects`:" msgstr "" -#: ../../library/multiprocessing.rst:2016 +#: ../../library/multiprocessing.rst:2015 msgid "Similarly, dict and list proxies may be nested inside one another::" msgstr "" -#: ../../library/multiprocessing.rst:2029 +#: ../../library/multiprocessing.rst:2028 msgid "" "If standard (non-proxy) :class:`list` or :class:`dict` objects are contained " "in a referent, modifications to those mutable values will not be propagated " @@ -2190,53 +2190,53 @@ msgid "" "assign the modified value to the container proxy::" msgstr "" -#: ../../library/multiprocessing.rst:2048 +#: ../../library/multiprocessing.rst:2047 msgid "" "This approach is perhaps less convenient than employing nested :ref:" "`multiprocessing-proxy_objects` for most use cases but also demonstrates a " "level of control over the synchronization." msgstr "" -#: ../../library/multiprocessing.rst:2054 +#: ../../library/multiprocessing.rst:2053 msgid "" "The proxy types in :mod:`multiprocessing` do nothing to support comparisons " "by value. So, for instance, we have:" msgstr "" -#: ../../library/multiprocessing.rst:2062 +#: ../../library/multiprocessing.rst:2061 msgid "" "One should just use a copy of the referent instead when making comparisons." msgstr "" -#: ../../library/multiprocessing.rst:2066 +#: ../../library/multiprocessing.rst:2065 msgid "Proxy objects are instances of subclasses of :class:`BaseProxy`." msgstr "" -#: ../../library/multiprocessing.rst:2070 +#: ../../library/multiprocessing.rst:2069 msgid "Call and return the result of a method of the proxy's referent." msgstr "" -#: ../../library/multiprocessing.rst:2072 +#: ../../library/multiprocessing.rst:2071 msgid "" "If ``proxy`` is a proxy whose referent is ``obj`` then the expression ::" msgstr "" -#: ../../library/multiprocessing.rst:2076 +#: ../../library/multiprocessing.rst:2075 msgid "will evaluate the expression ::" msgstr "" -#: ../../library/multiprocessing.rst:2080 +#: ../../library/multiprocessing.rst:2079 msgid "in the manager's process." msgstr "" -#: ../../library/multiprocessing.rst:2082 +#: ../../library/multiprocessing.rst:2081 msgid "" "The returned value will be a copy of the result of the call or a proxy to a " "new shared object -- see documentation for the *method_to_typeid* argument " "of :meth:`BaseManager.register`." msgstr "" -#: ../../library/multiprocessing.rst:2086 +#: ../../library/multiprocessing.rst:2085 msgid "" "If an exception is raised by the call, then is re-raised by :meth:" "`_callmethod`. If some other exception is raised in the manager's process " @@ -2244,79 +2244,79 @@ msgid "" "meth:`_callmethod`." msgstr "" -#: ../../library/multiprocessing.rst:2091 +#: ../../library/multiprocessing.rst:2090 msgid "" "Note in particular that an exception will be raised if *methodname* has not " "been *exposed*." msgstr "" -#: ../../library/multiprocessing.rst:2094 +#: ../../library/multiprocessing.rst:2093 msgid "An example of the usage of :meth:`_callmethod`:" msgstr "" -#: ../../library/multiprocessing.rst:2110 +#: ../../library/multiprocessing.rst:2109 msgid "Return a copy of the referent." msgstr "" -#: ../../library/multiprocessing.rst:2112 +#: ../../library/multiprocessing.rst:2111 msgid "If the referent is unpicklable then this will raise an exception." msgstr "" -#: ../../library/multiprocessing.rst:2116 +#: ../../library/multiprocessing.rst:2115 msgid "Return a representation of the proxy object." msgstr "" -#: ../../library/multiprocessing.rst:2120 +#: ../../library/multiprocessing.rst:2119 msgid "Return the representation of the referent." msgstr "" -#: ../../library/multiprocessing.rst:2124 +#: ../../library/multiprocessing.rst:2123 msgid "Cleanup" msgstr "" -#: ../../library/multiprocessing.rst:2126 +#: ../../library/multiprocessing.rst:2125 msgid "" "A proxy object uses a weakref callback so that when it gets garbage " "collected it deregisters itself from the manager which owns its referent." msgstr "" -#: ../../library/multiprocessing.rst:2129 +#: ../../library/multiprocessing.rst:2128 msgid "" "A shared object gets deleted from the manager process when there are no " "longer any proxies referring to it." msgstr "" -#: ../../library/multiprocessing.rst:2134 +#: ../../library/multiprocessing.rst:2133 msgid "Process Pools" msgstr "" -#: ../../library/multiprocessing.rst:2139 +#: ../../library/multiprocessing.rst:2138 msgid "" "One can create a pool of processes which will carry out tasks submitted to " "it with the :class:`Pool` class." msgstr "" -#: ../../library/multiprocessing.rst:2144 +#: ../../library/multiprocessing.rst:2143 msgid "" "A process pool object which controls a pool of worker processes to which " "jobs can be submitted. It supports asynchronous results with timeouts and " "callbacks and has a parallel map implementation." msgstr "" -#: ../../library/multiprocessing.rst:2148 +#: ../../library/multiprocessing.rst:2147 msgid "" "*processes* is the number of worker processes to use. If *processes* is " "``None`` then the number returned by :func:`os.cpu_count` is used." msgstr "" -#: ../../library/multiprocessing.rst:2151 -#: ../../library/multiprocessing.rst:2712 +#: ../../library/multiprocessing.rst:2150 +#: ../../library/multiprocessing.rst:2711 msgid "" "If *initializer* is not ``None`` then each worker process will call " "``initializer(*initargs)`` when it starts." msgstr "" -#: ../../library/multiprocessing.rst:2154 +#: ../../library/multiprocessing.rst:2153 msgid "" "*maxtasksperchild* is the number of tasks a worker process can complete " "before it will exit and be replaced with a fresh worker process, to enable " @@ -2324,7 +2324,7 @@ msgid "" "which means worker processes will live as long as the pool." msgstr "" -#: ../../library/multiprocessing.rst:2159 +#: ../../library/multiprocessing.rst:2158 msgid "" "*context* can be used to specify the context used for starting the worker " "processes. Usually a pool is created using the function :func:" @@ -2332,13 +2332,13 @@ msgid "" "both cases *context* is set appropriately." msgstr "" -#: ../../library/multiprocessing.rst:2165 +#: ../../library/multiprocessing.rst:2164 msgid "" "Note that the methods of the pool object should only be called by the " "process which created the pool." msgstr "" -#: ../../library/multiprocessing.rst:2169 +#: ../../library/multiprocessing.rst:2168 msgid "" ":class:`multiprocessing.pool` objects have internal resources that need to " "be properly managed (like any other resource) by using the pool as a context " @@ -2346,22 +2346,22 @@ msgid "" "to do this can lead to the process hanging on finalization." msgstr "" -#: ../../library/multiprocessing.rst:2174 +#: ../../library/multiprocessing.rst:2173 msgid "" "Note that it is **not correct** to rely on the garbage collector to destroy " "the pool as CPython does not assure that the finalizer of the pool will be " "called (see :meth:`object.__del__` for more information)." msgstr "" -#: ../../library/multiprocessing.rst:2178 +#: ../../library/multiprocessing.rst:2177 msgid "*maxtasksperchild*" msgstr "" -#: ../../library/multiprocessing.rst:2181 +#: ../../library/multiprocessing.rst:2180 msgid "*context*" msgstr "" -#: ../../library/multiprocessing.rst:2186 +#: ../../library/multiprocessing.rst:2185 msgid "" "Worker processes within a :class:`Pool` typically live for the complete " "duration of the Pool's work queue. A frequent pattern found in other systems " @@ -2372,7 +2372,7 @@ msgid "" "ability to the end user." msgstr "" -#: ../../library/multiprocessing.rst:2196 +#: ../../library/multiprocessing.rst:2195 msgid "" "Call *func* with arguments *args* and keyword arguments *kwds*. It blocks " "until the result is ready. Given this blocks, :meth:`apply_async` is better " @@ -2380,14 +2380,14 @@ msgid "" "executed in one of the workers of the pool." msgstr "" -#: ../../library/multiprocessing.rst:2203 +#: ../../library/multiprocessing.rst:2202 msgid "" "A variant of the :meth:`apply` method which returns a :class:" "`~multiprocessing.pool.AsyncResult` object." msgstr "" -#: ../../library/multiprocessing.rst:2206 -#: ../../library/multiprocessing.rst:2237 +#: ../../library/multiprocessing.rst:2205 +#: ../../library/multiprocessing.rst:2236 msgid "" "If *callback* is specified then it should be a callable which accepts a " "single argument. When the result becomes ready *callback* is applied to it, " @@ -2395,60 +2395,60 @@ msgid "" "applied instead." msgstr "" -#: ../../library/multiprocessing.rst:2211 -#: ../../library/multiprocessing.rst:2242 +#: ../../library/multiprocessing.rst:2210 +#: ../../library/multiprocessing.rst:2241 msgid "" "If *error_callback* is specified then it should be a callable which accepts " "a single argument. If the target function fails, then the *error_callback* " "is called with the exception instance." msgstr "" -#: ../../library/multiprocessing.rst:2215 -#: ../../library/multiprocessing.rst:2246 +#: ../../library/multiprocessing.rst:2214 +#: ../../library/multiprocessing.rst:2245 msgid "" "Callbacks should complete immediately since otherwise the thread which " "handles the results will get blocked." msgstr "" -#: ../../library/multiprocessing.rst:2220 +#: ../../library/multiprocessing.rst:2219 msgid "" "A parallel equivalent of the :func:`map` built-in function (it supports only " "one *iterable* argument though, for multiple iterables see :meth:`starmap`). " "It blocks until the result is ready." msgstr "" -#: ../../library/multiprocessing.rst:2224 +#: ../../library/multiprocessing.rst:2223 msgid "" "This method chops the iterable into a number of chunks which it submits to " "the process pool as separate tasks. The (approximate) size of these chunks " "can be specified by setting *chunksize* to a positive integer." msgstr "" -#: ../../library/multiprocessing.rst:2228 +#: ../../library/multiprocessing.rst:2227 msgid "" "Note that it may cause high memory usage for very long iterables. Consider " "using :meth:`imap` or :meth:`imap_unordered` with explicit *chunksize* " "option for better efficiency." msgstr "" -#: ../../library/multiprocessing.rst:2234 +#: ../../library/multiprocessing.rst:2233 msgid "" "A variant of the :meth:`.map` method which returns a :class:" "`~multiprocessing.pool.AsyncResult` object." msgstr "" -#: ../../library/multiprocessing.rst:2251 +#: ../../library/multiprocessing.rst:2250 msgid "A lazier version of :meth:`.map`." msgstr "" -#: ../../library/multiprocessing.rst:2253 +#: ../../library/multiprocessing.rst:2252 msgid "" "The *chunksize* argument is the same as the one used by the :meth:`.map` " "method. For very long iterables using a large value for *chunksize* can " "make the job complete **much** faster than using the default value of ``1``." msgstr "" -#: ../../library/multiprocessing.rst:2258 +#: ../../library/multiprocessing.rst:2257 msgid "" "Also if *chunksize* is ``1`` then the :meth:`!next` method of the iterator " "returned by the :meth:`imap` method has an optional *timeout* parameter: " @@ -2456,65 +2456,65 @@ msgid "" "result cannot be returned within *timeout* seconds." msgstr "" -#: ../../library/multiprocessing.rst:2265 +#: ../../library/multiprocessing.rst:2264 msgid "" "The same as :meth:`imap` except that the ordering of the results from the " "returned iterator should be considered arbitrary. (Only when there is only " "one worker process is the order guaranteed to be \"correct\".)" msgstr "" -#: ../../library/multiprocessing.rst:2271 +#: ../../library/multiprocessing.rst:2270 msgid "" "Like :meth:`~multiprocessing.pool.Pool.map` except that the elements of the " "*iterable* are expected to be iterables that are unpacked as arguments." msgstr "" -#: ../../library/multiprocessing.rst:2275 +#: ../../library/multiprocessing.rst:2274 msgid "" "Hence an *iterable* of ``[(1,2), (3, 4)]`` results in ``[func(1,2), " "func(3,4)]``." msgstr "" -#: ../../library/multiprocessing.rst:2282 +#: ../../library/multiprocessing.rst:2281 msgid "" "A combination of :meth:`starmap` and :meth:`map_async` that iterates over " "*iterable* of iterables and calls *func* with the iterables unpacked. " "Returns a result object." msgstr "" -#: ../../library/multiprocessing.rst:2290 +#: ../../library/multiprocessing.rst:2289 msgid "" "Prevents any more tasks from being submitted to the pool. Once all the " "tasks have been completed the worker processes will exit." msgstr "" -#: ../../library/multiprocessing.rst:2295 +#: ../../library/multiprocessing.rst:2294 msgid "" "Stops the worker processes immediately without completing outstanding work. " "When the pool object is garbage collected :meth:`terminate` will be called " "immediately." msgstr "" -#: ../../library/multiprocessing.rst:2301 +#: ../../library/multiprocessing.rst:2300 msgid "" "Wait for the worker processes to exit. One must call :meth:`close` or :meth:" "`terminate` before using :meth:`join`." msgstr "" -#: ../../library/multiprocessing.rst:2304 +#: ../../library/multiprocessing.rst:2303 msgid "" "Pool objects now support the context management protocol -- see :ref:" "`typecontextmanager`. :meth:`~contextmanager.__enter__` returns the pool " "object, and :meth:`~contextmanager.__exit__` calls :meth:`terminate`." msgstr "" -#: ../../library/multiprocessing.rst:2312 +#: ../../library/multiprocessing.rst:2311 msgid "" "The class of the result returned by :meth:`Pool.apply_async` and :meth:`Pool." "map_async`." msgstr "" -#: ../../library/multiprocessing.rst:2317 +#: ../../library/multiprocessing.rst:2316 msgid "" "Return the result when it arrives. If *timeout* is not ``None`` and the " "result does not arrive within *timeout* seconds then :exc:`multiprocessing." @@ -2522,41 +2522,41 @@ msgid "" "exception will be reraised by :meth:`get`." msgstr "" -#: ../../library/multiprocessing.rst:2324 +#: ../../library/multiprocessing.rst:2323 msgid "Wait until the result is available or until *timeout* seconds pass." msgstr "" -#: ../../library/multiprocessing.rst:2328 +#: ../../library/multiprocessing.rst:2327 msgid "Return whether the call has completed." msgstr "" -#: ../../library/multiprocessing.rst:2332 +#: ../../library/multiprocessing.rst:2331 msgid "" "Return whether the call completed without raising an exception. Will raise :" "exc:`ValueError` if the result is not ready." msgstr "" -#: ../../library/multiprocessing.rst:2335 +#: ../../library/multiprocessing.rst:2334 msgid "" "If the result is not ready, :exc:`ValueError` is raised instead of :exc:" "`AssertionError`." msgstr "" -#: ../../library/multiprocessing.rst:2339 +#: ../../library/multiprocessing.rst:2338 msgid "The following example demonstrates the use of a pool::" msgstr "" -#: ../../library/multiprocessing.rst:2366 +#: ../../library/multiprocessing.rst:2365 msgid "Listeners and Clients" msgstr "" -#: ../../library/multiprocessing.rst:2371 +#: ../../library/multiprocessing.rst:2370 msgid "" "Usually message passing between processes is done using queues or by using :" "class:`~Connection` objects returned by :func:`~multiprocessing.Pipe`." msgstr "" -#: ../../library/multiprocessing.rst:2375 +#: ../../library/multiprocessing.rst:2374 msgid "" "However, the :mod:`multiprocessing.connection` module allows some extra " "flexibility. It basically gives a high level message oriented API for " @@ -2565,46 +2565,46 @@ msgid "" "multiple connections at the same time." msgstr "" -#: ../../library/multiprocessing.rst:2384 +#: ../../library/multiprocessing.rst:2383 msgid "" "Send a randomly generated message to the other end of the connection and " "wait for a reply." msgstr "" -#: ../../library/multiprocessing.rst:2387 +#: ../../library/multiprocessing.rst:2386 msgid "" "If the reply matches the digest of the message using *authkey* as the key " "then a welcome message is sent to the other end of the connection. " "Otherwise :exc:`~multiprocessing.AuthenticationError` is raised." msgstr "" -#: ../../library/multiprocessing.rst:2393 +#: ../../library/multiprocessing.rst:2392 msgid "" "Receive a message, calculate the digest of the message using *authkey* as " "the key, and then send the digest back." msgstr "" -#: ../../library/multiprocessing.rst:2396 +#: ../../library/multiprocessing.rst:2395 msgid "" "If a welcome message is not received, then :exc:`~multiprocessing." "AuthenticationError` is raised." msgstr "" -#: ../../library/multiprocessing.rst:2401 +#: ../../library/multiprocessing.rst:2400 msgid "" "Attempt to set up a connection to the listener which is using address " "*address*, returning a :class:`~Connection`." msgstr "" -#: ../../library/multiprocessing.rst:2404 +#: ../../library/multiprocessing.rst:2403 msgid "" "The type of the connection is determined by *family* argument, but this can " "generally be omitted since it can usually be inferred from the format of " "*address*. (See :ref:`multiprocessing-address-formats`)" msgstr "" -#: ../../library/multiprocessing.rst:2408 -#: ../../library/multiprocessing.rst:2443 +#: ../../library/multiprocessing.rst:2407 +#: ../../library/multiprocessing.rst:2442 msgid "" "If *authkey* is given and not None, it should be a byte string and will be " "used as the secret key for an HMAC-based authentication challenge. No " @@ -2613,26 +2613,26 @@ msgid "" "`multiprocessing-auth-keys`." msgstr "" -#: ../../library/multiprocessing.rst:2416 +#: ../../library/multiprocessing.rst:2415 msgid "" "A wrapper for a bound socket or Windows named pipe which is 'listening' for " "connections." msgstr "" -#: ../../library/multiprocessing.rst:2419 +#: ../../library/multiprocessing.rst:2418 msgid "" "*address* is the address to be used by the bound socket or named pipe of the " "listener object." msgstr "" -#: ../../library/multiprocessing.rst:2424 +#: ../../library/multiprocessing.rst:2423 msgid "" "If an address of '0.0.0.0' is used, the address will not be a connectable " "end point on Windows. If you require a connectable end-point, you should use " "'127.0.0.1'." msgstr "" -#: ../../library/multiprocessing.rst:2428 +#: ../../library/multiprocessing.rst:2427 msgid "" "*family* is the type of socket (or named pipe) to use. This can be one of " "the strings ``'AF_INET'`` (for a TCP socket), ``'AF_UNIX'`` (for a Unix " @@ -2646,49 +2646,49 @@ msgid "" "using :func:`tempfile.mkstemp`." msgstr "" -#: ../../library/multiprocessing.rst:2439 +#: ../../library/multiprocessing.rst:2438 msgid "" "If the listener object uses a socket then *backlog* (1 by default) is passed " "to the :meth:`~socket.socket.listen` method of the socket once it has been " "bound." msgstr "" -#: ../../library/multiprocessing.rst:2451 +#: ../../library/multiprocessing.rst:2450 msgid "" "Accept a connection on the bound socket or named pipe of the listener object " "and return a :class:`~Connection` object. If authentication is attempted and " "fails, then :exc:`~multiprocessing.AuthenticationError` is raised." msgstr "" -#: ../../library/multiprocessing.rst:2458 +#: ../../library/multiprocessing.rst:2457 msgid "" "Close the bound socket or named pipe of the listener object. This is called " "automatically when the listener is garbage collected. However it is " "advisable to call it explicitly." msgstr "" -#: ../../library/multiprocessing.rst:2462 +#: ../../library/multiprocessing.rst:2461 msgid "Listener objects have the following read-only properties:" msgstr "" -#: ../../library/multiprocessing.rst:2466 +#: ../../library/multiprocessing.rst:2465 msgid "The address which is being used by the Listener object." msgstr "" -#: ../../library/multiprocessing.rst:2470 +#: ../../library/multiprocessing.rst:2469 msgid "" "The address from which the last accepted connection came. If this is " "unavailable then it is ``None``." msgstr "" -#: ../../library/multiprocessing.rst:2473 +#: ../../library/multiprocessing.rst:2472 msgid "" "Listener objects now support the context management protocol -- see :ref:" "`typecontextmanager`. :meth:`~contextmanager.__enter__` returns the " "listener object, and :meth:`~contextmanager.__exit__` calls :meth:`close`." msgstr "" -#: ../../library/multiprocessing.rst:2480 +#: ../../library/multiprocessing.rst:2479 msgid "" "Wait till an object in *object_list* is ready. Returns the list of those " "objects in *object_list* which are ready. If *timeout* is a float then the " @@ -2697,32 +2697,32 @@ msgid "" "zero timeout." msgstr "" -#: ../../library/multiprocessing.rst:2486 +#: ../../library/multiprocessing.rst:2485 msgid "" "For both Unix and Windows, an object can appear in *object_list* if it is" msgstr "" -#: ../../library/multiprocessing.rst:2489 +#: ../../library/multiprocessing.rst:2488 msgid "a readable :class:`~multiprocessing.connection.Connection` object;" msgstr "" -#: ../../library/multiprocessing.rst:2490 +#: ../../library/multiprocessing.rst:2489 msgid "a connected and readable :class:`socket.socket` object; or" msgstr "" -#: ../../library/multiprocessing.rst:2491 +#: ../../library/multiprocessing.rst:2490 msgid "" "the :attr:`~multiprocessing.Process.sentinel` attribute of a :class:" "`~multiprocessing.Process` object." msgstr "" -#: ../../library/multiprocessing.rst:2494 +#: ../../library/multiprocessing.rst:2493 msgid "" "A connection or socket object is ready when there is data available to be " "read from it, or the other end has been closed." msgstr "" -#: ../../library/multiprocessing.rst:2497 +#: ../../library/multiprocessing.rst:2496 msgid "" "**Unix**: ``wait(object_list, timeout)`` almost equivalent ``select." "select(object_list, [], [], timeout)``. The difference is that, if :func:" @@ -2730,7 +2730,7 @@ msgid "" "an error number of ``EINTR``, whereas :func:`wait` will not." msgstr "" -#: ../../library/multiprocessing.rst:2503 +#: ../../library/multiprocessing.rst:2502 msgid "" "**Windows**: An item in *object_list* must either be an integer handle which " "is waitable (according to the definition used by the documentation of the " @@ -2739,46 +2739,46 @@ msgid "" "that pipe handles and socket handles are **not** waitable handles.)" msgstr "" -#: ../../library/multiprocessing.rst:2513 +#: ../../library/multiprocessing.rst:2512 msgid "**Examples**" msgstr "" -#: ../../library/multiprocessing.rst:2515 +#: ../../library/multiprocessing.rst:2514 msgid "" "The following server code creates a listener which uses ``'secret " "password'`` as an authentication key. It then waits for a connection and " "sends some data to the client::" msgstr "" -#: ../../library/multiprocessing.rst:2534 +#: ../../library/multiprocessing.rst:2533 msgid "" "The following code connects to the server and receives some data from the " "server::" msgstr "" -#: ../../library/multiprocessing.rst:2551 +#: ../../library/multiprocessing.rst:2550 msgid "" "The following code uses :func:`~multiprocessing.connection.wait` to wait for " "messages from multiple processes at once::" msgstr "" -#: ../../library/multiprocessing.rst:2590 +#: ../../library/multiprocessing.rst:2589 msgid "Address Formats" msgstr "" -#: ../../library/multiprocessing.rst:2592 +#: ../../library/multiprocessing.rst:2591 msgid "" "An ``'AF_INET'`` address is a tuple of the form ``(hostname, port)`` where " "*hostname* is a string and *port* is an integer." msgstr "" -#: ../../library/multiprocessing.rst:2595 +#: ../../library/multiprocessing.rst:2594 msgid "" "An ``'AF_UNIX'`` address is a string representing a filename on the " "filesystem." msgstr "" -#: ../../library/multiprocessing.rst:2598 +#: ../../library/multiprocessing.rst:2597 msgid "" "An ``'AF_PIPE'`` address is a string of the form :samp:`r'\\\\\\\\.\\\\pipe\\" "\\{PipeName}'`. To use :func:`Client` to connect to a named pipe on a " @@ -2786,17 +2786,17 @@ msgid "" "samp:`r'\\\\\\\\{ServerName}\\\\pipe\\\\{PipeName}'` instead." msgstr "" -#: ../../library/multiprocessing.rst:2603 +#: ../../library/multiprocessing.rst:2602 msgid "" "Note that any string beginning with two backslashes is assumed by default to " "be an ``'AF_PIPE'`` address rather than an ``'AF_UNIX'`` address." msgstr "" -#: ../../library/multiprocessing.rst:2610 +#: ../../library/multiprocessing.rst:2609 msgid "Authentication keys" msgstr "" -#: ../../library/multiprocessing.rst:2612 +#: ../../library/multiprocessing.rst:2611 msgid "" "When one uses :meth:`Connection.recv `, the data received " "is automatically unpickled. Unfortunately unpickling data from an untrusted " @@ -2804,7 +2804,7 @@ msgid "" "use the :mod:`hmac` module to provide digest authentication." msgstr "" -#: ../../library/multiprocessing.rst:2618 +#: ../../library/multiprocessing.rst:2617 msgid "" "An authentication key is a byte string which can be thought of as a " "password: once a connection is established both ends will demand proof that " @@ -2812,7 +2812,7 @@ msgid "" "using the same key does **not** involve sending the key over the connection.)" msgstr "" -#: ../../library/multiprocessing.rst:2624 +#: ../../library/multiprocessing.rst:2623 msgid "" "If authentication is requested but no authentication key is specified then " "the return value of ``current_process().authkey`` is used (see :class:" @@ -2823,17 +2823,17 @@ msgid "" "setting up connections between themselves." msgstr "" -#: ../../library/multiprocessing.rst:2632 +#: ../../library/multiprocessing.rst:2631 msgid "" "Suitable authentication keys can also be generated by using :func:`os." "urandom`." msgstr "" -#: ../../library/multiprocessing.rst:2636 +#: ../../library/multiprocessing.rst:2635 msgid "Logging" msgstr "" -#: ../../library/multiprocessing.rst:2638 +#: ../../library/multiprocessing.rst:2637 msgid "" "Some support for logging is available. Note, however, that the :mod:" "`logging` package does not use process shared locks so it is possible " @@ -2841,27 +2841,27 @@ msgid "" "mixed up." msgstr "" -#: ../../library/multiprocessing.rst:2645 +#: ../../library/multiprocessing.rst:2644 msgid "" "Returns the logger used by :mod:`multiprocessing`. If necessary, a new one " "will be created." msgstr "" -#: ../../library/multiprocessing.rst:2648 +#: ../../library/multiprocessing.rst:2647 msgid "" "When first created the logger has level :data:`logging.NOTSET` and no " "default handler. Messages sent to this logger will not by default propagate " "to the root logger." msgstr "" -#: ../../library/multiprocessing.rst:2652 +#: ../../library/multiprocessing.rst:2651 msgid "" "Note that on Windows child processes will only inherit the level of the " "parent process's logger -- any other customization of the logger will not be " "inherited." msgstr "" -#: ../../library/multiprocessing.rst:2659 +#: ../../library/multiprocessing.rst:2658 msgid "" "This function performs a call to :func:`get_logger` but in addition to " "returning the logger created by get_logger, it adds a handler which sends " @@ -2870,25 +2870,25 @@ msgid "" "``level`` argument." msgstr "" -#: ../../library/multiprocessing.rst:2665 +#: ../../library/multiprocessing.rst:2664 msgid "Below is an example session with logging turned on::" msgstr "" -#: ../../library/multiprocessing.rst:2680 +#: ../../library/multiprocessing.rst:2679 msgid "For a full table of logging levels, see the :mod:`logging` module." msgstr "" -#: ../../library/multiprocessing.rst:2684 +#: ../../library/multiprocessing.rst:2683 msgid "The :mod:`multiprocessing.dummy` module" msgstr "" -#: ../../library/multiprocessing.rst:2689 +#: ../../library/multiprocessing.rst:2688 msgid "" ":mod:`multiprocessing.dummy` replicates the API of :mod:`multiprocessing` " "but is no more than a wrapper around the :mod:`threading` module." msgstr "" -#: ../../library/multiprocessing.rst:2694 +#: ../../library/multiprocessing.rst:2693 msgid "" "In particular, the ``Pool`` function provided by :mod:`multiprocessing." "dummy` returns an instance of :class:`ThreadPool`, which is a subclass of :" @@ -2896,7 +2896,7 @@ msgid "" "worker threads rather than worker processes." msgstr "" -#: ../../library/multiprocessing.rst:2702 +#: ../../library/multiprocessing.rst:2701 msgid "" "A thread pool object which controls a pool of worker threads to which jobs " "can be submitted. :class:`ThreadPool` instances are fully interface " @@ -2906,18 +2906,18 @@ msgid "" "pool.Pool.terminate` manually." msgstr "" -#: ../../library/multiprocessing.rst:2709 +#: ../../library/multiprocessing.rst:2708 msgid "" "*processes* is the number of worker threads to use. If *processes* is " "``None`` then the number returned by :func:`os.cpu_count` is used." msgstr "" -#: ../../library/multiprocessing.rst:2715 +#: ../../library/multiprocessing.rst:2714 msgid "" "Unlike :class:`Pool`, *maxtasksperchild* and *context* cannot be provided." msgstr "" -#: ../../library/multiprocessing.rst:2719 +#: ../../library/multiprocessing.rst:2718 msgid "" "A :class:`ThreadPool` shares the same interface as :class:`Pool`, which is " "designed around a pool of processes and predates the introduction of the :" @@ -2927,7 +2927,7 @@ msgid "" "is not understood by any other libraries." msgstr "" -#: ../../library/multiprocessing.rst:2726 +#: ../../library/multiprocessing.rst:2725 msgid "" "Users should generally prefer to use :class:`concurrent.futures." "ThreadPoolExecutor`, which has a simpler interface that was designed around " @@ -2936,69 +2936,69 @@ msgid "" "`asyncio`." msgstr "" -#: ../../library/multiprocessing.rst:2736 +#: ../../library/multiprocessing.rst:2735 msgid "Programming guidelines" msgstr "" -#: ../../library/multiprocessing.rst:2738 +#: ../../library/multiprocessing.rst:2737 msgid "" "There are certain guidelines and idioms which should be adhered to when " "using :mod:`multiprocessing`." msgstr "" -#: ../../library/multiprocessing.rst:2743 +#: ../../library/multiprocessing.rst:2742 msgid "All start methods" msgstr "" -#: ../../library/multiprocessing.rst:2745 +#: ../../library/multiprocessing.rst:2744 msgid "The following applies to all start methods." msgstr "" -#: ../../library/multiprocessing.rst:2747 +#: ../../library/multiprocessing.rst:2746 msgid "Avoid shared state" msgstr "" -#: ../../library/multiprocessing.rst:2749 +#: ../../library/multiprocessing.rst:2748 msgid "" "As far as possible one should try to avoid shifting large amounts of data " "between processes." msgstr "" -#: ../../library/multiprocessing.rst:2752 +#: ../../library/multiprocessing.rst:2751 msgid "" "It is probably best to stick to using queues or pipes for communication " "between processes rather than using the lower level synchronization " "primitives." msgstr "" -#: ../../library/multiprocessing.rst:2756 +#: ../../library/multiprocessing.rst:2755 msgid "Picklability" msgstr "" -#: ../../library/multiprocessing.rst:2758 +#: ../../library/multiprocessing.rst:2757 msgid "Ensure that the arguments to the methods of proxies are picklable." msgstr "" -#: ../../library/multiprocessing.rst:2760 +#: ../../library/multiprocessing.rst:2759 msgid "Thread safety of proxies" msgstr "" -#: ../../library/multiprocessing.rst:2762 +#: ../../library/multiprocessing.rst:2761 msgid "" "Do not use a proxy object from more than one thread unless you protect it " "with a lock." msgstr "" -#: ../../library/multiprocessing.rst:2765 +#: ../../library/multiprocessing.rst:2764 msgid "" "(There is never a problem with different processes using the *same* proxy.)" msgstr "" -#: ../../library/multiprocessing.rst:2767 +#: ../../library/multiprocessing.rst:2766 msgid "Joining zombie processes" msgstr "" -#: ../../library/multiprocessing.rst:2769 +#: ../../library/multiprocessing.rst:2768 msgid "" "On Unix when a process finishes but has not been joined it becomes a zombie. " "There should never be very many because each time a new process starts (or :" @@ -3009,11 +3009,11 @@ msgid "" "all the processes that you start." msgstr "" -#: ../../library/multiprocessing.rst:2777 +#: ../../library/multiprocessing.rst:2776 msgid "Better to inherit than pickle/unpickle" msgstr "" -#: ../../library/multiprocessing.rst:2779 +#: ../../library/multiprocessing.rst:2778 msgid "" "When using the *spawn* or *forkserver* start methods many types from :mod:" "`multiprocessing` need to be picklable so that child processes can use " @@ -3023,11 +3023,11 @@ msgid "" "inherit it from an ancestor process." msgstr "" -#: ../../library/multiprocessing.rst:2787 +#: ../../library/multiprocessing.rst:2786 msgid "Avoid terminating processes" msgstr "" -#: ../../library/multiprocessing.rst:2789 +#: ../../library/multiprocessing.rst:2788 msgid "" "Using the :meth:`Process.terminate ` " "method to stop a process is liable to cause any shared resources (such as " @@ -3035,18 +3035,18 @@ msgid "" "become broken or unavailable to other processes." msgstr "" -#: ../../library/multiprocessing.rst:2795 +#: ../../library/multiprocessing.rst:2794 msgid "" "Therefore it is probably best to only consider using :meth:`Process." "terminate ` on processes which never use " "any shared resources." msgstr "" -#: ../../library/multiprocessing.rst:2799 +#: ../../library/multiprocessing.rst:2798 msgid "Joining processes that use queues" msgstr "" -#: ../../library/multiprocessing.rst:2801 +#: ../../library/multiprocessing.rst:2800 msgid "" "Bear in mind that a process that has put items in a queue will wait before " "terminating until all the buffered items are fed by the \"feeder\" thread to " @@ -3055,7 +3055,7 @@ msgid "" "queue to avoid this behaviour.)" msgstr "" -#: ../../library/multiprocessing.rst:2807 +#: ../../library/multiprocessing.rst:2806 msgid "" "This means that whenever you use a queue you need to make sure that all " "items which have been put on the queue will eventually be removed before the " @@ -3064,21 +3064,21 @@ msgid "" "processes will be joined automatically." msgstr "" -#: ../../library/multiprocessing.rst:2813 +#: ../../library/multiprocessing.rst:2812 msgid "An example which will deadlock is the following::" msgstr "" -#: ../../library/multiprocessing.rst:2827 +#: ../../library/multiprocessing.rst:2826 msgid "" "A fix here would be to swap the last two lines (or simply remove the ``p." "join()`` line)." msgstr "" -#: ../../library/multiprocessing.rst:2830 +#: ../../library/multiprocessing.rst:2829 msgid "Explicitly pass resources to child processes" msgstr "" -#: ../../library/multiprocessing.rst:2832 +#: ../../library/multiprocessing.rst:2831 msgid "" "On Unix using the *fork* start method, a child process can make use of a " "shared resource created in a parent process using a global resource. " @@ -3086,7 +3086,7 @@ msgid "" "for the child process." msgstr "" -#: ../../library/multiprocessing.rst:2837 +#: ../../library/multiprocessing.rst:2836 msgid "" "Apart from making the code (potentially) compatible with Windows and the " "other start methods this also ensures that as long as the child process is " @@ -3095,29 +3095,29 @@ msgid "" "collected in the parent process." msgstr "" -#: ../../library/multiprocessing.rst:2844 +#: ../../library/multiprocessing.rst:2843 msgid "So for instance ::" msgstr "" -#: ../../library/multiprocessing.rst:2856 +#: ../../library/multiprocessing.rst:2855 msgid "should be rewritten as ::" msgstr "" -#: ../../library/multiprocessing.rst:2868 +#: ../../library/multiprocessing.rst:2867 msgid "Beware of replacing :data:`sys.stdin` with a \"file like object\"" msgstr "" -#: ../../library/multiprocessing.rst:2870 +#: ../../library/multiprocessing.rst:2869 msgid ":mod:`multiprocessing` originally unconditionally called::" msgstr "" -#: ../../library/multiprocessing.rst:2874 +#: ../../library/multiprocessing.rst:2873 msgid "" "in the :meth:`multiprocessing.Process._bootstrap` method --- this resulted " "in issues with processes-in-processes. This has been changed to::" msgstr "" -#: ../../library/multiprocessing.rst:2880 +#: ../../library/multiprocessing.rst:2879 msgid "" "Which solves the fundamental issue of processes colliding with each other " "resulting in a bad file descriptor error, but introduces a potential danger " @@ -3127,33 +3127,33 @@ msgid "" "data being flushed to the object multiple times, resulting in corruption." msgstr "" -#: ../../library/multiprocessing.rst:2887 +#: ../../library/multiprocessing.rst:2886 msgid "" "If you write a file-like object and implement your own caching, you can make " "it fork-safe by storing the pid whenever you append to the cache, and " "discarding the cache when the pid changes. For example::" msgstr "" -#: ../../library/multiprocessing.rst:2899 +#: ../../library/multiprocessing.rst:2898 msgid "" "For more information, see :issue:`5155`, :issue:`5313` and :issue:`5331`" msgstr "" -#: ../../library/multiprocessing.rst:2902 +#: ../../library/multiprocessing.rst:2901 msgid "The *spawn* and *forkserver* start methods" msgstr "" -#: ../../library/multiprocessing.rst:2904 +#: ../../library/multiprocessing.rst:2903 msgid "" "There are a few extra restriction which don't apply to the *fork* start " "method." msgstr "" -#: ../../library/multiprocessing.rst:2907 +#: ../../library/multiprocessing.rst:2906 msgid "More picklability" msgstr "" -#: ../../library/multiprocessing.rst:2909 +#: ../../library/multiprocessing.rst:2908 msgid "" "Ensure that all arguments to :meth:`Process.__init__` are picklable. Also, " "if you subclass :class:`~multiprocessing.Process` then make sure that " @@ -3161,11 +3161,11 @@ msgid "" "Process.start>` method is called." msgstr "" -#: ../../library/multiprocessing.rst:2914 +#: ../../library/multiprocessing.rst:2913 msgid "Global variables" msgstr "" -#: ../../library/multiprocessing.rst:2916 +#: ../../library/multiprocessing.rst:2915 msgid "" "Bear in mind that if code run in a child process tries to access a global " "variable, then the value it sees (if any) may not be the same as the value " @@ -3173,66 +3173,66 @@ msgid "" "Process.start>` was called." msgstr "" -#: ../../library/multiprocessing.rst:2921 +#: ../../library/multiprocessing.rst:2920 msgid "" "However, global variables which are just module level constants cause no " "problems." msgstr "" -#: ../../library/multiprocessing.rst:2924 +#: ../../library/multiprocessing.rst:2923 msgid "Safe importing of main module" msgstr "" -#: ../../library/multiprocessing.rst:2926 +#: ../../library/multiprocessing.rst:2925 msgid "" "Make sure that the main module can be safely imported by a new Python " "interpreter without causing unintended side effects (such a starting a new " "process)." msgstr "" -#: ../../library/multiprocessing.rst:2930 +#: ../../library/multiprocessing.rst:2929 msgid "" "For example, using the *spawn* or *forkserver* start method running the " "following module would fail with a :exc:`RuntimeError`::" msgstr "" -#: ../../library/multiprocessing.rst:2942 +#: ../../library/multiprocessing.rst:2941 msgid "" "Instead one should protect the \"entry point\" of the program by using ``if " "__name__ == '__main__':`` as follows::" msgstr "" -#: ../../library/multiprocessing.rst:2956 +#: ../../library/multiprocessing.rst:2955 msgid "" "(The ``freeze_support()`` line can be omitted if the program will be run " "normally instead of frozen.)" msgstr "" -#: ../../library/multiprocessing.rst:2959 +#: ../../library/multiprocessing.rst:2958 msgid "" "This allows the newly spawned Python interpreter to safely import the module " "and then run the module's ``foo()`` function." msgstr "" -#: ../../library/multiprocessing.rst:2962 +#: ../../library/multiprocessing.rst:2961 msgid "" "Similar restrictions apply if a pool or manager is created in the main " "module." msgstr "" -#: ../../library/multiprocessing.rst:2969 +#: ../../library/multiprocessing.rst:2968 msgid "Examples" msgstr "範例" -#: ../../library/multiprocessing.rst:2971 +#: ../../library/multiprocessing.rst:2970 msgid "Demonstration of how to create and use customized managers and proxies:" msgstr "" -#: ../../library/multiprocessing.rst:2977 +#: ../../library/multiprocessing.rst:2976 msgid "Using :class:`~multiprocessing.pool.Pool`:" msgstr "" -#: ../../library/multiprocessing.rst:2983 +#: ../../library/multiprocessing.rst:2982 msgid "" "An example showing how to use queues to feed tasks to a collection of worker " "processes and collect the results:" diff --git a/library/unittest.po b/library/unittest.po index 2d34d0e540..a41f91495e 100644 --- a/library/unittest.po +++ b/library/unittest.po @@ -10,7 +10,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-10-04 00:24+0000\n" "PO-Revision-Date: 2022-05-22 02:20+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -2212,7 +2212,7 @@ msgstr "" #: ../../library/unittest.rst:1739 msgid "" "A list of the non-fatal errors encountered while loading tests. Not reset by " -"the loader at any point. Fatal errors are signalled by the relevant a method " +"the loader at any point. Fatal errors are signalled by the relevant method " "raising an exception to the caller. Non-fatal errors are also indicated by a " "synthetic test that will raise the original error when run." msgstr "" From 4527341353b3e7139195a828a04421388e86750b Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 5 Oct 2022 00:26:00 +0000 Subject: [PATCH 05/14] sync with cpython 9c755d7d --- c-api/exceptions.po | 14 +- c-api/typehints.po | 4 +- c-api/unicode.po | 6 +- faq/programming.po | 5 +- library/_thread.po | 12 +- library/asyncio-eventloop.po | 44 +-- library/multiprocessing.po | 11 +- using/windows.po | 536 +++++++++++++++++------------------ whatsnew/3.3.po | 4 +- 9 files changed, 319 insertions(+), 317 deletions(-) diff --git a/c-api/exceptions.po b/c-api/exceptions.po index 933bc92efc..82781475e8 100644 --- a/c-api/exceptions.po +++ b/c-api/exceptions.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-10-05 00:24+0000\n" "PO-Revision-Date: 2018-05-23 14:05+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -223,12 +223,12 @@ msgstr "" #: ../../c-api/exceptions.rst:191 msgid "" "This is a convenience function to raise :exc:`WindowsError`. If called with " -"*ierr* of :c:data:`0`, the error code returned by a call to :c:func:" -"`GetLastError` is used instead. It calls the Win32 function :c:func:" -"`FormatMessage` to retrieve the Windows description of error code given by " -"*ierr* or :c:func:`GetLastError`, then it constructs a tuple object whose " -"first item is the *ierr* value and whose second item is the corresponding " -"error message (gotten from :c:func:`FormatMessage`), and then calls " +"*ierr* of ``0``, the error code returned by a call to :c:func:`GetLastError` " +"is used instead. It calls the Win32 function :c:func:`FormatMessage` to " +"retrieve the Windows description of error code given by *ierr* or :c:func:" +"`GetLastError`, then it constructs a tuple object whose first item is the " +"*ierr* value and whose second item is the corresponding error message " +"(gotten from :c:func:`FormatMessage`), and then calls " "``PyErr_SetObject(PyExc_WindowsError, object)``. This function always " "returns ``NULL``." msgstr "" diff --git a/c-api/typehints.po b/c-api/typehints.po index bda0794257..2a4333a58e 100644 --- a/c-api/typehints.po +++ b/c-api/typehints.po @@ -8,7 +8,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-10-05 00:24+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-" @@ -35,7 +35,7 @@ msgid "" "calling the Python class :class:`types.GenericAlias`. The *origin* and " "*args* arguments set the ``GenericAlias``\\ 's ``__origin__`` and " "``__args__`` attributes respectively. *origin* should be a :c:type:" -"`PyTypeObject*`, and *args* can be a :c:type:`PyTupleObject*` or any " +"`PyTypeObject*`, and *args* can be a :c:expr:`PyTupleObject*` or any " "``PyObject*``. If *args* passed is not a tuple, a 1-tuple is automatically " "constructed and ``__args__`` is set to ``(args,)``. Minimal checking is done " "for the arguments, so the function will succeed even if *origin* is not a " diff --git a/c-api/unicode.po b/c-api/unicode.po index 85a060358e..a9f664fccf 100644 --- a/c-api/unicode.po +++ b/c-api/unicode.po @@ -9,7 +9,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-10-05 00:24+0000\n" "PO-Revision-Date: 2018-05-23 14:08+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1044,7 +1044,7 @@ msgid "" "ParseTuple converter: encode :class:`str` objects -- obtained directly or " "through the :class:`os.PathLike` interface -- to :class:`bytes` using :c:" "func:`PyUnicode_EncodeFSDefault`; :class:`bytes` objects are output as-is. " -"*result* must be a :c:type:`PyBytesObject*` which must be released when it " +"*result* must be a :c:expr:`PyBytesObject*` which must be released when it " "is no longer used." msgstr "" @@ -1064,7 +1064,7 @@ msgid "" "ParseTuple converter: decode :class:`bytes` objects -- obtained either " "directly or indirectly through the :class:`os.PathLike` interface -- to :" "class:`str` using :c:func:`PyUnicode_DecodeFSDefaultAndSize`; :class:`str` " -"objects are output as-is. *result* must be a :c:type:`PyUnicodeObject*` " +"objects are output as-is. *result* must be a :c:expr:`PyUnicodeObject*` " "which must be released when it is no longer used." msgstr "" diff --git a/faq/programming.po b/faq/programming.po index 745185a7b2..c83553c81e 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-09-28 00:27+0000\n" +"POT-Creation-Date: 2022-10-05 00:24+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-" @@ -875,7 +875,8 @@ msgstr "" #: ../../faq/programming.rst:737 msgid "" "Yes. Usually this is done by nesting :keyword:`lambda` within :keyword:`!" -"lambda`. See the following three examples, due to Ulf Bartelt::" +"lambda`. See the following three examples, slightly adapted from Ulf " +"Bartelt::" msgstr "" #: ../../faq/programming.rst:764 diff --git a/library/_thread.po b/library/_thread.po index 7a6ae4a351..9b246453ec 100644 --- a/library/_thread.po +++ b/library/_thread.po @@ -7,7 +7,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-10-05 00:24+0000\n" "PO-Revision-Date: 2015-12-09 17:51+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -191,10 +191,10 @@ msgstr "" #: ../../library/_thread.rst:164 msgid "" -"If the integer *waitflag* argument is present, the action depends on its " -"value: if it is zero, the lock is only acquired if it can be acquired " -"immediately without waiting, while if it is nonzero, the lock is acquired " -"unconditionally as above." +"If the *blocking* argument is present, the action depends on its value: if " +"it is False, the lock is only acquired if it can be acquired immediately " +"without waiting, while if it is True, the lock is acquired unconditionally " +"as above." msgstr "" #: ../../library/_thread.rst:169 @@ -202,7 +202,7 @@ msgid "" "If the floating-point *timeout* argument is present and positive, it " "specifies the maximum wait time in seconds before returning. A negative " "*timeout* argument specifies an unbounded wait. You cannot specify a " -"*timeout* if *waitflag* is zero." +"*timeout* if *blocking* is False." msgstr "" #: ../../library/_thread.rst:174 diff --git a/library/asyncio-eventloop.po b/library/asyncio-eventloop.po index 5447021722..36ffb96bc1 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-09-29 00:25+0000\n" +"POT-Creation-Date: 2022-10-05 00:24+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-" @@ -1916,39 +1916,39 @@ msgid "" "used::" msgstr "" -#: ../../library/asyncio-eventloop.rst:1531 +#: ../../library/asyncio-eventloop.rst:1534 msgid ":ref:`Availability `: Unix, Windows." msgstr ":ref:`適用 `:Unix、Windows。" -#: ../../library/asyncio-eventloop.rst:1536 +#: ../../library/asyncio-eventloop.rst:1539 msgid "An event loop for Windows that uses \"I/O Completion Ports\" (IOCP)." msgstr "" -#: ../../library/asyncio-eventloop.rst:1539 +#: ../../library/asyncio-eventloop.rst:1542 msgid ":ref:`Availability `: Windows." msgstr ":ref:`適用 `:Windows。" -#: ../../library/asyncio-eventloop.rst:1542 +#: ../../library/asyncio-eventloop.rst:1545 msgid "" "`MSDN documentation on I/O Completion Ports `_." msgstr "" -#: ../../library/asyncio-eventloop.rst:1548 +#: ../../library/asyncio-eventloop.rst:1551 msgid "Abstract base class for asyncio-compliant event loops." msgstr "" -#: ../../library/asyncio-eventloop.rst:1550 +#: ../../library/asyncio-eventloop.rst:1553 msgid "" "The :ref:`asyncio-event-loop-methods` section lists all methods that an " "alternative implementation of ``AbstractEventLoop`` should have defined." msgstr "" -#: ../../library/asyncio-eventloop.rst:1556 +#: ../../library/asyncio-eventloop.rst:1559 msgid "Examples" msgstr "範例" -#: ../../library/asyncio-eventloop.rst:1558 +#: ../../library/asyncio-eventloop.rst:1561 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." @@ -1956,70 +1956,70 @@ msgid "" "consider using the high-level functions like :func:`asyncio.run`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1568 +#: ../../library/asyncio-eventloop.rst:1571 msgid "Hello World with call_soon()" msgstr "" -#: ../../library/asyncio-eventloop.rst:1570 +#: ../../library/asyncio-eventloop.rst:1573 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:1594 +#: ../../library/asyncio-eventloop.rst:1597 msgid "" "A similar :ref:`Hello World ` example created with a coroutine " "and the :func:`run` function." msgstr "" -#: ../../library/asyncio-eventloop.rst:1601 +#: ../../library/asyncio-eventloop.rst:1604 msgid "Display the current date with call_later()" msgstr "" -#: ../../library/asyncio-eventloop.rst:1603 +#: ../../library/asyncio-eventloop.rst:1606 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:1631 +#: ../../library/asyncio-eventloop.rst:1634 msgid "" "A similar :ref:`current date ` example created with a " "coroutine and the :func:`run` function." msgstr "" -#: ../../library/asyncio-eventloop.rst:1638 +#: ../../library/asyncio-eventloop.rst:1641 msgid "Watch a file descriptor for read events" msgstr "" -#: ../../library/asyncio-eventloop.rst:1640 +#: ../../library/asyncio-eventloop.rst:1643 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:1678 +#: ../../library/asyncio-eventloop.rst:1681 msgid "" "A similar :ref:`example ` using " "transports, protocols, and the :meth:`loop.create_connection` method." msgstr "" -#: ../../library/asyncio-eventloop.rst:1682 +#: ../../library/asyncio-eventloop.rst:1685 msgid "" "Another similar :ref:`example ` " "using the high-level :func:`asyncio.open_connection` function and streams." msgstr "" -#: ../../library/asyncio-eventloop.rst:1690 +#: ../../library/asyncio-eventloop.rst:1693 msgid "Set signal handlers for SIGINT and SIGTERM" msgstr "" -#: ../../library/asyncio-eventloop.rst:1692 +#: ../../library/asyncio-eventloop.rst:1695 msgid "(This ``signals`` example only works on Unix.)" msgstr "" -#: ../../library/asyncio-eventloop.rst:1694 +#: ../../library/asyncio-eventloop.rst:1697 msgid "" "Register handlers for signals :py:data:`SIGINT` and :py:data:`SIGTERM` using " "the :meth:`loop.add_signal_handler` method::" diff --git a/library/multiprocessing.po b/library/multiprocessing.po index a056fe99ec..629a588d3e 100644 --- a/library/multiprocessing.po +++ b/library/multiprocessing.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-04 00:24+0000\n" +"POT-Creation-Date: 2022-10-05 00:24+0000\n" "PO-Revision-Date: 2018-05-23 16:06+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -2780,10 +2780,11 @@ msgstr "" #: ../../library/multiprocessing.rst:2597 msgid "" -"An ``'AF_PIPE'`` address is a string of the form :samp:`r'\\\\\\\\.\\\\pipe\\" -"\\{PipeName}'`. To use :func:`Client` to connect to a named pipe on a " -"remote computer called *ServerName* one should use an address of the form :" -"samp:`r'\\\\\\\\{ServerName}\\\\pipe\\\\{PipeName}'` instead." +"An ``'AF_PIPE'`` address is a string of the form :samp:`r'\\\\\\\\\\\\.\\" +"\\pipe\\\\\\\\{PipeName}'`. To use :func:`Client` to connect to a named " +"pipe on a remote computer called *ServerName* one should use an address of " +"the form :samp:`r'\\\\\\\\\\\\\\\\{ServerName}\\\\pipe\\\\\\\\{PipeName}'` " +"instead." msgstr "" #: ../../library/multiprocessing.rst:2602 diff --git a/using/windows.po b/using/windows.po index 2a3a2247a1..418b8dd4a1 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-09-28 00:27+0000\n" +"POT-Creation-Date: 2022-10-05 00:24+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-" @@ -265,10 +265,10 @@ msgstr "InstallAllUsers" msgid "Perform a system-wide installation." msgstr "" -#: ../../using/windows.rst:142 ../../using/windows.rst:165 -#: ../../using/windows.rst:168 ../../using/windows.rst:177 -#: ../../using/windows.rst:199 ../../using/windows.rst:207 -#: ../../using/windows.rst:210 +#: ../../using/windows.rst:142 ../../using/windows.rst:168 +#: ../../using/windows.rst:171 ../../using/windows.rst:180 +#: ../../using/windows.rst:202 ../../using/windows.rst:210 +#: ../../using/windows.rst:213 msgid "0" msgstr "0" @@ -308,216 +308,216 @@ msgstr "預設安裝目錄給 只有給我 安裝方式" #: ../../using/windows.rst:152 msgid "" -":file:`%LocalAppData%\\\\\\ Programs\\\\PythonXY` or :file:`%LocalAppData%\\" -"\\\\ Programs\\\\PythonXY-32` or :file:`%LocalAppData%\\\\\\ Programs\\" -"\\PythonXY-64`" +":file:`%LocalAppData%\\\\\\ Programs\\\\Python\\\\\\ PythonXY` or :file:`" +"%LocalAppData%\\\\\\ Programs\\\\Python\\\\\\ PythonXY-32` or :file:`" +"%LocalAppData%\\\\\\ Programs\\\\Python\\\\\\ PythonXY-64`" msgstr "" -#: ../../using/windows.rst:159 +#: ../../using/windows.rst:162 msgid "DefaultCustomTargetDir" msgstr "DefaultCustomTargetDir" -#: ../../using/windows.rst:159 +#: ../../using/windows.rst:162 msgid "The default custom install directory displayed in the UI" msgstr "" -#: ../../using/windows.rst:159 ../../using/windows.rst:212 +#: ../../using/windows.rst:162 ../../using/windows.rst:215 msgid "(empty)" msgstr "" -#: ../../using/windows.rst:162 +#: ../../using/windows.rst:165 msgid "AssociateFiles" msgstr "AssociateFiles" -#: ../../using/windows.rst:162 +#: ../../using/windows.rst:165 msgid "Create file associations if the launcher is also installed." msgstr "當執行程序也被安裝時創造檔案關聯" -#: ../../using/windows.rst:162 ../../using/windows.rst:172 -#: ../../using/windows.rst:175 ../../using/windows.rst:179 -#: ../../using/windows.rst:183 ../../using/windows.rst:187 -#: ../../using/windows.rst:189 ../../using/windows.rst:193 -#: ../../using/windows.rst:197 ../../using/windows.rst:201 -#: ../../using/windows.rst:203 ../../using/windows.rst:205 +#: ../../using/windows.rst:165 ../../using/windows.rst:175 +#: ../../using/windows.rst:178 ../../using/windows.rst:182 +#: ../../using/windows.rst:186 ../../using/windows.rst:190 +#: ../../using/windows.rst:192 ../../using/windows.rst:196 +#: ../../using/windows.rst:200 ../../using/windows.rst:204 +#: ../../using/windows.rst:206 ../../using/windows.rst:208 msgid "1" msgstr "1" -#: ../../using/windows.rst:165 +#: ../../using/windows.rst:168 msgid "CompileAll" msgstr "CompileAll" -#: ../../using/windows.rst:165 +#: ../../using/windows.rst:168 msgid "Compile all ``.py`` files to ``.pyc``." msgstr "編譯所有 ``.py`` 檔案為 ``.pyc``\\ 。" -#: ../../using/windows.rst:168 +#: ../../using/windows.rst:171 msgid "PrependPath" msgstr "PrependPath" -#: ../../using/windows.rst:168 +#: ../../using/windows.rst:171 msgid "" "Add install and Scripts directories to :envvar:`PATH` and ``.PY`` to :envvar:" "`PATHEXT`" msgstr "" -#: ../../using/windows.rst:172 +#: ../../using/windows.rst:175 msgid "Shortcuts" msgstr "Shortcuts" -#: ../../using/windows.rst:172 +#: ../../using/windows.rst:175 msgid "" "Create shortcuts for the interpreter, documentation and IDLE if installed." msgstr "" -#: ../../using/windows.rst:175 +#: ../../using/windows.rst:178 msgid "Include_doc" msgstr "" -#: ../../using/windows.rst:175 +#: ../../using/windows.rst:178 msgid "Install Python manual" msgstr "安裝Python文件" -#: ../../using/windows.rst:177 +#: ../../using/windows.rst:180 msgid "Include_debug" msgstr "Include_debug" -#: ../../using/windows.rst:177 +#: ../../using/windows.rst:180 msgid "Install debug binaries" msgstr "" -#: ../../using/windows.rst:179 +#: ../../using/windows.rst:182 msgid "Include_dev" msgstr "Include_dev" -#: ../../using/windows.rst:179 +#: ../../using/windows.rst:182 msgid "" "Install developer headers and libraries. Omitting this may lead to an " "unusable installation." msgstr "" -#: ../../using/windows.rst:183 +#: ../../using/windows.rst:186 msgid "Include_exe" msgstr "Include_exe" -#: ../../using/windows.rst:183 +#: ../../using/windows.rst:186 msgid "" "Install :file:`python.exe` and related files. Omitting this may lead to an " "unusable installation." msgstr "" -#: ../../using/windows.rst:187 +#: ../../using/windows.rst:190 msgid "Include_launcher" msgstr "Include_launcher" -#: ../../using/windows.rst:187 +#: ../../using/windows.rst:190 msgid "Install :ref:`launcher`." msgstr "" -#: ../../using/windows.rst:189 +#: ../../using/windows.rst:192 msgid "InstallLauncherAllUsers" msgstr "InstallLauncherAllUsers" -#: ../../using/windows.rst:189 +#: ../../using/windows.rst:192 msgid "" "Installs the launcher for all users. Also requires ``Include_launcher`` to " "be set to 1" msgstr "" -#: ../../using/windows.rst:193 +#: ../../using/windows.rst:196 msgid "Include_lib" msgstr "Include_lib" -#: ../../using/windows.rst:193 +#: ../../using/windows.rst:196 msgid "" "Install standard library and extension modules. Omitting this may lead to an " "unusable installation." msgstr "" -#: ../../using/windows.rst:197 +#: ../../using/windows.rst:200 msgid "Include_pip" msgstr "Include_pip" -#: ../../using/windows.rst:197 +#: ../../using/windows.rst:200 msgid "Install bundled pip and setuptools" msgstr "" -#: ../../using/windows.rst:199 +#: ../../using/windows.rst:202 msgid "Include_symbols" msgstr "Include_symbols" -#: ../../using/windows.rst:199 +#: ../../using/windows.rst:202 msgid "Install debugging symbols (`*`.pdb)" msgstr "" -#: ../../using/windows.rst:201 +#: ../../using/windows.rst:204 msgid "Include_tcltk" msgstr "Include_tcltk" -#: ../../using/windows.rst:201 +#: ../../using/windows.rst:204 msgid "Install Tcl/Tk support and IDLE" msgstr "" -#: ../../using/windows.rst:203 +#: ../../using/windows.rst:206 msgid "Include_test" msgstr "Include_test" -#: ../../using/windows.rst:203 +#: ../../using/windows.rst:206 msgid "Install standard library test suite" msgstr "" -#: ../../using/windows.rst:205 +#: ../../using/windows.rst:208 msgid "Include_tools" msgstr "Include_tools" -#: ../../using/windows.rst:205 +#: ../../using/windows.rst:208 msgid "Install utility scripts" msgstr "" -#: ../../using/windows.rst:207 +#: ../../using/windows.rst:210 msgid "LauncherOnly" msgstr "LauncherOnly" -#: ../../using/windows.rst:207 +#: ../../using/windows.rst:210 msgid "Only installs the launcher. This will override most other options." msgstr "" -#: ../../using/windows.rst:210 +#: ../../using/windows.rst:213 msgid "SimpleInstall" msgstr "SimpleInstall" -#: ../../using/windows.rst:210 +#: ../../using/windows.rst:213 msgid "Disable most install UI" msgstr "" -#: ../../using/windows.rst:212 +#: ../../using/windows.rst:215 msgid "SimpleInstallDescription" msgstr "SimpleInstallDescription" -#: ../../using/windows.rst:212 +#: ../../using/windows.rst:215 msgid "A custom message to display when the simplified install UI is used." msgstr "" -#: ../../using/windows.rst:216 +#: ../../using/windows.rst:219 msgid "" "For example, to silently install a default, system-wide Python installation, " "you could use the following command (from an elevated command prompt)::" msgstr "" -#: ../../using/windows.rst:221 +#: ../../using/windows.rst:224 msgid "" "To allow users to easily install a personal copy of Python without the test " "suite, you could provide a shortcut with the following command. This will " "display a simplified initial page and disallow customization::" msgstr "" -#: ../../using/windows.rst:228 +#: ../../using/windows.rst:231 msgid "" "(Note that omitting the launcher also omits file associations, and is only " "recommended for per-user installs when there is also a system-wide " "installation that included the launcher.)" msgstr "" -#: ../../using/windows.rst:232 +#: ../../using/windows.rst:235 msgid "" "The options listed above can also be provided in a file named ``unattend." "xml`` alongside the executable. This file specifies a list of options and " @@ -526,11 +526,11 @@ msgid "" "strings. This example file sets the same options as the previous example:" msgstr "" -#: ../../using/windows.rst:251 +#: ../../using/windows.rst:254 msgid "Installing Without Downloading" msgstr "當安裝時不下載" -#: ../../using/windows.rst:253 +#: ../../using/windows.rst:256 msgid "" "As some features of Python are not included in the initial installer " "download, selecting those features may require an internet connection. To " @@ -541,7 +541,7 @@ msgid "" "to be performed it is very useful to have a locally cached copy." msgstr "" -#: ../../using/windows.rst:261 +#: ../../using/windows.rst:264 msgid "" "Execute the following command from Command Prompt to download all possible " "required files. Remember to substitute ``python-3.9.0.exe`` for the actual " @@ -549,23 +549,23 @@ msgid "" "avoid collisions between files with the same name." msgstr "" -#: ../../using/windows.rst:270 +#: ../../using/windows.rst:273 msgid "" "You may also specify the ``/quiet`` option to hide the progress display." msgstr "" -#: ../../using/windows.rst:273 +#: ../../using/windows.rst:276 msgid "Modifying an install" msgstr "" -#: ../../using/windows.rst:275 +#: ../../using/windows.rst:278 msgid "" "Once Python has been installed, you can add or remove features through the " "Programs and Features tool that is part of Windows. Select the Python entry " "and choose \"Uninstall/Change\" to open the installer in maintenance mode." msgstr "" -#: ../../using/windows.rst:279 +#: ../../using/windows.rst:282 msgid "" "\"Modify\" allows you to add or remove features by modifying the checkboxes " "- unchanged checkboxes will not install or remove anything. Some options " @@ -573,42 +573,42 @@ msgid "" "these, you will need to remove and then reinstall Python completely." msgstr "" -#: ../../using/windows.rst:284 +#: ../../using/windows.rst:287 msgid "" "\"Repair\" will verify all the files that should be installed using the " "current settings and replace any that have been removed or modified." msgstr "" -#: ../../using/windows.rst:287 +#: ../../using/windows.rst:290 msgid "" "\"Uninstall\" will remove Python entirely, with the exception of the :ref:" "`launcher`, which has its own entry in Programs and Features." msgstr "" -#: ../../using/windows.rst:294 +#: ../../using/windows.rst:297 msgid "The Microsoft Store package" msgstr "" -#: ../../using/windows.rst:298 +#: ../../using/windows.rst:301 msgid "" "The Microsoft Store package is an easily installable Python interpreter that " "is intended mainly for interactive use, for example, by students." msgstr "" -#: ../../using/windows.rst:301 +#: ../../using/windows.rst:304 msgid "" "To install the package, ensure you have the latest Windows 10 updates and " "search the Microsoft Store app for \"Python |version|\". Ensure that the app " "you select is published by the Python Software Foundation, and install it." msgstr "" -#: ../../using/windows.rst:306 +#: ../../using/windows.rst:309 msgid "" "Python will always be available for free on the Microsoft Store. If you are " "asked to pay for it, you have not selected the correct package." msgstr "" -#: ../../using/windows.rst:309 +#: ../../using/windows.rst:312 msgid "" "After installation, Python may be launched by finding it in Start. " "Alternatively, it will be available from any Command Prompt or PowerShell " @@ -616,7 +616,7 @@ msgid "" "``pip`` or ``idle``. IDLE can also be found in Start." msgstr "" -#: ../../using/windows.rst:314 +#: ../../using/windows.rst:317 msgid "" "All three commands are also available with version number suffixes, for " "example, as ``python3.exe`` and ``python3.x.exe`` as well as ``python.exe`` " @@ -627,13 +627,13 @@ msgid "" "of ``python`` is selected." msgstr "" -#: ../../using/windows.rst:322 +#: ../../using/windows.rst:325 msgid "" "Virtual environments can be created with ``python -m venv`` and activated " "and used as normal." msgstr "" -#: ../../using/windows.rst:325 +#: ../../using/windows.rst:328 msgid "" "If you have installed another version of Python and added it to your " "``PATH`` variable, it will be available as ``python.exe`` rather than the " @@ -641,13 +641,13 @@ msgid "" "exe`` or ``python3.x.exe``." msgstr "" -#: ../../using/windows.rst:330 +#: ../../using/windows.rst:333 msgid "" "The ``py.exe`` launcher will detect this Python installation, but will " "prefer installations from the traditional installer." msgstr "" -#: ../../using/windows.rst:333 +#: ../../using/windows.rst:336 msgid "" "To remove Python, open Settings and use Apps and Features, or else find " "Python in Start and right-click to select Uninstall. Uninstalling will " @@ -655,15 +655,15 @@ msgid "" "but will not remove any virtual environments" msgstr "" -#: ../../using/windows.rst:339 +#: ../../using/windows.rst:342 msgid "Known issues" msgstr "" -#: ../../using/windows.rst:342 +#: ../../using/windows.rst:345 msgid "Redirection of local data, registry, and temporary paths" msgstr "" -#: ../../using/windows.rst:344 +#: ../../using/windows.rst:347 msgid "" "Because of restrictions on Microsoft Store apps, Python scripts may not have " "full write access to shared locations such as :envvar:`TEMP` and the " @@ -671,7 +671,7 @@ msgid "" "modify the shared locations, you will need to install the full installer." msgstr "" -#: ../../using/windows.rst:349 +#: ../../using/windows.rst:352 msgid "" "At runtime, Python will use a private copy of well-known Windows folders and " "the registry. For example, if the environment variable :envvar:`%APPDATA%` " @@ -681,7 +681,7 @@ msgid "" "Python.3.8_qbz5n2kfra8p0\\\\LocalCache\\\\Local\\\\`." msgstr "" -#: ../../using/windows.rst:354 +#: ../../using/windows.rst:357 msgid "" "When reading files, Windows will return the file from the private folder, or " "if that does not exist, the real Windows directory. For example reading :" @@ -690,36 +690,36 @@ msgid "" "\\\\package_name\\\\VFS\\\\SystemX86`." msgstr "" -#: ../../using/windows.rst:358 +#: ../../using/windows.rst:361 msgid "" "You can find the real path of any existing file using :func:`os.path." "realpath`:" msgstr "" -#: ../../using/windows.rst:367 +#: ../../using/windows.rst:370 msgid "When writing to the Windows Registry, the following behaviors exist:" msgstr "" -#: ../../using/windows.rst:369 +#: ../../using/windows.rst:372 msgid "" "Reading from ``HKLM\\\\Software`` is allowed and results are merged with " "the :file:`registry.dat` file in the package." msgstr "" -#: ../../using/windows.rst:370 +#: ../../using/windows.rst:373 msgid "" "Writing to ``HKLM\\\\Software`` is not allowed if the corresponding key/" "value exists, i.e. modifying existing keys." msgstr "" -#: ../../using/windows.rst:371 +#: ../../using/windows.rst:374 msgid "" "Writing to ``HKLM\\\\Software`` is allowed as long as a corresponding key/" "value does not exist in the package and the user has the correct access " "permissions." msgstr "" -#: ../../using/windows.rst:374 +#: ../../using/windows.rst:377 msgid "" "For more detail on the technical basis for these limitations, please consult " "Microsoft's documentation on packaged full-trust apps, currently available " @@ -728,11 +728,11 @@ msgid "" "behind-the-scenes>`_" msgstr "" -#: ../../using/windows.rst:383 +#: ../../using/windows.rst:386 msgid "The nuget.org packages" msgstr "" -#: ../../using/windows.rst:387 +#: ../../using/windows.rst:390 msgid "" "The nuget.org package is a reduced size Python environment intended for use " "on continuous integration and build systems that do not have a system-wide " @@ -740,14 +740,14 @@ msgid "" "works perfectly fine for packages containing build-time tools." msgstr "" -#: ../../using/windows.rst:392 +#: ../../using/windows.rst:395 msgid "" "Visit `nuget.org `_ for the most up-to-date " "information on using nuget. What follows is a summary that is sufficient for " "Python developers." msgstr "" -#: ../../using/windows.rst:396 +#: ../../using/windows.rst:399 msgid "" "The ``nuget.exe`` command line tool may be downloaded directly from " "``https://aka.ms/nugetclidl``, for example, using curl or PowerShell. With " @@ -755,7 +755,7 @@ msgid "" "installed using::" msgstr "" -#: ../../using/windows.rst:404 +#: ../../using/windows.rst:407 msgid "" "To select a particular version, add a ``-Version 3.x.y``. The output " "directory may be changed from ``.``, and the package will be installed into " @@ -765,7 +765,7 @@ msgid "" "directory that contains the Python installation:" msgstr "" -#: ../../using/windows.rst:421 +#: ../../using/windows.rst:424 msgid "" "In general, nuget packages are not upgradeable, and newer versions should be " "installed side-by-side and referenced using the full path. Alternatively, " @@ -773,7 +773,7 @@ msgid "" "will do this automatically if they do not preserve files between builds." msgstr "" -#: ../../using/windows.rst:426 +#: ../../using/windows.rst:429 msgid "" "Alongside the ``tools`` directory is a ``build\\native`` directory. This " "contains a MSBuild properties file ``python.props`` that can be used in a C+" @@ -781,7 +781,7 @@ msgid "" "automatically use the headers and import libraries in your build." msgstr "" -#: ../../using/windows.rst:431 +#: ../../using/windows.rst:434 msgid "" "The package information pages on nuget.org are `www.nuget.org/packages/" "python `_ for the 64-bit version and " @@ -789,18 +789,18 @@ msgid "" "pythonx86>`_ for the 32-bit version." msgstr "" -#: ../../using/windows.rst:440 +#: ../../using/windows.rst:443 msgid "The embeddable package" msgstr "" -#: ../../using/windows.rst:444 +#: ../../using/windows.rst:447 msgid "" "The embedded distribution is a ZIP file containing a minimal Python " "environment. It is intended for acting as part of another application, " "rather than being directly accessed by end-users." msgstr "" -#: ../../using/windows.rst:448 +#: ../../using/windows.rst:451 msgid "" "When extracted, the embedded distribution is (almost) fully isolated from " "the user's system, including environment variables, system registry " @@ -811,7 +811,7 @@ msgid "" "documentation are not included." msgstr "" -#: ../../using/windows.rst:457 +#: ../../using/windows.rst:460 msgid "" "The embedded distribution does not include the `Microsoft C Runtime `_" msgstr "`ActivePython `_" -#: ../../using/windows.rst:525 +#: ../../using/windows.rst:528 msgid "Installer with multi-platform compatibility, documentation, PyWin32" msgstr "" -#: ../../using/windows.rst:529 +#: ../../using/windows.rst:532 msgid "`Anaconda `_" msgstr "`Anaconda `_" -#: ../../using/windows.rst:528 +#: ../../using/windows.rst:531 msgid "" "Popular scientific modules (such as numpy, scipy and pandas) and the " "``conda`` package manager." msgstr "" -#: ../../using/windows.rst:535 +#: ../../using/windows.rst:538 msgid "`Enthought Deployment Manager `_" msgstr "`Enthought Deployment Manager `_" -#: ../../using/windows.rst:532 +#: ../../using/windows.rst:535 msgid "\"The Next Generation Python Environment and Package Manager\"." msgstr "" -#: ../../using/windows.rst:534 +#: ../../using/windows.rst:537 msgid "" "Previously Enthought provided Canopy, but it `reached end of life in 2016 " "`_." msgstr "" -#: ../../using/windows.rst:539 +#: ../../using/windows.rst:542 msgid "`WinPython `_" msgstr "`WinPython `_" -#: ../../using/windows.rst:538 +#: ../../using/windows.rst:541 msgid "" "Windows-specific distribution with prebuilt scientific packages and tools " "for building packages." msgstr "" -#: ../../using/windows.rst:541 +#: ../../using/windows.rst:544 msgid "" "Note that these packages may not include the latest versions of Python or " "other libraries, and are not maintained or supported by the core Python team." msgstr "" -#: ../../using/windows.rst:547 +#: ../../using/windows.rst:550 msgid "Configuring Python" msgstr "設定 Python" -#: ../../using/windows.rst:549 +#: ../../using/windows.rst:552 msgid "" "To run Python conveniently from a command prompt, you might consider " "changing some default environment variables in Windows. While the installer " @@ -976,29 +976,29 @@ msgid "" "use multiple versions of Python, consider using the :ref:`launcher`." msgstr "" -#: ../../using/windows.rst:559 +#: ../../using/windows.rst:562 msgid "Excursus: Setting environment variables" msgstr "" -#: ../../using/windows.rst:561 +#: ../../using/windows.rst:564 msgid "" "Windows allows environment variables to be configured permanently at both " "the User level and the System level, or temporarily in a command prompt." msgstr "" -#: ../../using/windows.rst:564 +#: ../../using/windows.rst:567 msgid "" "To temporarily set environment variables, open Command Prompt and use the :" "command:`set` command:" msgstr "" -#: ../../using/windows.rst:573 +#: ../../using/windows.rst:576 msgid "" "These changes will apply to any further commands executed in that console, " "and will be inherited by any applications started from the console." msgstr "" -#: ../../using/windows.rst:576 +#: ../../using/windows.rst:579 msgid "" "Including the variable name within percent signs will expand to the existing " "value, allowing you to add your new value at either the start or the end. " @@ -1007,7 +1007,7 @@ msgid "" "launched." msgstr "" -#: ../../using/windows.rst:582 +#: ../../using/windows.rst:585 msgid "" "To permanently modify the default environment variables, click Start and " "search for 'edit environment variables', or open System properties, :" @@ -1017,20 +1017,20 @@ msgid "" "your machine (i.e. Administrator rights)." msgstr "" -#: ../../using/windows.rst:591 +#: ../../using/windows.rst:594 msgid "" "Windows will concatenate User variables *after* System variables, which may " "cause unexpected results when modifying :envvar:`PATH`." msgstr "" -#: ../../using/windows.rst:594 +#: ../../using/windows.rst:597 msgid "" "The :envvar:`PYTHONPATH` variable is used by all versions of Python, so you " "should not permanently configure it unless the listed paths only include " "code that is compatible with all of your installed Python versions." msgstr "" -#: ../../using/windows.rst:602 +#: ../../using/windows.rst:605 msgid "" "https://docs.microsoft.com/en-us/windows/win32/procthread/environment-" "variables" @@ -1038,11 +1038,11 @@ msgstr "" "https://docs.microsoft.com/en-us/windows/win32/procthread/environment-" "variables" -#: ../../using/windows.rst:602 +#: ../../using/windows.rst:605 msgid "Overview of environment variables on Windows" msgstr "Windows 上的環境變數概要" -#: ../../using/windows.rst:605 +#: ../../using/windows.rst:608 msgid "" "https://docs.microsoft.com/en-us/windows-server/administration/windows-" "commands/set_1" @@ -1050,11 +1050,11 @@ msgstr "" "https://docs.microsoft.com/en-us/windows-server/administration/windows-" "commands/set_1" -#: ../../using/windows.rst:605 +#: ../../using/windows.rst:608 msgid "The ``set`` command, for temporarily modifying environment variables" msgstr "" -#: ../../using/windows.rst:607 +#: ../../using/windows.rst:610 msgid "" "https://docs.microsoft.com/en-us/windows-server/administration/windows-" "commands/setx" @@ -1062,22 +1062,22 @@ msgstr "" "https://docs.microsoft.com/en-us/windows-server/administration/windows-" "commands/setx" -#: ../../using/windows.rst:608 +#: ../../using/windows.rst:611 msgid "The ``setx`` command, for permanently modifying environment variables" msgstr "" -#: ../../using/windows.rst:614 +#: ../../using/windows.rst:617 msgid "Finding the Python executable" msgstr "" -#: ../../using/windows.rst:618 +#: ../../using/windows.rst:621 msgid "" "Besides using the automatically created start menu entry for the Python " "interpreter, you might want to start Python in the command prompt. The " "installer has an option to set that up for you." msgstr "" -#: ../../using/windows.rst:622 +#: ../../using/windows.rst:625 msgid "" "On the first page of the installer, an option labelled \"Add Python to PATH" "\" may be selected to have the installer add the install location into the :" @@ -1088,7 +1088,7 @@ msgid "" "documentation." msgstr "" -#: ../../using/windows.rst:629 +#: ../../using/windows.rst:632 msgid "" "If you don't enable this option at install time, you can always re-run the " "installer, select Modify, and enable it. Alternatively, you can manually " @@ -1099,24 +1099,24 @@ msgid "" "entries already existed)::" msgstr "" -#: ../../using/windows.rst:642 +#: ../../using/windows.rst:645 msgid "UTF-8 mode" msgstr "" -#: ../../using/windows.rst:646 +#: ../../using/windows.rst:649 msgid "" "Windows still uses legacy encodings for the system encoding (the ANSI Code " "Page). Python uses it for the default encoding of text files (e.g. :func:" "`locale.getpreferredencoding`)." msgstr "" -#: ../../using/windows.rst:650 +#: ../../using/windows.rst:653 msgid "" "This may cause issues because UTF-8 is widely used on the internet and most " "Unix systems, including WSL (Windows Subsystem for Linux)." msgstr "" -#: ../../using/windows.rst:653 +#: ../../using/windows.rst:656 msgid "" "You can use the :ref:`Python UTF-8 Mode ` to change the default " "text encoding to UTF-8. You can enable the :ref:`Python UTF-8 Mode ` is enabled, you can still use " "the system encoding (the ANSI Code Page) via the \"mbcs\" codec." msgstr "" -#: ../../using/windows.rst:662 +#: ../../using/windows.rst:665 msgid "" "Note that adding ``PYTHONUTF8=1`` to the default environment variables will " "affect all Python 3.7+ applications on your system. If you have any Python " @@ -1140,27 +1140,27 @@ msgid "" "utf8`` command line option." msgstr "" -#: ../../using/windows.rst:669 +#: ../../using/windows.rst:672 msgid "" "Even when UTF-8 mode is disabled, Python uses UTF-8 by default on Windows " "for:" msgstr "" -#: ../../using/windows.rst:672 +#: ../../using/windows.rst:675 msgid "Console I/O including standard I/O (see :pep:`528` for details)." msgstr "" -#: ../../using/windows.rst:673 +#: ../../using/windows.rst:676 msgid "" "The :term:`filesystem encoding ` " "(see :pep:`529` for details)." msgstr "" -#: ../../using/windows.rst:680 +#: ../../using/windows.rst:683 msgid "Python Launcher for Windows" msgstr "" -#: ../../using/windows.rst:684 +#: ../../using/windows.rst:687 msgid "" "The Python launcher for Windows is a utility which aids in locating and " "executing of different Python versions. It allows scripts (or the command-" @@ -1168,7 +1168,7 @@ msgid "" "locate and execute that version." msgstr "" -#: ../../using/windows.rst:689 +#: ../../using/windows.rst:692 msgid "" "Unlike the :envvar:`PATH` variable, the launcher will correctly select the " "most appropriate version of Python. It will prefer per-user installations " @@ -1176,19 +1176,19 @@ msgid "" "most recently installed version." msgstr "" -#: ../../using/windows.rst:694 +#: ../../using/windows.rst:697 msgid "The launcher was originally specified in :pep:`397`." msgstr "" -#: ../../using/windows.rst:697 +#: ../../using/windows.rst:700 msgid "Getting started" msgstr "開始" -#: ../../using/windows.rst:700 +#: ../../using/windows.rst:703 msgid "From the command-line" msgstr "" -#: ../../using/windows.rst:704 +#: ../../using/windows.rst:707 msgid "" "System-wide installations of Python 3.3 and later will put the launcher on " "your :envvar:`PATH`. The launcher is compatible with all available versions " @@ -1196,54 +1196,54 @@ msgid "" "the launcher is available, execute the following command in Command Prompt::" msgstr "" -#: ../../using/windows.rst:711 +#: ../../using/windows.rst:714 msgid "" "You should find that the latest version of Python you have installed is " "started - it can be exited as normal, and any additional command-line " "arguments specified will be sent directly to Python." msgstr "" -#: ../../using/windows.rst:715 +#: ../../using/windows.rst:718 msgid "" "If you have multiple versions of Python installed (e.g., 3.7 and |version|) " "you will have noticed that Python |version| was started - to launch Python " "3.7, try the command::" msgstr "" -#: ../../using/windows.rst:721 +#: ../../using/windows.rst:724 msgid "" "If you want the latest version of Python 2 you have installed, try the " "command::" msgstr "" -#: ../../using/windows.rst:726 +#: ../../using/windows.rst:729 msgid "You should find the latest version of Python 3.x starts." msgstr "" -#: ../../using/windows.rst:728 +#: ../../using/windows.rst:731 msgid "" "If you see the following error, you do not have the launcher installed::" msgstr "" -#: ../../using/windows.rst:733 +#: ../../using/windows.rst:736 msgid "" "Per-user installations of Python do not add the launcher to :envvar:`PATH` " "unless the option was selected on installation." msgstr "" -#: ../../using/windows.rst:736 +#: ../../using/windows.rst:739 msgid "The command::" msgstr "" -#: ../../using/windows.rst:740 +#: ../../using/windows.rst:743 msgid "displays the currently installed version(s) of Python." msgstr "" -#: ../../using/windows.rst:743 +#: ../../using/windows.rst:746 msgid "Virtual environments" msgstr "虛擬環境(Virtual environment)" -#: ../../using/windows.rst:747 +#: ../../using/windows.rst:750 msgid "" "If the launcher is run with no explicit Python version specification, and a " "virtual environment (created with the standard library :mod:`venv` module or " @@ -1253,27 +1253,27 @@ msgid "" "specify the global Python version." msgstr "" -#: ../../using/windows.rst:755 +#: ../../using/windows.rst:758 msgid "From a script" msgstr "" -#: ../../using/windows.rst:757 +#: ../../using/windows.rst:760 msgid "" "Let's create a test Python script - create a file called ``hello.py`` with " "the following contents" msgstr "" -#: ../../using/windows.rst:766 +#: ../../using/windows.rst:769 msgid "From the directory in which hello.py lives, execute the command::" msgstr "" -#: ../../using/windows.rst:770 +#: ../../using/windows.rst:773 msgid "" "You should notice the version number of your latest Python 2.x installation " "is printed. Now try changing the first line to be:" msgstr "" -#: ../../using/windows.rst:777 +#: ../../using/windows.rst:780 msgid "" "Re-executing the command should now print the latest Python 3.x information. " "As with the above command-line examples, you can specify a more explicit " @@ -1282,7 +1282,7 @@ msgid "" "information printed." msgstr "" -#: ../../using/windows.rst:783 +#: ../../using/windows.rst:786 msgid "" "Note that unlike interactive use, a bare \"python\" will use the latest " "version of Python 2.x that you have installed. This is for backward " @@ -1290,11 +1290,11 @@ msgid "" "typically refers to Python 2." msgstr "" -#: ../../using/windows.rst:789 +#: ../../using/windows.rst:792 msgid "From file associations" msgstr "從檔案關聯" -#: ../../using/windows.rst:791 +#: ../../using/windows.rst:794 msgid "" "The launcher should have been associated with Python files (i.e. ``.py``, ``." "pyw``, ``.pyc`` files) when it was installed. This means that when you " @@ -1303,17 +1303,17 @@ msgid "" "have the script specify the version which should be used." msgstr "" -#: ../../using/windows.rst:797 +#: ../../using/windows.rst:800 msgid "" "The key benefit of this is that a single launcher can support multiple " "Python versions at the same time depending on the contents of the first line." msgstr "" -#: ../../using/windows.rst:801 +#: ../../using/windows.rst:804 msgid "Shebang Lines" msgstr "" -#: ../../using/windows.rst:803 +#: ../../using/windows.rst:806 msgid "" "If the first line of a script file starts with ``#!``, it is known as a " "\"shebang\" line. Linux and other Unix like operating systems have native " @@ -1323,34 +1323,34 @@ msgid "" "demonstrate their use." msgstr "" -#: ../../using/windows.rst:810 +#: ../../using/windows.rst:813 msgid "" "To allow shebang lines in Python scripts to be portable between Unix and " "Windows, this launcher supports a number of 'virtual' commands to specify " "which interpreter to use. The supported virtual commands are:" msgstr "" -#: ../../using/windows.rst:814 +#: ../../using/windows.rst:817 msgid "``/usr/bin/env python``" msgstr "``/usr/bin/env python``" -#: ../../using/windows.rst:815 +#: ../../using/windows.rst:818 msgid "``/usr/bin/python``" msgstr "``/usr/bin/python``" -#: ../../using/windows.rst:816 +#: ../../using/windows.rst:819 msgid "``/usr/local/bin/python``" msgstr "``/usr/local/bin/python``" -#: ../../using/windows.rst:817 +#: ../../using/windows.rst:820 msgid "``python``" msgstr "``python``" -#: ../../using/windows.rst:819 +#: ../../using/windows.rst:822 msgid "For example, if the first line of your script starts with" msgstr "" -#: ../../using/windows.rst:825 +#: ../../using/windows.rst:828 msgid "" "The default Python will be located and used. As many Python scripts written " "to work on Unix will already have this line, you should find these scripts " @@ -1359,7 +1359,7 @@ msgid "" "of the shebang lines starting with ``/usr``." msgstr "" -#: ../../using/windows.rst:831 +#: ../../using/windows.rst:834 msgid "" "Any of the above virtual commands can be suffixed with an explicit version " "(either just the major version, or the major and minor version). Furthermore " @@ -1368,14 +1368,14 @@ msgid "" "python 3.7." msgstr "" -#: ../../using/windows.rst:839 +#: ../../using/windows.rst:842 msgid "" "Beginning with python launcher 3.7 it is possible to request 64-bit version " "by the \"-64\" suffix. Furthermore it is possible to specify a major and " "architecture without minor (i.e. ``/usr/bin/python3-64``)." msgstr "" -#: ../../using/windows.rst:843 +#: ../../using/windows.rst:846 msgid "" "The ``/usr/bin/env`` form of shebang line has one further special property. " "Before looking for installed Python interpreters, this form will search the " @@ -1384,29 +1384,29 @@ msgid "" "search." msgstr "" -#: ../../using/windows.rst:849 +#: ../../using/windows.rst:852 msgid "Arguments in shebang lines" msgstr "" -#: ../../using/windows.rst:851 +#: ../../using/windows.rst:854 msgid "" "The shebang lines can also specify additional options to be passed to the " "Python interpreter. For example, if you have a shebang line:" msgstr "" -#: ../../using/windows.rst:858 +#: ../../using/windows.rst:861 msgid "Then Python will be started with the ``-v`` option" msgstr "" -#: ../../using/windows.rst:861 +#: ../../using/windows.rst:864 msgid "Customization" msgstr "" -#: ../../using/windows.rst:864 +#: ../../using/windows.rst:867 msgid "Customization via INI files" msgstr "" -#: ../../using/windows.rst:866 +#: ../../using/windows.rst:869 msgid "" "Two .ini files will be searched by the launcher - ``py.ini`` in the current " "user's \"application data\" directory (i.e. the directory returned by " @@ -1416,7 +1416,7 @@ msgid "" "launcher (i.e. py.exe) and for the 'windows' version (i.e. pyw.exe)." msgstr "" -#: ../../using/windows.rst:873 +#: ../../using/windows.rst:876 msgid "" "Customization specified in the \"application directory\" will have " "precedence over the one next to the executable, so a user, who may not have " @@ -1424,11 +1424,11 @@ msgid "" "that global .ini file." msgstr "" -#: ../../using/windows.rst:878 +#: ../../using/windows.rst:881 msgid "Customizing default Python versions" msgstr "" -#: ../../using/windows.rst:880 +#: ../../using/windows.rst:883 msgid "" "In some cases, a version qualifier can be included in a command to dictate " "which version of Python will be used by the command. A version qualifier " @@ -1438,13 +1438,13 @@ msgid "" "\"-32\" or \"-64\"." msgstr "" -#: ../../using/windows.rst:886 +#: ../../using/windows.rst:889 msgid "" "For example, a shebang line of ``#!python`` has no version qualifier, while " "``#!python3`` has a version qualifier which specifies only a major version." msgstr "" -#: ../../using/windows.rst:889 +#: ../../using/windows.rst:892 msgid "" "If no version qualifiers are found in a command, the environment variable :" "envvar:`PY_PYTHON` can be set to specify the default version qualifier. If " @@ -1454,7 +1454,7 @@ msgid "" "launcher included with Python 3.7 or newer.)" msgstr "" -#: ../../using/windows.rst:896 +#: ../../using/windows.rst:899 msgid "" "If no minor version qualifiers are found, the environment variable " "``PY_PYTHON{major}`` (where ``{major}`` is the current major version " @@ -1465,7 +1465,7 @@ msgid "" "version in that family." msgstr "" -#: ../../using/windows.rst:904 +#: ../../using/windows.rst:907 msgid "" "On 64-bit Windows with both 32-bit and 64-bit implementations of the same " "(major.minor) Python version installed, the 64-bit version will always be " @@ -1479,30 +1479,30 @@ msgid "" "suffix can be used on a version specifier to change this behaviour." msgstr "" -#: ../../using/windows.rst:915 +#: ../../using/windows.rst:918 msgid "Examples:" msgstr "範例:" -#: ../../using/windows.rst:917 +#: ../../using/windows.rst:920 msgid "" "If no relevant options are set, the commands ``python`` and ``python2`` will " "use the latest Python 2.x version installed and the command ``python3`` will " "use the latest Python 3.x installed." msgstr "" -#: ../../using/windows.rst:921 +#: ../../using/windows.rst:924 msgid "" "The command ``python3.7`` will not consult any options at all as the " "versions are fully specified." msgstr "" -#: ../../using/windows.rst:924 +#: ../../using/windows.rst:927 msgid "" "If ``PY_PYTHON=3``, the commands ``python`` and ``python3`` will both use " "the latest installed Python 3 version." msgstr "" -#: ../../using/windows.rst:927 +#: ../../using/windows.rst:930 msgid "" "If ``PY_PYTHON=3.7-32``, the command ``python`` will use the 32-bit " "implementation of 3.7 whereas the command ``python3`` will use the latest " @@ -1510,13 +1510,13 @@ msgid "" "specified.)" msgstr "" -#: ../../using/windows.rst:932 +#: ../../using/windows.rst:935 msgid "" "If ``PY_PYTHON=3`` and ``PY_PYTHON3=3.7``, the commands ``python`` and " "``python3`` will both use specifically 3.7" msgstr "" -#: ../../using/windows.rst:935 +#: ../../using/windows.rst:938 msgid "" "In addition to environment variables, the same settings can be configured in " "the .INI file used by the launcher. The section in the INI file is called " @@ -1526,25 +1526,25 @@ msgid "" "will override things specified in the INI file." msgstr "" -#: ../../using/windows.rst:942 +#: ../../using/windows.rst:945 msgid "For example:" msgstr "" -#: ../../using/windows.rst:944 +#: ../../using/windows.rst:947 msgid "Setting ``PY_PYTHON=3.7`` is equivalent to the INI file containing:" msgstr "" -#: ../../using/windows.rst:951 +#: ../../using/windows.rst:954 msgid "" "Setting ``PY_PYTHON=3`` and ``PY_PYTHON3=3.7`` is equivalent to the INI file " "containing:" msgstr "" -#: ../../using/windows.rst:961 +#: ../../using/windows.rst:964 msgid "Diagnostics" msgstr "" -#: ../../using/windows.rst:963 +#: ../../using/windows.rst:966 msgid "" "If an environment variable ``PYLAUNCH_DEBUG`` is set (to any value), the " "launcher will print diagnostic information to stderr (i.e. to the console). " @@ -1554,11 +1554,11 @@ msgid "" "target Python." msgstr "" -#: ../../using/windows.rst:975 +#: ../../using/windows.rst:978 msgid "Finding modules" msgstr "" -#: ../../using/windows.rst:977 +#: ../../using/windows.rst:980 msgid "" "Python usually stores its library (and thereby your site-packages folder) in " "the installation directory. So, if you had installed Python to :file:`C:\\" @@ -1567,7 +1567,7 @@ msgid "" "\\\\site-packages\\\\`." msgstr "" -#: ../../using/windows.rst:983 +#: ../../using/windows.rst:986 msgid "" "To completely override :data:`sys.path`, create a ``._pth`` file with the " "same name as the DLL (``python37._pth``) or the executable (``python._pth``) " @@ -1576,7 +1576,7 @@ msgid "" "allows paths to be restricted for any program loading the runtime if desired." msgstr "" -#: ../../using/windows.rst:989 +#: ../../using/windows.rst:992 msgid "" "When the file exists, all registry and environment variables are ignored, " "isolated mode is enabled, and :mod:`site` is not imported unless one line in " @@ -1586,25 +1586,25 @@ msgid "" "arbitrary code cannot be specified." msgstr "" -#: ../../using/windows.rst:996 +#: ../../using/windows.rst:999 msgid "" "Note that ``.pth`` files (without leading underscore) will be processed " "normally by the :mod:`site` module when ``import site`` has been specified." msgstr "" -#: ../../using/windows.rst:999 +#: ../../using/windows.rst:1002 msgid "" "When no ``._pth`` file is found, this is how :data:`sys.path` is populated " "on Windows:" msgstr "" -#: ../../using/windows.rst:1002 +#: ../../using/windows.rst:1005 msgid "" "An empty entry is added at the start, which corresponds to the current " "directory." msgstr "" -#: ../../using/windows.rst:1005 +#: ../../using/windows.rst:1008 msgid "" "If the environment variable :envvar:`PYTHONPATH` exists, as described in :" "ref:`using-on-envvars`, its entries are added next. Note that on Windows, " @@ -1612,7 +1612,7 @@ msgid "" "from the colon used in drive identifiers (``C:\\`` etc.)." msgstr "" -#: ../../using/windows.rst:1010 +#: ../../using/windows.rst:1013 msgid "" "Additional \"application paths\" can be added in the registry as subkeys of :" "samp:`\\\\SOFTWARE\\\\Python\\\\PythonCore\\\\{version}\\\\PythonPath` under " @@ -1622,7 +1622,7 @@ msgid "" "installers only use HKLM, so HKCU is typically empty.)" msgstr "" -#: ../../using/windows.rst:1017 +#: ../../using/windows.rst:1020 msgid "" "If the environment variable :envvar:`PYTHONHOME` is set, it is assumed as " "\"Python Home\". Otherwise, the path of the main Python executable is used " @@ -1633,31 +1633,31 @@ msgid "" "PythonPath stored in the registry." msgstr "" -#: ../../using/windows.rst:1025 +#: ../../using/windows.rst:1028 msgid "" "If the Python Home cannot be located, no :envvar:`PYTHONPATH` is specified " "in the environment, and no registry entries can be found, a default path " "with relative entries is used (e.g. ``.\\Lib;.\\plat-win``, etc)." msgstr "" -#: ../../using/windows.rst:1029 +#: ../../using/windows.rst:1032 msgid "" "If a ``pyvenv.cfg`` file is found alongside the main executable or in the " "directory one level above the executable, the following variations apply:" msgstr "" -#: ../../using/windows.rst:1032 +#: ../../using/windows.rst:1035 msgid "" "If ``home`` is an absolute path and :envvar:`PYTHONHOME` is not set, this " "path is used instead of the path to the main executable when deducing the " "home location." msgstr "" -#: ../../using/windows.rst:1036 +#: ../../using/windows.rst:1039 msgid "The end result of all this is:" msgstr "最終這所有的結果為:" -#: ../../using/windows.rst:1038 +#: ../../using/windows.rst:1041 msgid "" "When running :file:`python.exe`, or any other .exe in the main Python " "directory (either an installed version, or directly from the PCbuild " @@ -1665,7 +1665,7 @@ msgid "" "ignored. Other \"application paths\" in the registry are always read." msgstr "" -#: ../../using/windows.rst:1043 +#: ../../using/windows.rst:1046 msgid "" "When Python is hosted in another .exe (different directory, embedded via " "COM, etc), the \"Python Home\" will not be deduced, so the core path from " @@ -1673,20 +1673,20 @@ msgid "" "always read." msgstr "" -#: ../../using/windows.rst:1047 +#: ../../using/windows.rst:1050 msgid "" "If Python can't find its home and there are no registry value (frozen .exe, " "some very strange installation setup) you get a path with some default, but " "relative, paths." msgstr "" -#: ../../using/windows.rst:1051 +#: ../../using/windows.rst:1054 msgid "" "For those who want to bundle Python into their application or distribution, " "the following advice will prevent conflicts with other installations:" msgstr "" -#: ../../using/windows.rst:1054 +#: ../../using/windows.rst:1057 msgid "" "Include a ``._pth`` file alongside your executable containing the " "directories to include. This will ignore paths listed in the registry and " @@ -1694,20 +1694,20 @@ msgid "" "listed." msgstr "" -#: ../../using/windows.rst:1059 +#: ../../using/windows.rst:1062 msgid "" "If you are loading :file:`python3.dll` or :file:`python37.dll` in your own " "executable, explicitly call :c:func:`Py_SetPath` or (at least) :c:func:" "`Py_SetProgramName` before :c:func:`Py_Initialize`." msgstr "" -#: ../../using/windows.rst:1063 +#: ../../using/windows.rst:1066 msgid "" "Clear and/or overwrite :envvar:`PYTHONPATH` and set :envvar:`PYTHONHOME` " "before launching :file:`python.exe` from your application." msgstr "" -#: ../../using/windows.rst:1066 +#: ../../using/windows.rst:1069 msgid "" "If you cannot use the previous suggestions (for example, you are a " "distribution that allows people to run :file:`python.exe` directly), ensure " @@ -1716,7 +1716,7 @@ msgid "" "correctly named ZIP file will be detected instead.)" msgstr "" -#: ../../using/windows.rst:1072 +#: ../../using/windows.rst:1075 msgid "" "These will ensure that the files in a system-wide installation will not take " "precedence over the copy of the standard library bundled with your " @@ -1726,19 +1726,19 @@ msgid "" "packages." msgstr "" -#: ../../using/windows.rst:1081 +#: ../../using/windows.rst:1084 msgid "" "Adds ``._pth`` file support and removes ``applocal`` option from ``pyvenv." "cfg``." msgstr "" -#: ../../using/windows.rst:1083 +#: ../../using/windows.rst:1086 msgid "" "Adds ``pythonXX.zip`` as a potential landmark when directly adjacent to the " "executable." msgstr "" -#: ../../using/windows.rst:1089 +#: ../../using/windows.rst:1092 msgid "" "Modules specified in the registry under ``Modules`` (not ``PythonPath``) may " "be imported by :class:`importlib.machinery.WindowsRegistryFinder`. This " @@ -1746,88 +1746,88 @@ msgid "" "explicitly added to :attr:`sys.meta_path` in the future." msgstr "" -#: ../../using/windows.rst:1095 +#: ../../using/windows.rst:1098 msgid "Additional modules" msgstr "" -#: ../../using/windows.rst:1097 +#: ../../using/windows.rst:1100 msgid "" "Even though Python aims to be portable among all platforms, there are " "features that are unique to Windows. A couple of modules, both in the " "standard library and external, and snippets exist to use these features." msgstr "" -#: ../../using/windows.rst:1101 +#: ../../using/windows.rst:1104 msgid "" "The Windows-specific standard modules are documented in :ref:`mswin-specific-" "services`." msgstr "" -#: ../../using/windows.rst:1105 +#: ../../using/windows.rst:1108 msgid "PyWin32" msgstr "PyWin32" -#: ../../using/windows.rst:1107 +#: ../../using/windows.rst:1110 msgid "" "The `PyWin32 `_ module by Mark Hammond is " "a collection of modules for advanced Windows-specific support. This " "includes utilities for:" msgstr "" -#: ../../using/windows.rst:1111 +#: ../../using/windows.rst:1114 msgid "" "`Component Object Model `_ (COM)" msgstr "" -#: ../../using/windows.rst:1114 +#: ../../using/windows.rst:1117 msgid "Win32 API calls" msgstr "" -#: ../../using/windows.rst:1115 +#: ../../using/windows.rst:1118 msgid "Registry" msgstr "登錄檔(Registry)" -#: ../../using/windows.rst:1116 +#: ../../using/windows.rst:1119 msgid "Event log" msgstr "事件日誌(Event log)" -#: ../../using/windows.rst:1117 +#: ../../using/windows.rst:1120 msgid "" "`Microsoft Foundation Classes `_ (MFC) user interfaces" msgstr "" -#: ../../using/windows.rst:1121 +#: ../../using/windows.rst:1124 msgid "" "`PythonWin `_ is a sample MFC application shipped with PyWin32. " "It is an embeddable IDE with a built-in debugger." msgstr "" -#: ../../using/windows.rst:1128 +#: ../../using/windows.rst:1131 msgid "" "`Win32 How Do I...? `_" msgstr "" "`Win32 How Do I...? `_" -#: ../../using/windows.rst:1128 +#: ../../using/windows.rst:1131 msgid "by Tim Golden" msgstr "由 Tim Golden 所著" -#: ../../using/windows.rst:1130 +#: ../../using/windows.rst:1133 msgid "`Python and COM `_" msgstr "`Python and COM `_" -#: ../../using/windows.rst:1131 +#: ../../using/windows.rst:1134 msgid "by David and Paul Boddie" msgstr "由 David 與 Paul Boddie 所著" -#: ../../using/windows.rst:1135 +#: ../../using/windows.rst:1138 msgid "cx_Freeze" msgstr "cx_Freeze" -#: ../../using/windows.rst:1137 +#: ../../using/windows.rst:1140 msgid "" "`cx_Freeze `_ is a :mod:" "`distutils` extension (see :ref:`extending-distutils`) which wraps Python " @@ -1836,11 +1836,11 @@ msgid "" "users to install Python." msgstr "" -#: ../../using/windows.rst:1145 +#: ../../using/windows.rst:1148 msgid "Compiling Python on Windows" msgstr "編譯 Python 在 Windows" -#: ../../using/windows.rst:1147 +#: ../../using/windows.rst:1150 msgid "" "If you want to compile CPython yourself, first thing you should do is get " "the `source `_. You can download " @@ -1848,48 +1848,48 @@ msgid "" "devguide.python.org/setup/#get-the-source-code>`_." msgstr "" -#: ../../using/windows.rst:1152 +#: ../../using/windows.rst:1155 msgid "" "The source tree contains a build solution and project files for Microsoft " "Visual Studio, which is the compiler used to build the official Python " "releases. These files are in the :file:`PCbuild` directory." msgstr "" -#: ../../using/windows.rst:1156 +#: ../../using/windows.rst:1159 msgid "" "Check :file:`PCbuild/readme.txt` for general information on the build " "process." msgstr "" -#: ../../using/windows.rst:1158 +#: ../../using/windows.rst:1161 msgid "For extension modules, consult :ref:`building-on-windows`." msgstr "" -#: ../../using/windows.rst:1162 +#: ../../using/windows.rst:1165 msgid "Other Platforms" msgstr "其他平台" -#: ../../using/windows.rst:1164 +#: ../../using/windows.rst:1167 msgid "" "With ongoing development of Python, some platforms that used to be supported " "earlier are no longer supported (due to the lack of users or developers). " "Check :pep:`11` for details on all unsupported platforms." msgstr "" -#: ../../using/windows.rst:1168 +#: ../../using/windows.rst:1171 msgid "" "`Windows CE `_ is `no longer supported " "`__ since Python 3 (if it " "ever was)." msgstr "" -#: ../../using/windows.rst:1171 +#: ../../using/windows.rst:1174 msgid "" "The `Cygwin `_ installer offers to install the `Python " "interpreter `__ as well" msgstr "" -#: ../../using/windows.rst:1175 +#: ../../using/windows.rst:1178 msgid "" "See `Python for Windows `_ for " "detailed information about platforms with pre-compiled installers." diff --git a/whatsnew/3.3.po b/whatsnew/3.3.po index bc476ac47e..bce2a207b2 100644 --- a/whatsnew/3.3.po +++ b/whatsnew/3.3.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-02 00:25+0000\n" +"POT-Creation-Date: 2022-10-05 00:24+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-" @@ -3397,7 +3397,7 @@ msgstr "" #: ../../whatsnew/3.3.rst:2269 msgid "" -"Unicode functions and methods using :c:type:`Py_UNICODE` and :c:type:" +"Unicode functions and methods using :c:type:`Py_UNICODE` and :c:expr:" "`Py_UNICODE*` types:" msgstr "" From 9399dac0ebff292119472b36872e6bbe79d3f98d Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 5 Oct 2022 06:56:27 +0000 Subject: [PATCH 06/14] sync with cpython ece5f7e0 --- c-api/file.po | 4 +- c-api/init.po | 4 +- c-api/marshal.po | 10 +- c-api/memory.po | 6 +- c-api/typeobj.po | 12 +- c-api/veryhigh.po | 8 +- library/re.po | 305 +++++++++++++++++++++++----------------------- 7 files changed, 175 insertions(+), 174 deletions(-) diff --git a/c-api/file.po b/c-api/file.po index fadaa1eb79..1c1145cb85 100644 --- a/c-api/file.po +++ b/c-api/file.po @@ -9,7 +9,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-10-05 06:54+0000\n" "PO-Revision-Date: 2017-09-22 18:26+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -27,7 +27,7 @@ msgstr "檔案(File)物件" #: ../../c-api/file.rst:10 msgid "" "These APIs are a minimal emulation of the Python 2 C API for built-in file " -"objects, which used to rely on the buffered I/O (:c:type:`FILE*`) support " +"objects, which used to rely on the buffered I/O (:c:expr:`FILE*`) support " "from the C standard library. In Python 3, files and streams use the new :" "mod:`io` module, which defines several layers over the low-level unbuffered " "I/O of the operating system. The functions described below are convenience " diff --git a/c-api/init.po b/c-api/init.po index fef342d69a..270df1e369 100644 --- a/c-api/init.po +++ b/c-api/init.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-10-05 06:54+0000\n" "PO-Revision-Date: 2018-05-23 14:06+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1003,7 +1003,7 @@ msgstr "" #: ../../c-api/init.rst:869 msgid "" "This data structure represents the state of a single thread. The only " -"public data member is :attr:`interp` (:c:type:`PyInterpreterState *`), which " +"public data member is :attr:`interp` (:c:expr:`PyInterpreterState *`), which " "points to this thread's interpreter state." msgstr "" diff --git a/c-api/marshal.po b/c-api/marshal.po index 7902d6be0d..55aff8f24e 100644 --- a/c-api/marshal.po +++ b/c-api/marshal.po @@ -7,7 +7,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-10-05 06:54+0000\n" "PO-Revision-Date: 2018-05-23 14:06+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -68,7 +68,7 @@ msgstr "" #: ../../c-api/marshal.rst:46 msgid "" -"Return a C :c:type:`long` from the data stream in a :c:type:`FILE*` opened " +"Return a C :c:type:`long` from the data stream in a :c:expr:`FILE*` opened " "for reading. Only a 32-bit value can be read in using this function, " "regardless of the native size of :c:type:`long`." msgstr "" @@ -81,14 +81,14 @@ msgstr "" #: ../../c-api/marshal.rst:56 msgid "" -"Return a C :c:type:`short` from the data stream in a :c:type:`FILE*` opened " +"Return a C :c:type:`short` from the data stream in a :c:expr:`FILE*` opened " "for reading. Only a 16-bit value can be read in using this function, " "regardless of the native size of :c:type:`short`." msgstr "" #: ../../c-api/marshal.rst:66 msgid "" -"Return a Python object from the data stream in a :c:type:`FILE*` opened for " +"Return a Python object from the data stream in a :c:expr:`FILE*` opened for " "reading." msgstr "" @@ -101,7 +101,7 @@ msgstr "" #: ../../c-api/marshal.rst:75 msgid "" -"Return a Python object from the data stream in a :c:type:`FILE*` opened for " +"Return a Python object from the data stream in a :c:expr:`FILE*` opened for " "reading. Unlike :c:func:`PyMarshal_ReadObjectFromFile`, this function " "assumes that no further objects will be read from the file, allowing it to " "aggressively load file data into memory so that the de-serialization can " diff --git a/c-api/memory.po b/c-api/memory.po index 1ba8e67a73..9416eab56f 100644 --- a/c-api/memory.po +++ b/c-api/memory.po @@ -8,7 +8,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-05 06:54+0000\n" "PO-Revision-Date: 2018-05-23 14:06+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -329,14 +329,14 @@ msgstr "" #: ../../c-api/memory.rst:267 msgid "" "Same as :c:func:`PyMem_Malloc`, but allocates ``(n * sizeof(TYPE))`` bytes " -"of memory. Returns a pointer cast to :c:type:`TYPE*`. The memory will not " +"of memory. Returns a pointer cast to :c:expr:`TYPE*`. The memory will not " "have been initialized in any way." msgstr "" #: ../../c-api/memory.rst:274 msgid "" "Same as :c:func:`PyMem_Realloc`, but the memory block is resized to ``(n * " -"sizeof(TYPE))`` bytes. Returns a pointer cast to :c:type:`TYPE*`. On " +"sizeof(TYPE))`` bytes. Returns a pointer cast to :c:expr:`TYPE*`. On " "return, *p* will be a pointer to the new memory area, or ``NULL`` in the " "event of failure." msgstr "" diff --git a/c-api/typeobj.po b/c-api/typeobj.po index dec64a5c60..18252be2be 100644 --- a/c-api/typeobj.po +++ b/c-api/typeobj.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-08-31 00:21+0000\n" +"POT-Creation-Date: 2022-10-05 06:54+0000\n" "PO-Revision-Date: 2018-05-23 14:33+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -3144,7 +3144,7 @@ msgstr "" #: ../../c-api/typeobj.rst:2329 msgid "" "Check if the request can be met. If not, raise :c:data:`PyExc_BufferError`, " -"set :c:data:`view->obj` to ``NULL`` and return ``-1``." +"set :c:expr:`view->obj` to ``NULL`` and return ``-1``." msgstr "" #: ../../c-api/typeobj.rst:2332 @@ -3157,7 +3157,7 @@ msgstr "" #: ../../c-api/typeobj.rst:2336 msgid "" -"Set :c:data:`view->obj` to *exporter* and increment :c:data:`view->obj`." +"Set :c:expr:`view->obj` to *exporter* and increment :c:expr:`view->obj`." msgstr "" #: ../../c-api/typeobj.rst:2338 @@ -3173,13 +3173,13 @@ msgstr "" #: ../../c-api/typeobj.rst:2343 msgid "" "Re-export: Each member of the tree acts as the exporting object and sets :c:" -"data:`view->obj` to a new reference to itself." +"expr:`view->obj` to a new reference to itself." msgstr "" #: ../../c-api/typeobj.rst:2346 msgid "" "Redirect: The buffer request is redirected to the root object of the tree. " -"Here, :c:data:`view->obj` will be a new reference to the root object." +"Here, :c:expr:`view->obj` will be a new reference to the root object." msgstr "" #: ../../c-api/typeobj.rst:2350 @@ -3237,7 +3237,7 @@ msgstr "" #: ../../c-api/typeobj.rst:2389 msgid "" -"This function MUST NOT decrement :c:data:`view->obj`, since that is done " +"This function MUST NOT decrement :c:expr:`view->obj`, since that is done " "automatically in :c:func:`PyBuffer_Release` (this scheme is useful for " "breaking reference cycles)." msgstr "" diff --git a/c-api/veryhigh.po b/c-api/veryhigh.po index c6aa0a257c..374d938588 100644 --- a/c-api/veryhigh.po +++ b/c-api/veryhigh.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-02-24 00:12+0000\n" +"POT-Creation-Date: 2022-10-05 06:54+0000\n" "PO-Revision-Date: 2018-05-23 14:08+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -39,12 +39,12 @@ msgstr "" #: ../../c-api/veryhigh.rst:19 msgid "" -"Note also that several of these functions take :c:type:`FILE*` parameters. " -"One particular issue which needs to be handled carefully is that the :c:type:" +"Note also that several of these functions take :c:expr:`FILE*` parameters. " +"One particular issue which needs to be handled carefully is that the :c:expr:" "`FILE` structure for different C libraries can be different and " "incompatible. Under Windows (at least), it is possible for dynamically " "linked extensions to actually use different libraries, so care should be " -"taken that :c:type:`FILE*` parameters are only passed to these functions if " +"taken that :c:expr:`FILE*` parameters are only passed to these functions if " "it is certain that they were created by the same library that the Python " "runtime is using." msgstr "" diff --git a/library/re.po b/library/re.po index 601ca7659e..5a6212c3c2 100644 --- a/library/re.po +++ b/library/re.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-05-24 00:16+0000\n" +"POT-Creation-Date: 2022-10-05 06:54+0000\n" "PO-Revision-Date: 2018-05-23 16:09+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -145,7 +145,7 @@ msgstr "" msgid "The special characters are:" msgstr "" -#: ../../library/re.rst:104 ../../library/re.rst:1431 +#: ../../library/re.rst:104 ../../library/re.rst:1432 msgid "``.``" msgstr "``.``" @@ -954,59 +954,60 @@ msgid "" "more readable by allowing you to visually separate logical sections of the " "pattern and add comments. Whitespace within the pattern is ignored, except " "when in a character class, or when preceded by an unescaped backslash, or " -"within tokens like ``*?``, ``(?:`` or ``(?P<...>``. When a line contains a " -"``#`` that is not in a character class and is not preceded by an unescaped " -"backslash, all characters from the leftmost such ``#`` through the end of " -"the line are ignored." +"within tokens like ``*?``, ``(?:`` or ``(?P<...>``. For example, ``(? :`` " +"and ``* ?`` are not allowed. When a line contains a ``#`` that is not in a " +"character class and is not preceded by an unescaped backslash, all " +"characters from the leftmost such ``#`` through the end of the line are " +"ignored." msgstr "" -#: ../../library/re.rst:710 +#: ../../library/re.rst:711 msgid "" "This means that the two following regular expression objects that match a " "decimal number are functionally equal::" msgstr "" -#: ../../library/re.rst:718 +#: ../../library/re.rst:719 msgid "Corresponds to the inline flag ``(?x)``." msgstr "" -#: ../../library/re.rst:722 +#: ../../library/re.rst:723 msgid "Functions" msgstr "" -#: ../../library/re.rst:726 +#: ../../library/re.rst:727 msgid "" "Compile a regular expression pattern into a :ref:`regular expression object " "`, which can be used for matching using its :func:`~Pattern." "match`, :func:`~Pattern.search` and other methods, described below." msgstr "" -#: ../../library/re.rst:731 +#: ../../library/re.rst:732 msgid "" "The expression's behaviour can be modified by specifying a *flags* value. " "Values can be any of the following variables, combined using bitwise OR (the " "``|`` operator)." msgstr "" -#: ../../library/re.rst:735 +#: ../../library/re.rst:736 msgid "The sequence ::" msgstr "" -#: ../../library/re.rst:740 +#: ../../library/re.rst:741 msgid "is equivalent to ::" msgstr "" "等價於:\n" "\n" "::" -#: ../../library/re.rst:744 +#: ../../library/re.rst:745 msgid "" "but using :func:`re.compile` and saving the resulting regular expression " "object for reuse is more efficient when the expression will be used several " "times in a single program." msgstr "" -#: ../../library/re.rst:750 +#: ../../library/re.rst:751 msgid "" "The compiled versions of the most recent patterns passed to :func:`re." "compile` and the module-level matching functions are cached, so programs " @@ -1014,7 +1015,7 @@ msgid "" "compiling regular expressions." msgstr "" -#: ../../library/re.rst:758 +#: ../../library/re.rst:759 msgid "" "Scan through *string* looking for the first location where the regular " "expression *pattern* produces a match, and return a corresponding :ref:" @@ -1023,7 +1024,7 @@ msgid "" "length match at some point in the string." msgstr "" -#: ../../library/re.rst:767 +#: ../../library/re.rst:768 msgid "" "If zero or more characters at the beginning of *string* match the regular " "expression *pattern*, return a corresponding :ref:`match object `. Return ``None`` if the " @@ -1051,7 +1052,7 @@ msgid "" "length match." msgstr "" -#: ../../library/re.rst:791 +#: ../../library/re.rst:792 msgid "" "Split *string* by the occurrences of *pattern*. If capturing parentheses " "are used in *pattern*, then the text of all groups in the pattern are also " @@ -1060,42 +1061,42 @@ msgid "" "final element of the list. ::" msgstr "" -#: ../../library/re.rst:806 +#: ../../library/re.rst:807 msgid "" "If there are capturing groups in the separator and it matches at the start " "of the string, the result will start with an empty string. The same holds " "for the end of the string::" msgstr "" -#: ../../library/re.rst:813 +#: ../../library/re.rst:814 msgid "" "That way, separator components are always found at the same relative indices " "within the result list." msgstr "" -#: ../../library/re.rst:816 +#: ../../library/re.rst:817 msgid "" "Empty matches for the pattern split the string only when not adjacent to a " "previous empty match." msgstr "" -#: ../../library/re.rst:826 ../../library/re.rst:916 ../../library/re.rst:940 +#: ../../library/re.rst:827 ../../library/re.rst:917 ../../library/re.rst:941 msgid "Added the optional flags argument." msgstr "" -#: ../../library/re.rst:829 +#: ../../library/re.rst:830 msgid "" "Added support of splitting on a pattern that could match an empty string." msgstr "" -#: ../../library/re.rst:835 +#: ../../library/re.rst:836 msgid "" "Return all non-overlapping matches of *pattern* in *string*, as a list of " "strings or tuples. The *string* is scanned left-to-right, and matches are " "returned in the order found. Empty matches are included in the result." msgstr "" -#: ../../library/re.rst:839 +#: ../../library/re.rst:840 msgid "" "The result depends on the number of capturing groups in the pattern. If " "there are no groups, return a list of strings matching the whole pattern. " @@ -1105,11 +1106,11 @@ msgid "" "result." msgstr "" -#: ../../library/re.rst:851 ../../library/re.rst:862 +#: ../../library/re.rst:852 ../../library/re.rst:863 msgid "Non-empty matches can now start just after a previous empty match." msgstr "" -#: ../../library/re.rst:857 +#: ../../library/re.rst:858 msgid "" "Return an :term:`iterator` yielding :ref:`match objects ` " "over all non-overlapping matches for the RE *pattern* in *string*. The " @@ -1117,7 +1118,7 @@ msgid "" "found. Empty matches are included in the result." msgstr "" -#: ../../library/re.rst:868 +#: ../../library/re.rst:869 msgid "" "Return the string obtained by replacing the leftmost non-overlapping " "occurrences of *pattern* in *string* by the replacement *repl*. If the " @@ -1131,18 +1132,18 @@ msgid "" "For example::" msgstr "" -#: ../../library/re.rst:884 +#: ../../library/re.rst:885 msgid "" "If *repl* is a function, it is called for every non-overlapping occurrence " "of *pattern*. The function takes a single :ref:`match object ` argument, and returns the replacement string. For example::" msgstr "" -#: ../../library/re.rst:896 +#: ../../library/re.rst:897 msgid "The pattern may be a string or a :ref:`pattern object `." msgstr "" -#: ../../library/re.rst:898 +#: ../../library/re.rst:899 msgid "" "The optional argument *count* is the maximum number of pattern occurrences " "to be replaced; *count* must be a non-negative integer. If omitted or zero, " @@ -1151,7 +1152,7 @@ msgid "" "'abxd')`` returns ``'-a-b--d-'``." msgstr "" -#: ../../library/re.rst:906 +#: ../../library/re.rst:907 msgid "" "In string-type *repl* arguments, in addition to the character escapes and " "backreferences described above, ``\\g`` will use the substring matched " @@ -1164,52 +1165,52 @@ msgid "" "RE." msgstr "" -#: ../../library/re.rst:919 ../../library/re.rst:943 ../../library/re.rst:1177 +#: ../../library/re.rst:920 ../../library/re.rst:944 ../../library/re.rst:1178 msgid "Unmatched groups are replaced with an empty string." msgstr "" -#: ../../library/re.rst:922 +#: ../../library/re.rst:923 msgid "" "Unknown escapes in *pattern* consisting of ``'\\'`` and an ASCII letter now " "are errors." msgstr "" -#: ../../library/re.rst:926 +#: ../../library/re.rst:927 msgid "" "Unknown escapes in *repl* consisting of ``'\\'`` and an ASCII letter now are " "errors." msgstr "" -#: ../../library/re.rst:930 +#: ../../library/re.rst:931 msgid "" "Empty matches for the pattern are replaced when adjacent to a previous non-" "empty match." msgstr "" -#: ../../library/re.rst:937 +#: ../../library/re.rst:938 msgid "" "Perform the same operation as :func:`sub`, but return a tuple ``(new_string, " "number_of_subs_made)``." msgstr "" -#: ../../library/re.rst:949 +#: ../../library/re.rst:950 msgid "" "Escape special characters in *pattern*. This is useful if you want to match " "an arbitrary literal string that may have regular expression metacharacters " "in it. For example::" msgstr "" -#: ../../library/re.rst:964 +#: ../../library/re.rst:965 msgid "" "This function must not be used for the replacement string in :func:`sub` " "and :func:`subn`, only backslashes should be escaped. For example::" msgstr "" -#: ../../library/re.rst:972 +#: ../../library/re.rst:973 msgid "The ``'_'`` character is no longer escaped." msgstr "" -#: ../../library/re.rst:975 +#: ../../library/re.rst:976 msgid "" "Only characters that can have special meaning in a regular expression are " "escaped. As a result, ``'!'``, ``'\"'``, ``'%'``, ``\"'\"``, ``','``, " @@ -1217,15 +1218,15 @@ msgid "" "are no longer escaped." msgstr "" -#: ../../library/re.rst:984 +#: ../../library/re.rst:985 msgid "Clear the regular expression cache." msgstr "" -#: ../../library/re.rst:988 +#: ../../library/re.rst:989 msgid "Exceptions" msgstr "" -#: ../../library/re.rst:992 +#: ../../library/re.rst:993 msgid "" "Exception raised when a string passed to one of the functions here is not a " "valid regular expression (for example, it might contain unmatched " @@ -1234,41 +1235,41 @@ msgid "" "pattern. The error instance has the following additional attributes:" msgstr "" -#: ../../library/re.rst:1000 +#: ../../library/re.rst:1001 msgid "The unformatted error message." msgstr "" -#: ../../library/re.rst:1004 +#: ../../library/re.rst:1005 msgid "The regular expression pattern." msgstr "" -#: ../../library/re.rst:1008 +#: ../../library/re.rst:1009 msgid "The index in *pattern* where compilation failed (may be ``None``)." msgstr "" -#: ../../library/re.rst:1012 +#: ../../library/re.rst:1013 msgid "The line corresponding to *pos* (may be ``None``)." msgstr "" -#: ../../library/re.rst:1016 +#: ../../library/re.rst:1017 msgid "The column corresponding to *pos* (may be ``None``)." msgstr "" -#: ../../library/re.rst:1018 +#: ../../library/re.rst:1019 msgid "Added additional attributes." msgstr "新增額外屬性。" -#: ../../library/re.rst:1024 +#: ../../library/re.rst:1025 msgid "Regular Expression Objects" msgstr "" -#: ../../library/re.rst:1026 +#: ../../library/re.rst:1027 msgid "" "Compiled regular expression objects support the following methods and " "attributes:" msgstr "" -#: ../../library/re.rst:1031 +#: ../../library/re.rst:1032 msgid "" "Scan through *string* looking for the first location where this regular " "expression produces a match, and return a corresponding :ref:`match object " @@ -1277,7 +1278,7 @@ msgid "" "some point in the string." msgstr "" -#: ../../library/re.rst:1037 +#: ../../library/re.rst:1038 msgid "" "The optional second parameter *pos* gives an index in the string where the " "search is to start; it defaults to ``0``. This is not completely equivalent " @@ -1286,7 +1287,7 @@ msgid "" "necessarily at the index where the search is to start." msgstr "" -#: ../../library/re.rst:1043 +#: ../../library/re.rst:1044 msgid "" "The optional parameter *endpos* limits how far the string will be searched; " "it will be as if the string is *endpos* characters long, so only the " @@ -1296,7 +1297,7 @@ msgid "" "equivalent to ``rx.search(string[:50], 0)``. ::" msgstr "" -#: ../../library/re.rst:1058 +#: ../../library/re.rst:1059 msgid "" "If zero or more characters at the *beginning* of *string* match this regular " "expression, return a corresponding :ref:`match object `. " @@ -1304,19 +1305,19 @@ msgid "" "different from a zero-length match." msgstr "" -#: ../../library/re.rst:1063 ../../library/re.rst:1081 +#: ../../library/re.rst:1064 ../../library/re.rst:1082 msgid "" "The optional *pos* and *endpos* parameters have the same meaning as for the :" "meth:`~Pattern.search` method. ::" msgstr "" -#: ../../library/re.rst:1071 +#: ../../library/re.rst:1072 msgid "" "If you want to locate a match anywhere in *string*, use :meth:`~Pattern." "search` instead (see also :ref:`search-vs-match`)." msgstr "" -#: ../../library/re.rst:1077 +#: ../../library/re.rst:1078 msgid "" "If the whole *string* matches this regular expression, return a " "corresponding :ref:`match object `. Return ``None`` if the " @@ -1324,76 +1325,76 @@ msgid "" "length match." msgstr "" -#: ../../library/re.rst:1095 +#: ../../library/re.rst:1096 msgid "Identical to the :func:`split` function, using the compiled pattern." msgstr "" -#: ../../library/re.rst:1100 +#: ../../library/re.rst:1101 msgid "" "Similar to the :func:`findall` function, using the compiled pattern, but " "also accepts optional *pos* and *endpos* parameters that limit the search " "region like for :meth:`search`." msgstr "" -#: ../../library/re.rst:1107 +#: ../../library/re.rst:1108 msgid "" "Similar to the :func:`finditer` function, using the compiled pattern, but " "also accepts optional *pos* and *endpos* parameters that limit the search " "region like for :meth:`search`." msgstr "" -#: ../../library/re.rst:1114 +#: ../../library/re.rst:1115 msgid "Identical to the :func:`sub` function, using the compiled pattern." msgstr "" -#: ../../library/re.rst:1119 +#: ../../library/re.rst:1120 msgid "Identical to the :func:`subn` function, using the compiled pattern." msgstr "" -#: ../../library/re.rst:1124 +#: ../../library/re.rst:1125 msgid "" "The regex matching flags. This is a combination of the flags given to :func:" "`.compile`, any ``(?...)`` inline flags in the pattern, and implicit flags " "such as :data:`UNICODE` if the pattern is a Unicode string." msgstr "" -#: ../../library/re.rst:1131 +#: ../../library/re.rst:1132 msgid "The number of capturing groups in the pattern." msgstr "" -#: ../../library/re.rst:1136 +#: ../../library/re.rst:1137 msgid "" "A dictionary mapping any symbolic group names defined by ``(?P)`` to " "group numbers. The dictionary is empty if no symbolic groups were used in " "the pattern." msgstr "" -#: ../../library/re.rst:1143 +#: ../../library/re.rst:1144 msgid "The pattern string from which the pattern object was compiled." msgstr "" -#: ../../library/re.rst:1146 +#: ../../library/re.rst:1147 msgid "" "Added support of :func:`copy.copy` and :func:`copy.deepcopy`. Compiled " "regular expression objects are considered atomic." msgstr "" -#: ../../library/re.rst:1154 +#: ../../library/re.rst:1155 msgid "Match Objects" msgstr "" -#: ../../library/re.rst:1156 +#: ../../library/re.rst:1157 msgid "" "Match objects always have a boolean value of ``True``. Since :meth:`~Pattern." "match` and :meth:`~Pattern.search` return ``None`` when there is no match, " "you can test whether there was a match with a simple ``if`` statement::" msgstr "" -#: ../../library/re.rst:1165 +#: ../../library/re.rst:1166 msgid "Match objects support the following methods and attributes:" msgstr "" -#: ../../library/re.rst:1170 +#: ../../library/re.rst:1171 msgid "" "Return the string obtained by doing backslash substitution on the template " "string *template*, as done by the :meth:`~Pattern.sub` method. Escapes such " @@ -1402,7 +1403,7 @@ msgid "" "\\g``) are replaced by the contents of the corresponding group." msgstr "" -#: ../../library/re.rst:1182 +#: ../../library/re.rst:1183 msgid "" "Returns one or more subgroups of the match. If there is a single argument, " "the result is a single string; if there are multiple arguments, the result " @@ -1417,7 +1418,7 @@ msgid "" "the pattern that matched multiple times, the last match is returned. ::" msgstr "" -#: ../../library/re.rst:1204 +#: ../../library/re.rst:1205 msgid "" "If the regular expression uses the ``(?P...)`` syntax, the *groupN* " "arguments may also be strings identifying groups by their group name. If a " @@ -1425,53 +1426,53 @@ msgid "" "`IndexError` exception is raised." msgstr "" -#: ../../library/re.rst:1209 +#: ../../library/re.rst:1210 msgid "A moderately complicated example::" msgstr "" -#: ../../library/re.rst:1217 +#: ../../library/re.rst:1218 msgid "Named groups can also be referred to by their index::" msgstr "" -#: ../../library/re.rst:1224 +#: ../../library/re.rst:1225 msgid "If a group matches multiple times, only the last match is accessible::" msgstr "" -#: ../../library/re.rst:1233 +#: ../../library/re.rst:1234 msgid "" "This is identical to ``m.group(g)``. This allows easier access to an " "individual group from a match::" msgstr "" -#: ../../library/re.rst:1249 +#: ../../library/re.rst:1250 msgid "" "Return a tuple containing all the subgroups of the match, from 1 up to " "however many groups are in the pattern. The *default* argument is used for " "groups that did not participate in the match; it defaults to ``None``." msgstr "" -#: ../../library/re.rst:1253 ../../library/re.rst:1475 +#: ../../library/re.rst:1254 ../../library/re.rst:1476 msgid "For example::" msgstr "" "舉例來說:\n" "\n" "::" -#: ../../library/re.rst:1259 +#: ../../library/re.rst:1260 msgid "" "If we make the decimal place and everything after it optional, not all " "groups might participate in the match. These groups will default to " "``None`` unless the *default* argument is given::" msgstr "" -#: ../../library/re.rst:1272 +#: ../../library/re.rst:1273 msgid "" "Return a dictionary containing all the *named* subgroups of the match, keyed " "by the subgroup name. The *default* argument is used for groups that did " "not participate in the match; it defaults to ``None``. For example::" msgstr "" -#: ../../library/re.rst:1284 +#: ../../library/re.rst:1285 msgid "" "Return the indices of the start and end of the substring matched by *group*; " "*group* defaults to zero (meaning the whole matched substring). Return " @@ -1480,7 +1481,7 @@ msgid "" "matched by group *g* (equivalent to ``m.group(g)``) is ::" msgstr "" -#: ../../library/re.rst:1292 +#: ../../library/re.rst:1293 msgid "" "Note that ``m.start(group)`` will equal ``m.end(group)`` if *group* matched " "a null string. For example, after ``m = re.search('b(c?)', 'cba')``, ``m." @@ -1488,32 +1489,32 @@ msgid "" "2, and ``m.start(2)`` raises an :exc:`IndexError` exception." msgstr "" -#: ../../library/re.rst:1297 +#: ../../library/re.rst:1298 msgid "An example that will remove *remove_this* from email addresses::" msgstr "" -#: ../../library/re.rst:1307 +#: ../../library/re.rst:1308 msgid "" "For a match *m*, return the 2-tuple ``(m.start(group), m.end(group))``. Note " "that if *group* did not contribute to the match, this is ``(-1, -1)``. " "*group* defaults to zero, the entire match." msgstr "" -#: ../../library/re.rst:1314 +#: ../../library/re.rst:1315 msgid "" "The value of *pos* which was passed to the :meth:`~Pattern.search` or :meth:" "`~Pattern.match` method of a :ref:`regex object `. This is the " "index into the string at which the RE engine started looking for a match." msgstr "" -#: ../../library/re.rst:1321 +#: ../../library/re.rst:1322 msgid "" "The value of *endpos* which was passed to the :meth:`~Pattern.search` or :" "meth:`~Pattern.match` method of a :ref:`regex object `. This is " "the index into the string beyond which the RE engine will not go." msgstr "" -#: ../../library/re.rst:1328 +#: ../../library/re.rst:1329 msgid "" "The integer index of the last matched capturing group, or ``None`` if no " "group was matched at all. For example, the expressions ``(a)b``, ``((a)" @@ -1522,43 +1523,43 @@ msgid "" "applied to the same string." msgstr "" -#: ../../library/re.rst:1337 +#: ../../library/re.rst:1338 msgid "" "The name of the last matched capturing group, or ``None`` if the group " "didn't have a name, or if no group was matched at all." msgstr "" -#: ../../library/re.rst:1343 +#: ../../library/re.rst:1344 msgid "" "The :ref:`regular expression object ` whose :meth:`~Pattern." "match` or :meth:`~Pattern.search` method produced this match instance." msgstr "" -#: ../../library/re.rst:1349 +#: ../../library/re.rst:1350 msgid "The string passed to :meth:`~Pattern.match` or :meth:`~Pattern.search`." msgstr "" -#: ../../library/re.rst:1352 +#: ../../library/re.rst:1353 msgid "" "Added support of :func:`copy.copy` and :func:`copy.deepcopy`. Match objects " "are considered atomic." msgstr "" -#: ../../library/re.rst:1360 +#: ../../library/re.rst:1361 msgid "Regular Expression Examples" msgstr "" -#: ../../library/re.rst:1364 +#: ../../library/re.rst:1365 msgid "Checking for a Pair" msgstr "" -#: ../../library/re.rst:1366 +#: ../../library/re.rst:1367 msgid "" "In this example, we'll use the following helper function to display match " "objects a little more gracefully::" msgstr "" -#: ../../library/re.rst:1374 +#: ../../library/re.rst:1375 msgid "" "Suppose you are writing a poker program where a player's hand is represented " "as a 5-character string with each character representing a card, \"a\" for " @@ -1566,28 +1567,28 @@ msgid "" "\"2\" through \"9\" representing the card with that value." msgstr "" -#: ../../library/re.rst:1379 +#: ../../library/re.rst:1380 msgid "To see if a given string is a valid hand, one could do the following::" msgstr "" -#: ../../library/re.rst:1389 +#: ../../library/re.rst:1390 msgid "" "That last hand, ``\"727ak\"``, contained a pair, or two of the same valued " "cards. To match this with a regular expression, one could use backreferences " "as such::" msgstr "" -#: ../../library/re.rst:1399 +#: ../../library/re.rst:1400 msgid "" "To find out what card the pair consists of, one could use the :meth:`~Match." "group` method of the match object in the following manner::" msgstr "" -#: ../../library/re.rst:1418 +#: ../../library/re.rst:1419 msgid "Simulating scanf()" msgstr "" -#: ../../library/re.rst:1422 +#: ../../library/re.rst:1423 msgid "" "Python does not currently have an equivalent to :c:func:`scanf`. Regular " "expressions are generally more powerful, though also more verbose, than :c:" @@ -1596,99 +1597,99 @@ msgid "" "expressions." msgstr "" -#: ../../library/re.rst:1429 +#: ../../library/re.rst:1430 msgid ":c:func:`scanf` Token" msgstr "" -#: ../../library/re.rst:1429 +#: ../../library/re.rst:1430 msgid "Regular Expression" msgstr "" -#: ../../library/re.rst:1431 +#: ../../library/re.rst:1432 msgid "``%c``" msgstr "``%c``" -#: ../../library/re.rst:1433 +#: ../../library/re.rst:1434 msgid "``%5c``" msgstr "``%5c``" -#: ../../library/re.rst:1433 +#: ../../library/re.rst:1434 msgid "``.{5}``" msgstr "``.{5}``" -#: ../../library/re.rst:1435 +#: ../../library/re.rst:1436 msgid "``%d``" msgstr "``%d``" -#: ../../library/re.rst:1435 +#: ../../library/re.rst:1436 msgid "``[-+]?\\d+``" msgstr "``[-+]?\\d+``" -#: ../../library/re.rst:1437 +#: ../../library/re.rst:1438 msgid "``%e``, ``%E``, ``%f``, ``%g``" msgstr "``%e``, ``%E``, ``%f``, ``%g``" -#: ../../library/re.rst:1437 +#: ../../library/re.rst:1438 msgid "``[-+]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?``" msgstr "``[-+]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?``" -#: ../../library/re.rst:1439 +#: ../../library/re.rst:1440 msgid "``%i``" msgstr "``%i``" -#: ../../library/re.rst:1439 +#: ../../library/re.rst:1440 msgid "``[-+]?(0[xX][\\dA-Fa-f]+|0[0-7]*|\\d+)``" msgstr "``[-+]?(0[xX][\\dA-Fa-f]+|0[0-7]*|\\d+)``" -#: ../../library/re.rst:1441 +#: ../../library/re.rst:1442 msgid "``%o``" msgstr "``%o``" -#: ../../library/re.rst:1441 +#: ../../library/re.rst:1442 msgid "``[-+]?[0-7]+``" msgstr "``[-+]?[0-7]+``" -#: ../../library/re.rst:1443 +#: ../../library/re.rst:1444 msgid "``%s``" msgstr "``%s``" -#: ../../library/re.rst:1443 +#: ../../library/re.rst:1444 msgid "``\\S+``" msgstr "``\\S+``" -#: ../../library/re.rst:1445 +#: ../../library/re.rst:1446 msgid "``%u``" msgstr "``%u``" -#: ../../library/re.rst:1445 +#: ../../library/re.rst:1446 msgid "``\\d+``" msgstr "``\\d+``" -#: ../../library/re.rst:1447 +#: ../../library/re.rst:1448 msgid "``%x``, ``%X``" msgstr "``%x``\\ 、\\ ``%X``" -#: ../../library/re.rst:1447 +#: ../../library/re.rst:1448 msgid "``[-+]?(0[xX])?[\\dA-Fa-f]+``" msgstr "``[-+]?(0[xX])?[\\dA-Fa-f]+``" -#: ../../library/re.rst:1450 +#: ../../library/re.rst:1451 msgid "To extract the filename and numbers from a string like ::" msgstr "" -#: ../../library/re.rst:1454 +#: ../../library/re.rst:1455 msgid "you would use a :c:func:`scanf` format like ::" msgstr "" -#: ../../library/re.rst:1458 +#: ../../library/re.rst:1459 msgid "The equivalent regular expression would be ::" msgstr "" -#: ../../library/re.rst:1466 +#: ../../library/re.rst:1467 msgid "search() vs. match()" msgstr "" -#: ../../library/re.rst:1470 +#: ../../library/re.rst:1471 msgid "" "Python offers two different primitive operations based on regular " "expressions: :func:`re.match` checks for a match only at the beginning of " @@ -1696,13 +1697,13 @@ msgid "" "string (this is what Perl does by default)." msgstr "" -#: ../../library/re.rst:1481 +#: ../../library/re.rst:1482 msgid "" "Regular expressions beginning with ``'^'`` can be used with :func:`search` " "to restrict the match at the beginning of the string::" msgstr "" -#: ../../library/re.rst:1489 +#: ../../library/re.rst:1490 msgid "" "Note however that in :const:`MULTILINE` mode :func:`match` only matches at " "the beginning of the string, whereas using :func:`search` with a regular " @@ -1710,11 +1711,11 @@ msgid "" "line. ::" msgstr "" -#: ../../library/re.rst:1499 +#: ../../library/re.rst:1500 msgid "Making a Phonebook" msgstr "" -#: ../../library/re.rst:1501 +#: ../../library/re.rst:1502 msgid "" ":func:`split` splits a string into a list delimited by the passed pattern. " "The method is invaluable for converting textual data into data structures " @@ -1722,37 +1723,37 @@ msgid "" "following example that creates a phonebook." msgstr "" -#: ../../library/re.rst:1506 +#: ../../library/re.rst:1507 msgid "" "First, here is the input. Normally it may come from a file, here we are " "using triple-quoted string syntax" msgstr "" -#: ../../library/re.rst:1519 +#: ../../library/re.rst:1520 msgid "" "The entries are separated by one or more newlines. Now we convert the string " "into a list with each nonempty line having its own entry:" msgstr "" -#: ../../library/re.rst:1532 +#: ../../library/re.rst:1533 msgid "" "Finally, split each entry into a list with first name, last name, telephone " "number, and address. We use the ``maxsplit`` parameter of :func:`split` " "because the address has spaces, our splitting pattern, in it:" msgstr "" -#: ../../library/re.rst:1545 +#: ../../library/re.rst:1546 msgid "" "The ``:?`` pattern matches the colon after the last name, so that it does " "not occur in the result list. With a ``maxsplit`` of ``4``, we could " "separate the house number from the street name:" msgstr "" -#: ../../library/re.rst:1560 +#: ../../library/re.rst:1561 msgid "Text Munging" msgstr "" -#: ../../library/re.rst:1562 +#: ../../library/re.rst:1563 msgid "" ":func:`sub` replaces every occurrence of a pattern with a string or the " "result of a function. This example demonstrates using :func:`sub` with a " @@ -1760,11 +1761,11 @@ msgid "" "each word of a sentence except for the first and last characters::" msgstr "" -#: ../../library/re.rst:1579 +#: ../../library/re.rst:1580 msgid "Finding all Adverbs" msgstr "" -#: ../../library/re.rst:1581 +#: ../../library/re.rst:1582 msgid "" ":func:`findall` matches *all* occurrences of a pattern, not just the first " "one as :func:`search` does. For example, if a writer wanted to find all of " @@ -1772,11 +1773,11 @@ msgid "" "manner::" msgstr "" -#: ../../library/re.rst:1592 +#: ../../library/re.rst:1593 msgid "Finding all Adverbs and their Positions" msgstr "" -#: ../../library/re.rst:1594 +#: ../../library/re.rst:1595 msgid "" "If one wants more information about all matches of a pattern than the " "matched text, :func:`finditer` is useful as it provides :ref:`match objects " @@ -1785,11 +1786,11 @@ msgid "" "text, they would use :func:`finditer` in the following manner::" msgstr "" -#: ../../library/re.rst:1608 +#: ../../library/re.rst:1609 msgid "Raw String Notation" msgstr "" -#: ../../library/re.rst:1610 +#: ../../library/re.rst:1611 msgid "" "Raw string notation (``r\"text\"``) keeps regular expressions sane. Without " "it, every backslash (``'\\'``) in a regular expression would have to be " @@ -1797,7 +1798,7 @@ msgid "" "lines of code are functionally identical::" msgstr "" -#: ../../library/re.rst:1620 +#: ../../library/re.rst:1621 msgid "" "When one wants to match a literal backslash, it must be escaped in the " "regular expression. With raw string notation, this means ``r\"\\\\\"``. " @@ -1805,29 +1806,29 @@ msgid "" "following lines of code functionally identical::" msgstr "" -#: ../../library/re.rst:1632 +#: ../../library/re.rst:1633 msgid "Writing a Tokenizer" msgstr "" -#: ../../library/re.rst:1634 +#: ../../library/re.rst:1635 msgid "" "A `tokenizer or scanner `_ " "analyzes a string to categorize groups of characters. This is a useful " "first step in writing a compiler or interpreter." msgstr "" -#: ../../library/re.rst:1638 +#: ../../library/re.rst:1639 msgid "" "The text categories are specified with regular expressions. The technique " "is to combine those into a single master regular expression and to loop over " "successive matches::" msgstr "" -#: ../../library/re.rst:1694 +#: ../../library/re.rst:1695 msgid "The tokenizer produces the following output::" msgstr "" -#: ../../library/re.rst:1717 +#: ../../library/re.rst:1718 msgid "" "Friedl, Jeffrey. Mastering Regular Expressions. 3rd ed., O'Reilly Media, " "2009. The third edition of the book no longer covers Python at all, but the " From f1bc197adf4b951f47188af9c186aed7337c9d47 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 6 Oct 2022 00:25:25 +0000 Subject: [PATCH 07/14] sync with cpython c80c282d --- c-api/arg.po | 141 +++++---- c-api/call.po | 14 +- c-api/capsule.po | 4 +- c-api/complex.po | 6 +- c-api/conversion.po | 6 +- c-api/dict.po | 8 +- c-api/exceptions.po | 18 +- c-api/file.po | 6 +- c-api/float.po | 10 +- c-api/import.po | 4 +- c-api/init.po | 38 +-- c-api/intro.po | 10 +- c-api/long.po | 40 +-- c-api/marshal.po | 14 +- c-api/memory.po | 6 +- c-api/module.po | 8 +- c-api/object.po | 4 +- c-api/structures.po | 26 +- c-api/sys.po | 8 +- c-api/tuple.po | 4 +- c-api/typehints.po | 4 +- c-api/typeobj.po | 16 +- c-api/unicode.po | 26 +- c-api/veryhigh.po | 4 +- extending/extending.po | 33 +- extending/newtypes.po | 8 +- library/asyncio-eventloop.po | 571 ++++++++++++++++++----------------- library/asyncio-stream.po | 149 ++++----- library/ctypes.po | 144 +++++---- library/posix.po | 8 +- library/socket.po | 23 +- library/sqlite3.po | 211 ++++++------- library/stdtypes.po | 4 +- library/struct.po | 60 ++-- reference/datamodel.po | 4 +- tutorial/errors.po | 89 +++--- whatsnew/2.2.po | 4 +- whatsnew/2.3.po | 8 +- whatsnew/2.4.po | 16 +- whatsnew/2.5.po | 28 +- whatsnew/2.6.po | 4 +- whatsnew/2.7.po | 6 +- whatsnew/3.3.po | 4 +- whatsnew/3.7.po | 14 +- whatsnew/3.8.po | 4 +- whatsnew/3.9.po | 4 +- 46 files changed, 961 insertions(+), 860 deletions(-) diff --git a/c-api/arg.po b/c-api/arg.po index 263eece943..9e5bbd62ac 100644 --- a/c-api/arg.po +++ b/c-api/arg.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-10-06 00:23+0000\n" "PO-Revision-Date: 2021-11-22 16:44+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -241,7 +241,7 @@ msgstr "``S`` (:class:`bytes`) [PyBytesObject \\*]" msgid "" "Requires that the Python object is a :class:`bytes` object, without " "attempting any conversion. Raises :exc:`TypeError` if the object is not a " -"bytes object. The C variable may also be declared as :c:type:`PyObject*`." +"bytes object. The C variable may also be declared as :c:expr:`PyObject*`." msgstr "" #: ../../c-api/arg.rst:137 @@ -252,7 +252,7 @@ msgstr "``Y`` (:class:`bytearray`) [PyByteArrayObject \\*]" msgid "" "Requires that the Python object is a :class:`bytearray` object, without " "attempting any conversion. Raises :exc:`TypeError` if the object is not a :" -"class:`bytearray` object. The C variable may also be declared as :c:type:" +"class:`bytearray` object. The C variable may also be declared as :c:expr:" "`PyObject*`." msgstr "" @@ -319,7 +319,7 @@ msgstr "``U`` (:class:`str`) [PyObject \\*]" msgid "" "Requires that the Python object is a Unicode object, without attempting any " "conversion. Raises :exc:`TypeError` if the object is not a Unicode object. " -"The C variable may also be declared as :c:type:`PyObject*`." +"The C variable may also be declared as :c:expr:`PyObject*`." msgstr "" #: ../../c-api/arg.rst:190 @@ -347,10 +347,10 @@ msgstr "" #: ../../c-api/arg.rst:196 msgid "" "This format requires two arguments. The first is only used as input, and " -"must be a :c:type:`const char*` which points to the name of an encoding as a " +"must be a :c:expr:`const char*` which points to the name of an encoding as a " "NUL-terminated string, or ``NULL``, in which case ``'utf-8'`` encoding is " "used. An exception is raised if the named encoding is not known to Python. " -"The second argument must be a :c:type:`char**`; the value of the pointer it " +"The second argument must be a :c:expr:`char**`; the value of the pointer it " "references will be set to a buffer with the contents of the argument text. " "The text will be encoded in the encoding specified by the first argument." msgstr "" @@ -392,10 +392,10 @@ msgstr "" #: ../../c-api/arg.rst:219 msgid "" "It requires three arguments. The first is only used as input, and must be " -"a :c:type:`const char*` which points to the name of an encoding as a NUL-" +"a :c:expr:`const char*` which points to the name of an encoding as a NUL-" "terminated string, or ``NULL``, in which case ``'utf-8'`` encoding is used. " "An exception is raised if the named encoding is not known to Python. The " -"second argument must be a :c:type:`char**`; the value of the pointer it " +"second argument must be a :c:expr:`char**`; the value of the pointer it " "references will be set to a buffer with the contents of the argument text. " "The text will be encoded in the encoding specified by the first argument. " "The third argument must be a pointer to an integer; the referenced integer " @@ -454,7 +454,7 @@ msgstr "``b`` (:class:`int`) [unsigned char]" #: ../../c-api/arg.rst:254 msgid "" "Convert a nonnegative Python integer to an unsigned tiny int, stored in a C :" -"c:type:`unsigned char`." +"c:expr:`unsigned char`." msgstr "" #: ../../c-api/arg.rst:259 ../../c-api/arg.rst:599 @@ -464,7 +464,7 @@ msgstr "``B`` (:class:`int`) [unsigned char]" #: ../../c-api/arg.rst:258 msgid "" "Convert a Python integer to a tiny int without overflow checking, stored in " -"a C :c:type:`unsigned char`." +"a C :c:expr:`unsigned char`." msgstr "" #: ../../c-api/arg.rst:262 ../../c-api/arg.rst:593 @@ -472,7 +472,7 @@ msgid "``h`` (:class:`int`) [short int]" msgstr "``h`` (:class:`int`) [short int]" #: ../../c-api/arg.rst:262 -msgid "Convert a Python integer to a C :c:type:`short int`." +msgid "Convert a Python integer to a C :c:expr:`short int`." msgstr "" #: ../../c-api/arg.rst:266 ../../c-api/arg.rst:602 @@ -480,17 +480,18 @@ msgid "``H`` (:class:`int`) [unsigned short int]" msgstr "``H`` (:class:`int`) [unsigned short int]" #: ../../c-api/arg.rst:265 +#, fuzzy msgid "" -"Convert a Python integer to a C :c:type:`unsigned short int`, without " +"Convert a Python integer to a C :c:expr:`unsigned short int`, without " "overflow checking." -msgstr "" +msgstr "將一個 C 的 :c:type:`unsigned short int` 轉換成 Python 整數物件。" #: ../../c-api/arg.rst:269 ../../c-api/arg.rst:587 msgid "``i`` (:class:`int`) [int]" msgstr "``i`` (:class:`int`) [int]" #: ../../c-api/arg.rst:269 -msgid "Convert a Python integer to a plain C :c:type:`int`." +msgid "Convert a Python integer to a plain C :c:expr:`int`." msgstr "" #: ../../c-api/arg.rst:273 ../../c-api/arg.rst:605 @@ -499,7 +500,7 @@ msgstr "``I`` (:class:`int`) [unsigned int]" #: ../../c-api/arg.rst:272 msgid "" -"Convert a Python integer to a C :c:type:`unsigned int`, without overflow " +"Convert a Python integer to a C :c:expr:`unsigned int`, without overflow " "checking." msgstr "" @@ -508,7 +509,7 @@ msgid "``l`` (:class:`int`) [long int]" msgstr "``l`` (:class:`int`) [long int]" #: ../../c-api/arg.rst:276 -msgid "Convert a Python integer to a C :c:type:`long int`." +msgid "Convert a Python integer to a C :c:expr:`long int`." msgstr "" #: ../../c-api/arg.rst:280 ../../c-api/arg.rst:608 @@ -517,7 +518,7 @@ msgstr "``k`` (:class:`int`) [unsigned long]" #: ../../c-api/arg.rst:279 msgid "" -"Convert a Python integer to a C :c:type:`unsigned long` without overflow " +"Convert a Python integer to a C :c:expr:`unsigned long` without overflow " "checking." msgstr "" @@ -526,7 +527,7 @@ msgid "``L`` (:class:`int`) [long long]" msgstr "``L`` (:class:`int`) [long long]" #: ../../c-api/arg.rst:283 -msgid "Convert a Python integer to a C :c:type:`long long`." +msgid "Convert a Python integer to a C :c:expr:`long long`." msgstr "" #: ../../c-api/arg.rst:287 ../../c-api/arg.rst:614 @@ -534,10 +535,11 @@ msgid "``K`` (:class:`int`) [unsigned long long]" msgstr "``K`` (:class:`int`) [unsigned long long]" #: ../../c-api/arg.rst:286 +#, fuzzy msgid "" -"Convert a Python integer to a C :c:type:`unsigned long long` without " +"Convert a Python integer to a C :c:expr:`unsigned long long` without " "overflow checking." -msgstr "" +msgstr "將一個 C 的 :c:type:`unsigned long long` 轉換成 Python 整數物件。" #: ../../c-api/arg.rst:290 ../../c-api/arg.rst:617 msgid "``n`` (:class:`int`) [:c:type:`Py_ssize_t`]" @@ -554,7 +556,7 @@ msgstr "``c``\\ (:class:`bytes` 或長度為 1 的 :class:`bytearray`)[char] #: ../../c-api/arg.rst:293 msgid "" "Convert a Python byte, represented as a :class:`bytes` or :class:`bytearray` " -"object of length 1, to a C :c:type:`char`." +"object of length 1, to a C :c:expr:`char`." msgstr "" #: ../../c-api/arg.rst:296 @@ -568,7 +570,7 @@ msgstr "``C``\\ (長度為 1 的 :class:`str`)[int]" #: ../../c-api/arg.rst:300 msgid "" "Convert a Python character, represented as a :class:`str` object of length " -"1, to a C :c:type:`int`." +"1, to a C :c:expr:`int`." msgstr "" #: ../../c-api/arg.rst:304 ../../c-api/arg.rst:631 @@ -576,16 +578,18 @@ msgid "``f`` (:class:`float`) [float]" msgstr "``f`` (:class:`float`) [float]" #: ../../c-api/arg.rst:304 -msgid "Convert a Python floating point number to a C :c:type:`float`." -msgstr "" +#, fuzzy +msgid "Convert a Python floating point number to a C :c:expr:`float`." +msgstr "將一個 C 的 :c:type:`float` 轉換成 Python 浮點數。" #: ../../c-api/arg.rst:307 ../../c-api/arg.rst:628 msgid "``d`` (:class:`float`) [double]" msgstr "``d`` (:class:`float`) [double]" #: ../../c-api/arg.rst:307 -msgid "Convert a Python floating point number to a C :c:type:`double`." -msgstr "" +#, fuzzy +msgid "Convert a Python floating point number to a C :c:expr:`double`." +msgstr "將一個 C 的 :c:type:`float` 轉換成 Python 浮點數。" #: ../../c-api/arg.rst:310 msgid "``D`` (:class:`complex`) [Py_complex]" @@ -618,7 +622,7 @@ msgstr "``O!``\\ (物件)[*typeobject*, PyObject \\*]" msgid "" "Store a Python object in a C object pointer. This is similar to ``O``, but " "takes two C arguments: the first is the address of a Python type object, the " -"second is the address of the C variable (of type :c:type:`PyObject*`) into " +"second is the address of the C variable (of type :c:expr:`PyObject*`) into " "which the object pointer is stored. If the Python object does not have the " "required type, :exc:`TypeError` is raised." msgstr "" @@ -631,18 +635,18 @@ msgstr "``O&``\\ (物件)[*converter*, *anything*]" msgid "" "Convert a Python object to a C variable through a *converter* function. " "This takes two arguments: the first is a function, the second is the address " -"of a C variable (of arbitrary type), converted to :c:type:`void *`. The " +"of a C variable (of arbitrary type), converted to :c:expr:`void *`. The " "*converter* function in turn is called as follows::" msgstr "" #: ../../c-api/arg.rst:337 msgid "" "where *object* is the Python object to be converted and *address* is the :c:" -"type:`void*` argument that was passed to the :c:func:`PyArg_Parse\\*` " -"function. The returned *status* should be ``1`` for a successful conversion " -"and ``0`` if the conversion has failed. When the conversion fails, the " -"*converter* function should raise an exception and leave the content of " -"*address* unmodified." +"expr:`void*` argument that was passed to the ``PyArg_Parse*`` function. The " +"returned *status* should be ``1`` for a successful conversion and ``0`` if " +"the conversion has failed. When the conversion fails, the *converter* " +"function should raise an exception and leave the content of *address* " +"unmodified." msgstr "" #: ../../c-api/arg.rst:343 @@ -763,12 +767,11 @@ msgstr "" #: ../../c-api/arg.rst:410 msgid "" "For the conversion to succeed, the *arg* object must match the format and " -"the format must be exhausted. On success, the :c:func:`PyArg_Parse\\*` " -"functions return true, otherwise they return false and raise an appropriate " -"exception. When the :c:func:`PyArg_Parse\\*` functions fail due to " -"conversion failure in one of the format units, the variables at the " -"addresses corresponding to that and the following format units are left " -"untouched." +"the format must be exhausted. On success, the ``PyArg_Parse*`` functions " +"return true, otherwise they return false and raise an appropriate exception. " +"When the ``PyArg_Parse*`` functions fail due to conversion failure in one of " +"the format units, the variables at the addresses corresponding to that and " +"the following format units are left untouched." msgstr "" #: ../../c-api/arg.rst:419 @@ -836,7 +839,7 @@ msgid "" "should be passed as *args*; it must actually be a tuple. The length of the " "tuple must be at least *min* and no more than *max*; *min* and *max* may be " "equal. Additional arguments must be passed to the function, each of which " -"should be a pointer to a :c:type:`PyObject*` variable; these will be filled " +"should be a pointer to a :c:expr:`PyObject*` variable; these will be filled " "in with the values from *args*; they will contain :term:`borrowed references " "`. The variables which correspond to optional parameters " "not given by *args* will not be filled in; these should be initialized by " @@ -863,10 +866,10 @@ msgstr "" #: ../../c-api/arg.rst:520 msgid "" -"Create a new value based on a format string similar to those accepted by " -"the :c:func:`PyArg_Parse\\*` family of functions and a sequence of values. " -"Returns the value or ``NULL`` in the case of an error; an exception will be " -"raised if ``NULL`` is returned." +"Create a new value based on a format string similar to those accepted by the " +"``PyArg_Parse*`` family of functions and a sequence of values. Returns the " +"value or ``NULL`` in the case of an error; an exception will be raised if " +"``NULL`` is returned." msgstr "" #: ../../c-api/arg.rst:525 @@ -967,7 +970,7 @@ msgstr "``u`` (:class:`str`) [const wchar_t \\*]" #: ../../c-api/arg.rst:571 msgid "" -"Convert a null-terminated :c:type:`wchar_t` buffer of Unicode (UTF-16 or " +"Convert a null-terminated :c:expr:`wchar_t` buffer of Unicode (UTF-16 or " "UCS-4) data to a Python Unicode object. If the Unicode buffer pointer is " "``NULL``, ``None`` is returned." msgstr "" @@ -994,7 +997,8 @@ msgstr "" "``U#``\\ (:class:`str` 或 ``None``)[const char \\*, :c:type:`Py_ssize_t`]" #: ../../c-api/arg.rst:587 -msgid "Convert a plain C :c:type:`int` to a Python integer object." +#, fuzzy +msgid "Convert a plain C :c:expr:`int` to a Python integer object." msgstr "將一個 C 的 :c:type:`int` 轉換成 Python 整數物件。" #: ../../c-api/arg.rst:590 @@ -1002,39 +1006,48 @@ msgid "``b`` (:class:`int`) [char]" msgstr "``b`` (:class:`int`) [char]" #: ../../c-api/arg.rst:590 -msgid "Convert a plain C :c:type:`char` to a Python integer object." +#, fuzzy +msgid "Convert a plain C :c:expr:`char` to a Python integer object." msgstr "將一個 C 的 :c:type:`char` 轉換成 Python 整數物件。" #: ../../c-api/arg.rst:593 -msgid "Convert a plain C :c:type:`short int` to a Python integer object." +#, fuzzy +msgid "Convert a plain C :c:expr:`short int` to a Python integer object." msgstr "將一個 C 的 :c:type:`short int` 轉換成 Python 整數物件。" #: ../../c-api/arg.rst:596 -msgid "Convert a C :c:type:`long int` to a Python integer object." +#, fuzzy +msgid "Convert a C :c:expr:`long int` to a Python integer object." msgstr "將一個 C 的 :c:type:`long int` 轉換成 Python 整數物件。" #: ../../c-api/arg.rst:599 -msgid "Convert a C :c:type:`unsigned char` to a Python integer object." +#, fuzzy +msgid "Convert a C :c:expr:`unsigned char` to a Python integer object." msgstr "將一個 C 的 :c:type:`unsigned char` 轉換成 Python 整數物件。" #: ../../c-api/arg.rst:602 -msgid "Convert a C :c:type:`unsigned short int` to a Python integer object." +#, fuzzy +msgid "Convert a C :c:expr:`unsigned short int` to a Python integer object." msgstr "將一個 C 的 :c:type:`unsigned short int` 轉換成 Python 整數物件。" #: ../../c-api/arg.rst:605 -msgid "Convert a C :c:type:`unsigned int` to a Python integer object." +#, fuzzy +msgid "Convert a C :c:expr:`unsigned int` to a Python integer object." msgstr "將一個 C 的 :c:type:`unsigned int` 轉換成 Python 整數物件。" #: ../../c-api/arg.rst:608 -msgid "Convert a C :c:type:`unsigned long` to a Python integer object." +#, fuzzy +msgid "Convert a C :c:expr:`unsigned long` to a Python integer object." msgstr "將一個 C 的 :c:type:`unsigned long` 轉換成 Python 整數物件。" #: ../../c-api/arg.rst:611 -msgid "Convert a C :c:type:`long long` to a Python integer object." +#, fuzzy +msgid "Convert a C :c:expr:`long long` to a Python integer object." msgstr "將一個 C 的 :c:type:`long long` 轉換成 Python 整數物件。" #: ../../c-api/arg.rst:614 -msgid "Convert a C :c:type:`unsigned long long` to a Python integer object." +#, fuzzy +msgid "Convert a C :c:expr:`unsigned long long` to a Python integer object." msgstr "將一個 C 的 :c:type:`unsigned long long` 轉換成 Python 整數物件。" #: ../../c-api/arg.rst:617 @@ -1046,23 +1059,27 @@ msgid "``c`` (:class:`bytes` of length 1) [char]" msgstr "``c``\\ (長度為 1 的 :class:`bytes`)[char]" #: ../../c-api/arg.rst:620 +#, fuzzy msgid "" -"Convert a C :c:type:`int` representing a byte to a Python :class:`bytes` " +"Convert a C :c:expr:`int` representing a byte to a Python :class:`bytes` " "object of length 1." -msgstr "" +msgstr "將一個 C 的 :c:type:`long int` 轉換成 Python 整數物件。" #: ../../c-api/arg.rst:624 +#, fuzzy msgid "" -"Convert a C :c:type:`int` representing a character to Python :class:`str` " +"Convert a C :c:expr:`int` representing a character to Python :class:`str` " "object of length 1." -msgstr "" +msgstr "將一個 C 的 :c:type:`unsigned char` 轉換成 Python 整數物件。" #: ../../c-api/arg.rst:628 -msgid "Convert a C :c:type:`double` to a Python floating point number." +#, fuzzy +msgid "Convert a C :c:expr:`double` to a Python floating point number." msgstr "將一個 C 的 :c:type:`double` 轉換成 Python 浮點數。" #: ../../c-api/arg.rst:631 -msgid "Convert a C :c:type:`float` to a Python floating point number." +#, fuzzy +msgid "Convert a C :c:expr:`float` to a Python floating point number." msgstr "將一個 C 的 :c:type:`float` 轉換成 Python 浮點數。" #: ../../c-api/arg.rst:634 @@ -1105,7 +1122,7 @@ msgstr "" #: ../../c-api/arg.rst:653 msgid "" "Convert *anything* to a Python object through a *converter* function. The " -"function is called with *anything* (which should be compatible with :c:type:" +"function is called with *anything* (which should be compatible with :c:expr:" "`void*`) as its argument and should return a \"new\" Python object, or " "``NULL`` if an error occurred." msgstr "" diff --git a/c-api/call.po b/c-api/call.po index 8c28f2476c..abb7fffb74 100644 --- a/c-api/call.po +++ b/c-api/call.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-06-11 14:46+0800\n" +"POT-Creation-Date: 2022-10-06 00:23+0000\n" "PO-Revision-Date: 2022-06-12 14:46+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -524,8 +524,9 @@ msgstr "" "提供任何引數。" #: ../../c-api/call.rst:278 +#, fuzzy msgid "" -"Note that if you only pass :c:type:`PyObject *` args, :c:func:" +"Note that if you only pass :c:expr:`PyObject *` args, :c:func:" "`PyObject_CallFunctionObjArgs` is a faster alternative." msgstr "" "注意,如果你只傳入 :c:type:`PyObject *` 引數,則 :c:func:" @@ -555,8 +556,9 @@ msgid "" msgstr "這等價於 Python 運算式 ``obj.name(arg1, arg2, ...)``。" #: ../../c-api/call.rst:299 +#, fuzzy msgid "" -"Note that if you only pass :c:type:`PyObject *` args, :c:func:" +"Note that if you only pass :c:expr:`PyObject *` args, :c:func:" "`PyObject_CallMethodObjArgs` is a faster alternative." msgstr "" "注意,如果你只傳入 :c:type:`PyObject *` 引數,則 :c:func:" @@ -567,8 +569,9 @@ msgid "The types of *name* and *format* were changed from ``char *``." msgstr "*name* 和 *format* 的型別已從 ``char *`` 更改。" #: ../../c-api/call.rst:308 +#, fuzzy msgid "" -"Call a callable Python object *callable*, with a variable number of :c:type:" +"Call a callable Python object *callable*, with a variable number of :c:expr:" "`PyObject *` arguments. The arguments are provided as a variable number of " "parameters followed by *NULL*." msgstr "" @@ -582,10 +585,11 @@ msgid "" msgstr "這等價於 Python 運算式 ``callable(arg1, arg2, ...)``。" #: ../../c-api/call.rst:321 +#, fuzzy msgid "" "Call a method of the Python object *obj*, where the name of the method is " "given as a Python string object in *name*. It is called with a variable " -"number of :c:type:`PyObject *` arguments. The arguments are provided as a " +"number of :c:expr:`PyObject *` arguments. The arguments are provided as a " "variable number of parameters followed by *NULL*." msgstr "" "呼叫 Python 物件 *obj* 中的一個 method,其中 method 名稱由 *name* 中的 " diff --git a/c-api/capsule.po b/c-api/capsule.po index 0390194f70..e03e401280 100644 --- a/c-api/capsule.po +++ b/c-api/capsule.po @@ -7,7 +7,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-10-06 00:23+0000\n" "PO-Revision-Date: 2018-05-23 14:30+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -30,7 +30,7 @@ msgstr "" #: ../../c-api/capsule.rst:17 msgid "" "This subtype of :c:type:`PyObject` represents an opaque value, useful for C " -"extension modules who need to pass an opaque value (as a :c:type:`void*` " +"extension modules who need to pass an opaque value (as a :c:expr:`void*` " "pointer) through Python code to other C code. It is often used to make a C " "function pointer defined in one module available to other modules, so the " "regular import mechanism can be used to access C APIs defined in dynamically " diff --git a/c-api/complex.po b/c-api/complex.po index a11d575ff2..9359dec58f 100644 --- a/c-api/complex.po +++ b/c-api/complex.po @@ -7,7 +7,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-10-06 00:23+0000\n" "PO-Revision-Date: 2015-12-09 17:51+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -135,11 +135,11 @@ msgid "Return a new :c:type:`PyComplexObject` object from *real* and *imag*." msgstr "" #: ../../c-api/complex.rst:118 -msgid "Return the real part of *op* as a C :c:type:`double`." +msgid "Return the real part of *op* as a C :c:expr:`double`." msgstr "" #: ../../c-api/complex.rst:123 -msgid "Return the imaginary part of *op* as a C :c:type:`double`." +msgid "Return the imaginary part of *op* as a C :c:expr:`double`." msgstr "" #: ../../c-api/complex.rst:128 diff --git a/c-api/conversion.po b/c-api/conversion.po index b4a6e64a18..c74e195c44 100644 --- a/c-api/conversion.po +++ b/c-api/conversion.po @@ -9,7 +9,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-10-06 00:23+0000\n" "PO-Revision-Date: 2017-09-22 18:26+0000\n" "Last-Translator: Leon H.\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -92,7 +92,7 @@ msgstr "" #: ../../c-api/conversion.rst:52 msgid "" -"Convert a string ``s`` to a :c:type:`double`, raising a Python exception on " +"Convert a string ``s`` to a :c:expr:`double`, raising a Python exception on " "failure. The set of accepted strings corresponds to the set of strings " "accepted by Python's :func:`float` constructor, except that ``s`` must not " "have leading or trailing whitespace. The conversion is independent of the " @@ -134,7 +134,7 @@ msgstr "" #: ../../c-api/conversion.rst:86 msgid "" -"Convert a :c:type:`double` *val* to a string using supplied *format_code*, " +"Convert a :c:expr:`double` *val* to a string using supplied *format_code*, " "*precision*, and *flags*." msgstr "" diff --git a/c-api/dict.po b/c-api/dict.po index d49ba98171..eb9f5d09e5 100644 --- a/c-api/dict.po +++ b/c-api/dict.po @@ -9,7 +9,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-10-06 00:23+0000\n" "PO-Revision-Date: 2017-09-22 18:26+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -91,7 +91,7 @@ msgstr "" #: ../../c-api/dict.rst:75 msgid "" "Insert *val* into the dictionary *p* using *key* as a key. *key* should be " -"a :c:type:`const char*`. The key object is created using " +"a :c:expr:`const char*`. The key object is created using " "``PyUnicode_FromString(key)``. Return ``0`` on success or ``-1`` on " "failure. This function *does not* steal a reference to *val*." msgstr "" @@ -139,7 +139,7 @@ msgstr "" #: ../../c-api/dict.rst:120 msgid "" "This is the same as :c:func:`PyDict_GetItem`, but *key* is specified as a :c:" -"type:`const char*`, rather than a :c:type:`PyObject*`." +"expr:`const char*`, rather than a :c:expr:`PyObject*`." msgstr "" #: ../../c-api/dict.rst:123 @@ -187,7 +187,7 @@ msgid "" "`Py_ssize_t` referred to by *ppos* must be initialized to ``0`` prior to the " "first call to this function to start the iteration; the function returns " "true for each pair in the dictionary, and false once all pairs have been " -"reported. The parameters *pkey* and *pvalue* should either point to :c:type:" +"reported. The parameters *pkey* and *pvalue* should either point to :c:expr:" "`PyObject*` variables that will be filled in with each key and value, " "respectively, or may be ``NULL``. Any references returned through them are " "borrowed. *ppos* should not be altered during iteration. Its value " diff --git a/c-api/exceptions.po b/c-api/exceptions.po index 82781475e8..c3c4c55851 100644 --- a/c-api/exceptions.po +++ b/c-api/exceptions.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-05 00:24+0000\n" +"POT-Creation-Date: 2022-10-06 00:23+0000\n" "PO-Revision-Date: 2018-05-23 14:05+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -32,8 +32,8 @@ msgid "" "occurred. Most C API functions don't clear this on success, but will set it " "to indicate the cause of the error on failure. Most C API functions also " "return an error indicator, usually ``NULL`` if they are supposed to return a " -"pointer, or ``-1`` if they return an integer (exception: the :c:func:`PyArg_" -"\\*` functions return ``1`` for success and ``0`` for failure)." +"pointer, or ``-1`` if they return an integer (exception: the ``PyArg_*`` " +"functions return ``1`` for success and ``0`` for failure)." msgstr "" #: ../../c-api/exceptions.rst:20 @@ -393,10 +393,10 @@ msgstr "" #: ../../c-api/exceptions.rst:372 msgid "" "Test whether the error indicator is set. If set, return the exception " -"*type* (the first argument to the last call to one of the :c:func:`PyErr_Set" -"\\*` functions or to :c:func:`PyErr_Restore`). If not set, return " -"``NULL``. You do not own a reference to the return value, so you do not " -"need to :c:func:`Py_DECREF` it." +"*type* (the first argument to the last call to one of the ``PyErr_Set*`` " +"functions or to :c:func:`PyErr_Restore`). If not set, return ``NULL``. You " +"do not own a reference to the return value, so you do not need to :c:func:" +"`Py_DECREF` it." msgstr "" #: ../../c-api/exceptions.rst:378 @@ -884,7 +884,7 @@ msgstr "" msgid "" "All standard Python exceptions are available as global variables whose names " "are ``PyExc_`` followed by the Python exception name. These have the type :" -"c:type:`PyObject*`; they are all class objects. For completeness, here are " +"c:expr:`PyObject*`; they are all class objects. For completeness, here are " "all the variables:" msgstr "" @@ -1407,7 +1407,7 @@ msgstr "" msgid "" "All standard Python warning categories are available as global variables " "whose names are ``PyExc_`` followed by the Python exception name. These have " -"the type :c:type:`PyObject*`; they are all class objects. For completeness, " +"the type :c:expr:`PyObject*`; they are all class objects. For completeness, " "here are all the variables:" msgstr "" diff --git a/c-api/file.po b/c-api/file.po index 1c1145cb85..e222ecc5ec 100644 --- a/c-api/file.po +++ b/c-api/file.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-05 06:54+0000\n" +"POT-Creation-Date: 2022-10-06 00:23+0000\n" "PO-Revision-Date: 2017-09-22 18:26+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -59,7 +59,7 @@ msgstr "忽略 *name* 屬性。" #: ../../c-api/file.rst:41 msgid "" -"Return the file descriptor associated with *p* as an :c:type:`int`. If the " +"Return the file descriptor associated with *p* as an :c:expr:`int`. If the " "object is an integer, its value is returned. If not, the object's :meth:" "`~io.IOBase.fileno` method is called if it exists; the method must return an " "integer, which is returned as the file descriptor value. Sets an exception " @@ -87,7 +87,7 @@ msgstr "" #: ../../c-api/file.rst:68 msgid "" -"The handler is a function of type :c:type:`PyObject *(\\*)(PyObject *path, " +"The handler is a function of type :c:expr:`PyObject *(\\*)(PyObject *path, " "void *userData)`, where *path* is guaranteed to be :c:type:`PyUnicodeObject`." msgstr "" diff --git a/c-api/float.po b/c-api/float.po index 980f541cdd..33239513a8 100644 --- a/c-api/float.po +++ b/c-api/float.po @@ -9,7 +9,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-10-06 00:23+0000\n" "PO-Revision-Date: 2017-09-22 18:26+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -60,7 +60,7 @@ msgstr "" #: ../../c-api/float.rst:47 msgid "" -"Return a C :c:type:`double` representation of the contents of *pyfloat*. If " +"Return a C :c:expr:`double` representation of the contents of *pyfloat*. If " "*pyfloat* is not a Python floating point object but has a :meth:`__float__` " "method, this method will first be called to convert *pyfloat* into a float. " "If ``__float__()`` is not defined then it falls back to :meth:`__index__`. " @@ -74,7 +74,7 @@ msgstr "" #: ../../c-api/float.rst:60 msgid "" -"Return a C :c:type:`double` representation of the contents of *pyfloat*, but " +"Return a C :c:expr:`double` representation of the contents of *pyfloat*, but " "without error checking." msgstr "" @@ -87,11 +87,11 @@ msgstr "" #: ../../c-api/float.rst:73 msgid "" -"Return the maximum representable finite float *DBL_MAX* as C :c:type:" +"Return the maximum representable finite float *DBL_MAX* as C :c:expr:" "`double`." msgstr "" #: ../../c-api/float.rst:78 msgid "" -"Return the minimum normalized positive float *DBL_MIN* as C :c:type:`double`." +"Return the minimum normalized positive float *DBL_MIN* as C :c:expr:`double`." msgstr "" diff --git a/c-api/import.po b/c-api/import.po index 059a61cddb..9e8e1cf89e 100644 --- a/c-api/import.po +++ b/c-api/import.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-10-06 00:23+0000\n" "PO-Revision-Date: 2018-05-23 14:06+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -277,7 +277,7 @@ msgstr "" #: ../../c-api/import.rst:264 msgid "" -"This pointer is initialized to point to an array of :c:type:`struct _frozen` " +"This pointer is initialized to point to an array of :c:struct:`_frozen` " "records, terminated by one whose members are all ``NULL`` or zero. When a " "frozen module is imported, it is searched in this table. Third-party code " "could play tricks with this to provide a dynamically created collection of " diff --git a/c-api/init.po b/c-api/init.po index 270df1e369..682523f429 100644 --- a/c-api/init.po +++ b/c-api/init.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-05 06:54+0000\n" +"POT-Creation-Date: 2022-10-06 00:23+0000\n" "PO-Revision-Date: 2018-05-23 14:06+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -534,7 +534,7 @@ msgstr "" #: ../../c-api/init.rst:367 ../../c-api/init.rst:511 ../../c-api/init.rst:617 #: ../../c-api/init.rst:644 ../../c-api/init.rst:661 msgid "" -"Use :c:func:`Py_DecodeLocale` to decode a bytes string to get a :c:type:" +"Use :c:func:`Py_DecodeLocale` to decode a bytes string to get a :c:expr:" "`wchar_*` string." msgstr "" @@ -924,11 +924,11 @@ msgstr "" #: ../../c-api/init.rst:803 msgid "" -"Note that the :c:func:`PyGILState_\\*` functions assume there is only one " -"global interpreter (created automatically by :c:func:`Py_Initialize`). " -"Python supports the creation of additional interpreters (using :c:func:" -"`Py_NewInterpreter`), but mixing multiple interpreters and the :c:func:" -"`PyGILState_\\*` API is unsupported." +"Note that the ``PyGILState_*`` functions assume there is only one global " +"interpreter (created automatically by :c:func:`Py_Initialize`). Python " +"supports the creation of additional interpreters (using :c:func:" +"`Py_NewInterpreter`), but mixing multiple interpreters and the " +"``PyGILState_*`` API is unsupported." msgstr "" #: ../../c-api/init.rst:813 @@ -1374,7 +1374,7 @@ msgstr "" #: ../../c-api/init.rst:1223 msgid "" -"The type of the *id* parameter changed from :c:type:`long` to :c:type:" +"The type of the *id* parameter changed from :c:expr:`long` to :c:expr:" "`unsigned long`." msgstr "" @@ -1568,10 +1568,10 @@ msgstr "" #: ../../c-api/init.rst:1411 msgid "" -"Also note that combining this functionality with :c:func:`PyGILState_\\*` " -"APIs is delicate, because these APIs assume a bijection between Python " -"thread states and OS-level threads, an assumption broken by the presence of " -"sub-interpreters. It is highly recommended that you don't switch sub-" +"Also note that combining this functionality with ``PyGILState_*`` APIs is " +"delicate, because these APIs assume a bijection between Python thread states " +"and OS-level threads, an assumption broken by the presence of sub-" +"interpreters. It is highly recommended that you don't switch sub-" "interpreters between a pair of matching :c:func:`PyGILState_Ensure` and :c:" "func:`PyGILState_Release` calls. Furthermore, extensions (such as :mod:" "`ctypes`) using these APIs to allow calling of Python code from non-Python " @@ -1877,7 +1877,7 @@ msgid "" "(TLS) which wraps the underlying native TLS implementation to support the " "Python-level thread local storage API (:class:`threading.local`). The " "CPython C level APIs are similar to those offered by pthreads and Windows: " -"use a thread key and functions to associate a :c:type:`void*` value per " +"use a thread key and functions to associate a :c:expr:`void*` value per " "thread." msgstr "" @@ -1896,8 +1896,8 @@ msgstr "" #: ../../c-api/init.rst:1669 msgid "" "None of these API functions handle memory management on behalf of the :c:" -"type:`void*` values. You need to allocate and deallocate them yourself. If " -"the :c:type:`void*` values happen to be :c:type:`PyObject*`, these functions " +"expr:`void*` values. You need to allocate and deallocate them yourself. If " +"the :c:expr:`void*` values happen to be :c:expr:`PyObject*`, these functions " "don't do refcount operations on them either." msgstr "" @@ -1909,7 +1909,7 @@ msgstr "" msgid "" "TSS API is introduced to supersede the use of the existing TLS API within " "the CPython interpreter. This API uses a new type :c:type:`Py_tss_t` " -"instead of :c:type:`int` to represent thread keys." +"instead of :c:expr:`int` to represent thread keys." msgstr "" #: ../../c-api/init.rst:1685 @@ -2003,14 +2003,14 @@ msgstr "" #: ../../c-api/init.rst:1767 msgid "" -"Return a zero value to indicate successfully associating a :c:type:`void*` " +"Return a zero value to indicate successfully associating a :c:expr:`void*` " "value with a TSS key in the current thread. Each thread has a distinct " -"mapping of the key to a :c:type:`void*` value." +"mapping of the key to a :c:expr:`void*` value." msgstr "" #: ../../c-api/init.rst:1774 msgid "" -"Return the :c:type:`void*` value associated with a TSS key in the current " +"Return the :c:expr:`void*` value associated with a TSS key in the current " "thread. This returns ``NULL`` if no value is associated with the key in the " "current thread." msgstr "" diff --git a/c-api/intro.po b/c-api/intro.po index 9b48ef67cd..752d8cbd21 100644 --- a/c-api/intro.po +++ b/c-api/intro.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-06 00:23+0000\n" "PO-Revision-Date: 2018-05-23 14:06+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -272,13 +272,13 @@ msgstr "" #: ../../c-api/intro.rst:231 msgid "" "Most Python/C API functions have one or more arguments as well as a return " -"value of type :c:type:`PyObject*`. This type is a pointer to an opaque data " +"value of type :c:expr:`PyObject*`. This type is a pointer to an opaque data " "type representing an arbitrary Python object. Since all Python object types " "are treated the same way by the Python language in most situations (e.g., " "assignments, scope rules, and argument passing), it is only fitting that " "they should be represented by a single C type. Almost all Python objects " "live on the heap: you never declare an automatic or static variable of type :" -"c:type:`PyObject`, only pointer variables of type :c:type:`PyObject*` can " +"c:type:`PyObject`, only pointer variables of type :c:expr:`PyObject*` can " "be declared. The sole exception are the type objects; since these must " "never be deallocated, they are typically static :c:type:`PyTypeObject` " "objects." @@ -491,8 +491,8 @@ msgstr "" #: ../../c-api/intro.rst:497 msgid "" "There are few other data types that play a significant role in the Python/C " -"API; most are simple C types such as :c:type:`int`, :c:type:`long`, :c:type:" -"`double` and :c:type:`char*`. A few structure types are used to describe " +"API; most are simple C types such as :c:expr:`int`, :c:expr:`long`, :c:expr:" +"`double` and :c:expr:`char*`. A few structure types are used to describe " "static tables used to list the functions exported by a module or the data " "attributes of a new object type, and another is used to describe the value " "of a complex number. These will be discussed together with the functions " diff --git a/c-api/long.po b/c-api/long.po index f9c70accb6..237617d3f1 100644 --- a/c-api/long.po +++ b/c-api/long.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-04-03 00:14+0000\n" +"POT-Creation-Date: 2022-10-06 00:23+0000\n" "PO-Revision-Date: 2018-05-23 14:06+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -71,7 +71,7 @@ msgstr "" #: ../../c-api/long.rst:50 msgid "" -"Return a new :c:type:`PyLongObject` object from a C :c:type:`unsigned long`, " +"Return a new :c:type:`PyLongObject` object from a C :c:expr:`unsigned long`, " "or ``NULL`` on failure." msgstr "" @@ -89,13 +89,13 @@ msgstr "" #: ../../c-api/long.rst:68 msgid "" -"Return a new :c:type:`PyLongObject` object from a C :c:type:`long long`, or " +"Return a new :c:type:`PyLongObject` object from a C :c:expr:`long long`, or " "``NULL`` on failure." msgstr "" #: ../../c-api/long.rst:74 msgid "" -"Return a new :c:type:`PyLongObject` object from a C :c:type:`unsigned long " +"Return a new :c:type:`PyLongObject` object from a C :c:expr:`unsigned long " "long`, or ``NULL`` on failure." msgstr "" @@ -132,7 +132,7 @@ msgstr "" #: ../../c-api/long.rst:118 ../../c-api/long.rst:136 msgid "" -"Return a C :c:type:`long` representation of *obj*. If *obj* is not an " +"Return a C :c:expr:`long` representation of *obj*. If *obj* is not an " "instance of :c:type:`PyLongObject`, first call its :meth:`__index__` method " "(if present) to convert it to a :c:type:`PyLongObject`." msgstr "" @@ -140,7 +140,7 @@ msgstr "" #: ../../c-api/long.rst:122 msgid "" "Raise :exc:`OverflowError` if the value of *obj* is out of range for a :c:" -"type:`long`." +"expr:`long`." msgstr "" #: ../../c-api/long.rst:125 ../../c-api/long.rst:145 ../../c-api/long.rst:166 @@ -168,7 +168,7 @@ msgstr "" #: ../../c-api/long.rst:159 ../../c-api/long.rst:177 msgid "" -"Return a C :c:type:`long long` representation of *obj*. If *obj* is not an " +"Return a C :c:expr:`long long` representation of *obj*. If *obj* is not an " "instance of :c:type:`PyLongObject`, first call its :meth:`__index__` method " "(if present) to convert it to a :c:type:`PyLongObject`." msgstr "" @@ -176,7 +176,7 @@ msgstr "" #: ../../c-api/long.rst:163 msgid "" "Raise :exc:`OverflowError` if the value of *obj* is out of range for a :c:" -"type:`long long`." +"expr:`long long`." msgstr "" #: ../../c-api/long.rst:181 @@ -201,14 +201,14 @@ msgstr "" #: ../../c-api/long.rst:218 msgid "" -"Return a C :c:type:`unsigned long` representation of *pylong*. *pylong* " +"Return a C :c:expr:`unsigned long` representation of *pylong*. *pylong* " "must be an instance of :c:type:`PyLongObject`." msgstr "" #: ../../c-api/long.rst:221 msgid "" "Raise :exc:`OverflowError` if the value of *pylong* is out of range for a :c:" -"type:`unsigned long`." +"expr:`unsigned long`." msgstr "" #: ../../c-api/long.rst:224 @@ -237,14 +237,14 @@ msgstr "" #: ../../c-api/long.rst:249 msgid "" -"Return a C :c:type:`unsigned long long` representation of *pylong*. " +"Return a C :c:expr:`unsigned long long` representation of *pylong*. " "*pylong* must be an instance of :c:type:`PyLongObject`." msgstr "" #: ../../c-api/long.rst:252 msgid "" "Raise :exc:`OverflowError` if the value of *pylong* is out of range for an :" -"c:type:`unsigned long long`." +"c:expr:`unsigned long long`." msgstr "" #: ../../c-api/long.rst:255 @@ -260,14 +260,14 @@ msgstr "" #: ../../c-api/long.rst:264 msgid "" -"Return a C :c:type:`unsigned long` representation of *obj*. If *obj* is not " +"Return a C :c:expr:`unsigned long` representation of *obj*. If *obj* is not " "an instance of :c:type:`PyLongObject`, first call its :meth:`__index__` " "method (if present) to convert it to a :c:type:`PyLongObject`." msgstr "" #: ../../c-api/long.rst:268 msgid "" -"If the value of *obj* is out of range for an :c:type:`unsigned long`, return " +"If the value of *obj* is out of range for an :c:expr:`unsigned long`, return " "the reduction of that value modulo ``ULONG_MAX + 1``." msgstr "" @@ -279,14 +279,14 @@ msgstr "" #: ../../c-api/long.rst:283 msgid "" -"Return a C :c:type:`unsigned long long` representation of *obj*. If *obj* " +"Return a C :c:expr:`unsigned long long` representation of *obj*. If *obj* " "is not an instance of :c:type:`PyLongObject`, first call its :meth:" "`__index__` method (if present) to convert it to a :c:type:`PyLongObject`." msgstr "" #: ../../c-api/long.rst:288 msgid "" -"If the value of *obj* is out of range for an :c:type:`unsigned long long`, " +"If the value of *obj* is out of range for an :c:expr:`unsigned long long`, " "return the reduction of that value modulo ``ULLONG_MAX + 1``." msgstr "" @@ -298,14 +298,14 @@ msgstr "" #: ../../c-api/long.rst:303 msgid "" -"Return a C :c:type:`double` representation of *pylong*. *pylong* must be an " +"Return a C :c:expr:`double` representation of *pylong*. *pylong* must be an " "instance of :c:type:`PyLongObject`." msgstr "" #: ../../c-api/long.rst:306 msgid "" "Raise :exc:`OverflowError` if the value of *pylong* is out of range for a :c:" -"type:`double`." +"expr:`double`." msgstr "" #: ../../c-api/long.rst:309 @@ -315,9 +315,9 @@ msgstr "" #: ../../c-api/long.rst:314 msgid "" -"Convert a Python integer *pylong* to a C :c:type:`void` pointer. If *pylong* " +"Convert a Python integer *pylong* to a C :c:expr:`void` pointer. If *pylong* " "cannot be converted, an :exc:`OverflowError` will be raised. This is only " -"assured to produce a usable :c:type:`void` pointer for values created with :" +"assured to produce a usable :c:expr:`void` pointer for values created with :" "c:func:`PyLong_FromVoidPtr`." msgstr "" diff --git a/c-api/marshal.po b/c-api/marshal.po index 55aff8f24e..a1d1bc810b 100644 --- a/c-api/marshal.po +++ b/c-api/marshal.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-05 06:54+0000\n" +"POT-Creation-Date: 2022-10-06 00:23+0000\n" "PO-Revision-Date: 2018-05-23 14:06+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -45,9 +45,9 @@ msgstr "" #: ../../c-api/marshal.rst:24 msgid "" -"Marshal a :c:type:`long` integer, *value*, to *file*. This will only write " +"Marshal a :c:expr:`long` integer, *value*, to *file*. This will only write " "the least-significant 32 bits of *value*; regardless of the size of the " -"native :c:type:`long` type. *version* indicates the file format." +"native :c:expr:`long` type. *version* indicates the file format." msgstr "" #: ../../c-api/marshal.rst:31 @@ -68,9 +68,9 @@ msgstr "" #: ../../c-api/marshal.rst:46 msgid "" -"Return a C :c:type:`long` from the data stream in a :c:expr:`FILE*` opened " +"Return a C :c:expr:`long` from the data stream in a :c:expr:`FILE*` opened " "for reading. Only a 32-bit value can be read in using this function, " -"regardless of the native size of :c:type:`long`." +"regardless of the native size of :c:expr:`long`." msgstr "" #: ../../c-api/marshal.rst:50 ../../c-api/marshal.rst:60 @@ -81,9 +81,9 @@ msgstr "" #: ../../c-api/marshal.rst:56 msgid "" -"Return a C :c:type:`short` from the data stream in a :c:expr:`FILE*` opened " +"Return a C :c:expr:`short` from the data stream in a :c:expr:`FILE*` opened " "for reading. Only a 16-bit value can be read in using this function, " -"regardless of the native size of :c:type:`short`." +"regardless of the native size of :c:expr:`short`." msgstr "" #: ../../c-api/marshal.rst:66 diff --git a/c-api/memory.po b/c-api/memory.po index 9416eab56f..3c6b0a9a8c 100644 --- a/c-api/memory.po +++ b/c-api/memory.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-05 06:54+0000\n" +"POT-Creation-Date: 2022-10-06 00:23+0000\n" "PO-Revision-Date: 2018-05-23 14:06+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -185,7 +185,7 @@ msgstr "" #: ../../c-api/memory.rst:144 ../../c-api/memory.rst:215 #: ../../c-api/memory.rst:323 msgid "" -"Allocates *n* bytes and returns a pointer of type :c:type:`void*` to the " +"Allocates *n* bytes and returns a pointer of type :c:expr:`void*` to the " "allocated memory, or ``NULL`` if the request fails." msgstr "" @@ -200,7 +200,7 @@ msgstr "" #: ../../c-api/memory.rst:333 msgid "" "Allocates *nelem* elements each whose size in bytes is *elsize* and returns " -"a pointer of type :c:type:`void*` to the allocated memory, or ``NULL`` if " +"a pointer of type :c:expr:`void*` to the allocated memory, or ``NULL`` if " "the request fails. The memory is initialized to zeros." msgstr "" diff --git a/c-api/module.po b/c-api/module.po index eca2750914..31a2ffa0af 100644 --- a/c-api/module.po +++ b/c-api/module.po @@ -8,7 +8,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-10-06 00:23+0000\n" "PO-Revision-Date: 2018-05-23 14:32+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -70,9 +70,9 @@ msgstr "" #: ../../c-api/module.rst:67 msgid "" -"It is recommended extensions use other :c:func:`PyModule_\\*` and :c:func:" -"`PyObject_\\*` functions rather than directly manipulate a module's :attr:" -"`~object.__dict__`." +"It is recommended extensions use other ``PyModule_*`` and ``PyObject_*`` " +"functions rather than directly manipulate a module's :attr:`~object." +"__dict__`." msgstr "" #: ../../c-api/module.rst:78 diff --git a/c-api/object.po b/c-api/object.po index a25868164f..28d5a8354f 100644 --- a/c-api/object.po +++ b/c-api/object.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-10-06 00:23+0000\n" "PO-Revision-Date: 2018-05-23 14:32+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -302,7 +302,7 @@ msgid "" "``NULL``. This is equivalent to the Python expression ``type(o)``. This " "function increments the reference count of the return value. There's really " "no reason to use this function instead of the :c:func:`Py_TYPE()` function, " -"which returns a pointer of type :c:type:`PyTypeObject*`, except when the " +"which returns a pointer of type :c:expr:`PyTypeObject*`, except when the " "incremented reference count is needed." msgstr "" diff --git a/c-api/structures.po b/c-api/structures.po index 462c781948..933dc57267 100644 --- a/c-api/structures.po +++ b/c-api/structures.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-06-11 00:15+0000\n" +"POT-Creation-Date: 2022-10-06 00:23+0000\n" "PO-Revision-Date: 2018-05-23 14:07+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -50,7 +50,7 @@ msgid "" "In a normal \"release\" build, it contains only the object's reference count " "and a pointer to the corresponding type object. Nothing is actually declared " "to be a :c:type:`PyObject`, but every pointer to a Python object can be cast " -"to a :c:type:`PyObject*`. Access to the members must be done by using the " +"to a :c:expr:`PyObject*`. Access to the members must be done by using the " "macros :c:macro:`Py_REFCNT` and :c:macro:`Py_TYPE`." msgstr "" @@ -116,7 +116,7 @@ msgid "Return a :term:`borrowed reference`." msgstr "" #: ../../c-api/structures.rst:102 -msgid "The :c:func:`Py_SET_TYPE` function must be used to set an object type." +msgid "Use the :c:func:`Py_SET_TYPE` function to set an object type." msgstr "" #: ../../c-api/structures.rst:107 @@ -148,7 +148,7 @@ msgid "Get the size of the Python object *o*." msgstr "" #: ../../c-api/structures.rst:140 -msgid "The :c:func:`Py_SET_SIZE` function must be used to set an object size." +msgid "Use the :c:func:`Py_SET_SIZE` function to set an object size." msgstr "" #: ../../c-api/structures.rst:145 @@ -175,7 +175,7 @@ msgstr "" #: ../../c-api/structures.rst:174 msgid "" "Type of the functions used to implement most Python callables in C. " -"Functions of this type take two :c:type:`PyObject*` parameters and return " +"Functions of this type take two :c:expr:`PyObject*` parameters and return " "one such value. If the return value is ``NULL``, an exception shall have " "been set. If not ``NULL``, the return value is interpreted as the return " "value of the function as exposed in Python. The function must return a new " @@ -283,10 +283,10 @@ msgstr "" #: ../../c-api/structures.rst:253 msgid "" "The :attr:`ml_meth` is a C function pointer. The functions may be of " -"different types, but they always return :c:type:`PyObject*`. If the " +"different types, but they always return :c:expr:`PyObject*`. If the " "function is not of the :c:type:`PyCFunction`, the compiler will require a " "cast in the method table. Even though :c:type:`PyCFunction` defines the " -"first parameter as :c:type:`PyObject*`, it is common that the method " +"first parameter as :c:expr:`PyObject*`, it is common that the method " "implementation uses the specific C type of the *self* object." msgstr "" @@ -304,7 +304,7 @@ msgstr "" #: ../../c-api/structures.rst:268 msgid "" "This is the typical calling convention, where the methods have the type :c:" -"type:`PyCFunction`. The function expects two :c:type:`PyObject*` values. The " +"type:`PyCFunction`. The function expects two :c:expr:`PyObject*` values. The " "first one is the *self* object for methods; for module functions, it is the " "module object. The second parameter (often called *args*) is a tuple object " "representing all arguments. This parameter is typically processed using :c:" @@ -324,7 +324,7 @@ msgstr "" msgid "" "Fast calling convention supporting only positional arguments. The methods " "have the type :c:type:`_PyCFunctionFast`. The first parameter is *self*, the " -"second parameter is a C array of :c:type:`PyObject*` values indicating the " +"second parameter is a C array of :c:expr:`PyObject*` values indicating the " "arguments and the third parameter is the number of arguments (the length of " "the array)." msgstr "" @@ -338,7 +338,7 @@ msgid "" "Extension of :const:`METH_FASTCALL` supporting also keyword arguments, with " "methods of type :c:type:`_PyCFunctionFastWithKeywords`. Keyword arguments " "are passed the same way as in the :ref:`vectorcall protocol `: " -"there is an additional fourth :c:type:`PyObject*` parameter which is a tuple " +"there is an additional fourth :c:expr:`PyObject*` parameter which is a tuple " "representing the names of the keyword arguments (which are guaranteed to be " "strings) or possibly ``NULL`` if there are no keywords. The values of the " "keyword arguments are stored in the *args* array, after the positional " @@ -373,7 +373,7 @@ msgid "" "Methods with a single object argument can be listed with the :const:`METH_O` " "flag, instead of invoking :c:func:`PyArg_ParseTuple` with a ``\"O\"`` " "argument. They have the type :c:type:`PyCFunction`, with the *self* " -"parameter, and a :c:type:`PyObject*` parameter representing the single " +"parameter, and a :c:expr:`PyObject*` parameter representing the single " "argument." msgstr "" @@ -711,7 +711,7 @@ msgstr "" #: ../../c-api/structures.rst:508 msgid "" -"The ``get`` function takes one :c:type:`PyObject*` parameter (the instance) " +"The ``get`` function takes one :c:expr:`PyObject*` parameter (the instance) " "and a function pointer (the associated ``closure``)::" msgstr "" @@ -723,7 +723,7 @@ msgstr "" #: ../../c-api/structures.rst:516 msgid "" -"``set`` functions take two :c:type:`PyObject*` parameters (the instance and " +"``set`` functions take two :c:expr:`PyObject*` parameters (the instance and " "the value to be set) and a function pointer (the associated ``closure``)::" msgstr "" diff --git a/c-api/sys.po b/c-api/sys.po index 7fcc3aae56..da93c03764 100644 --- a/c-api/sys.po +++ b/c-api/sys.po @@ -10,7 +10,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-10-06 00:23+0000\n" "PO-Revision-Date: 2018-05-23 14:07+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -125,7 +125,7 @@ msgid "" "Return the current signal handler for signal *i*. This is a thin wrapper " "around either :c:func:`sigaction` or :c:func:`signal`. Do not call those " "functions directly! :c:type:`PyOS_sighandler_t` is a typedef alias for :c:" -"type:`void (\\*)(int)`." +"expr:`void (\\*)(int)`." msgstr "" #: ../../c-api/sys.rst:114 @@ -133,7 +133,7 @@ msgid "" "Set the signal handler for signal *i* to be *h*; return the old signal " "handler. This is a thin wrapper around either :c:func:`sigaction` or :c:func:" "`signal`. Do not call those functions directly! :c:type:" -"`PyOS_sighandler_t` is a typedef alias for :c:type:`void (\\*)(int)`." +"`PyOS_sighandler_t` is a typedef alias for :c:expr:`void (\\*)(int)`." msgstr "" #: ../../c-api/sys.rst:122 @@ -419,7 +419,7 @@ msgstr "" #: ../../c-api/sys.rst:355 msgid "" -"The hook function is of type :c:type:`int (*)(const char *event, PyObject " +"The hook function is of type :c:expr:`int (*)(const char *event, PyObject " "*args, void *userData)`, where *args* is guaranteed to be a :c:type:" "`PyTupleObject`. The hook function is always called with the GIL held by the " "Python interpreter that raised the event." diff --git a/c-api/tuple.po b/c-api/tuple.po index 74d4c705b5..5db48ba6ff 100644 --- a/c-api/tuple.po +++ b/c-api/tuple.po @@ -8,7 +8,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-10-06 00:23+0000\n" "PO-Revision-Date: 2017-09-22 18:26+0000\n" "Last-Translator: Leon H.\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -219,7 +219,7 @@ msgstr "" #: ../../c-api/tuple.rst:163 msgid "" "Describes a field of a struct sequence. As a struct sequence is modeled as a " -"tuple, all fields are typed as :c:type:`PyObject*`. The index in the :attr:" +"tuple, all fields are typed as :c:expr:`PyObject*`. The index in the :attr:" "`fields` array of the :c:type:`PyStructSequence_Desc` determines which field " "of the struct sequence is described." msgstr "" diff --git a/c-api/typehints.po b/c-api/typehints.po index 2a4333a58e..79187f998a 100644 --- a/c-api/typehints.po +++ b/c-api/typehints.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-05 00:24+0000\n" +"POT-Creation-Date: 2022-10-06 00:23+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-" @@ -34,7 +34,7 @@ msgid "" "Create a :ref:`GenericAlias ` object. Equivalent to " "calling the Python class :class:`types.GenericAlias`. The *origin* and " "*args* arguments set the ``GenericAlias``\\ 's ``__origin__`` and " -"``__args__`` attributes respectively. *origin* should be a :c:type:" +"``__args__`` attributes respectively. *origin* should be a :c:expr:" "`PyTypeObject*`, and *args* can be a :c:expr:`PyTupleObject*` or any " "``PyObject*``. If *args* passed is not a tuple, a 1-tuple is automatically " "constructed and ``__args__`` is set to ``(args,)``. Minimal checking is done " diff --git a/c-api/typeobj.po b/c-api/typeobj.po index 18252be2be..cd010b9564 100644 --- a/c-api/typeobj.po +++ b/c-api/typeobj.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-05 06:54+0000\n" +"POT-Creation-Date: 2022-10-06 00:23+0000\n" "PO-Revision-Date: 2018-05-23 14:33+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -26,11 +26,11 @@ msgstr "" msgid "" "Perhaps one of the most important structures of the Python object system is " "the structure that defines a new type: the :c:type:`PyTypeObject` " -"structure. Type objects can be handled using any of the :c:func:`PyObject_" -"\\*` or :c:func:`PyType_\\*` functions, but do not offer much that's " -"interesting to most Python applications. These objects are fundamental to " -"how objects behave, so they are very important to the interpreter itself and " -"to any extension module that implements new types." +"structure. Type objects can be handled using any of the ``PyObject_*`` or " +"``PyType_*`` functions, but do not offer much that's interesting to most " +"Python applications. These objects are fundamental to how objects behave, so " +"they are very important to the interpreter itself and to any extension " +"module that implements new types." msgstr "" #: ../../c-api/typeobj.rst:16 @@ -2315,8 +2315,8 @@ msgid "" "If the instances of this type are weakly referenceable, this field is " "greater than zero and contains the offset in the instance structure of the " "weak reference list head (ignoring the GC header, if present); this offset " -"is used by :c:func:`PyObject_ClearWeakRefs` and the :c:func:`PyWeakref_\\*` " -"functions. The instance structure needs to include a field of type :c:type:" +"is used by :c:func:`PyObject_ClearWeakRefs` and the ``PyWeakref_*`` " +"functions. The instance structure needs to include a field of type :c:expr:" "`PyObject*` which is initialized to ``NULL``." msgstr "" diff --git a/c-api/unicode.po b/c-api/unicode.po index a9f664fccf..f804d74fc7 100644 --- a/c-api/unicode.po +++ b/c-api/unicode.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-05 00:24+0000\n" +"POT-Creation-Date: 2022-10-06 00:23+0000\n" "PO-Revision-Date: 2018-05-23 14:08+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -92,7 +92,7 @@ msgstr "" #: ../../c-api/unicode.rst:61 msgid "" -"This is a typedef of :c:type:`wchar_t`, which is a 16-bit type or 32-bit " +"This is a typedef of :c:expr:`wchar_t`, which is a 16-bit type or 32-bit " "type depending on the platform." msgstr "" @@ -1123,26 +1123,26 @@ msgid "wchar_t Support" msgstr "" #: ../../c-api/unicode.rst:942 -msgid ":c:type:`wchar_t` support for platforms which support it:" +msgid ":c:expr:`wchar_t` support for platforms which support it:" msgstr "" #: ../../c-api/unicode.rst:946 msgid "" -"Create a Unicode object from the :c:type:`wchar_t` buffer *w* of the given " +"Create a Unicode object from the :c:expr:`wchar_t` buffer *w* of the given " "*size*. Passing ``-1`` as the *size* indicates that the function must itself " "compute the length, using wcslen. Return ``NULL`` on failure." msgstr "" #: ../../c-api/unicode.rst:954 msgid "" -"Copy the Unicode object contents into the :c:type:`wchar_t` buffer *w*. At " -"most *size* :c:type:`wchar_t` characters are copied (excluding a possibly " -"trailing null termination character). Return the number of :c:type:" +"Copy the Unicode object contents into the :c:expr:`wchar_t` buffer *w*. At " +"most *size* :c:expr:`wchar_t` characters are copied (excluding a possibly " +"trailing null termination character). Return the number of :c:expr:" "`wchar_t` characters copied or ``-1`` in case of an error. Note that the " -"resulting :c:type:`wchar_t*` string may or may not be null-terminated. It " -"is the responsibility of the caller to make sure that the :c:type:`wchar_t*` " +"resulting :c:expr:`wchar_t*` string may or may not be null-terminated. It " +"is the responsibility of the caller to make sure that the :c:expr:`wchar_t*` " "string is null-terminated in case this is required by the application. Also, " -"note that the :c:type:`wchar_t*` string might contain null characters, which " +"note that the :c:expr:`wchar_t*` string might contain null characters, which " "would cause the string to be truncated when used with most C functions." msgstr "" @@ -1151,9 +1151,9 @@ msgid "" "Convert the Unicode object to a wide character string. The output string " "always ends with a null character. If *size* is not ``NULL``, write the " "number of wide characters (excluding the trailing null termination " -"character) into *\\*size*. Note that the resulting :c:type:`wchar_t` string " +"character) into *\\*size*. Note that the resulting :c:expr:`wchar_t` string " "might contain null characters, which would cause the string to be truncated " -"when used with most C functions. If *size* is ``NULL`` and the :c:type:" +"when used with most C functions. If *size* is ``NULL`` and the :c:expr:" "`wchar_t*` string contains null characters a :exc:`ValueError` is raised." msgstr "" @@ -1167,7 +1167,7 @@ msgstr "" #: ../../c-api/unicode.rst:982 msgid "" -"Raises a :exc:`ValueError` if *size* is ``NULL`` and the :c:type:`wchar_t*` " +"Raises a :exc:`ValueError` if *size* is ``NULL`` and the :c:expr:`wchar_t*` " "string contains null characters." msgstr "" diff --git a/c-api/veryhigh.po b/c-api/veryhigh.po index 374d938588..87ed24d0f7 100644 --- a/c-api/veryhigh.po +++ b/c-api/veryhigh.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-05 06:54+0000\n" +"POT-Creation-Date: 2022-10-06 00:23+0000\n" "PO-Revision-Date: 2018-05-23 14:08+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -105,7 +105,7 @@ msgstr "" #: ../../c-api/veryhigh.rst:84 msgid "" "This is a simplified interface to :c:func:`PyRun_SimpleStringFlags` below, " -"leaving the :c:type:`PyCompilerFlags`\\* argument set to ``NULL``." +"leaving the :c:struct:`PyCompilerFlags`\\* argument set to ``NULL``." msgstr "" #: ../../c-api/veryhigh.rst:90 diff --git a/extending/extending.po b/extending/extending.po index e0146f2275..8aa39c56e5 100644 --- a/extending/extending.po +++ b/extending/extending.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-11-16 00:09+0000\n" +"POT-Creation-Date: 2022-10-06 00:23+0000\n" "PO-Revision-Date: 2018-05-23 14:34+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -210,23 +210,22 @@ msgstr "" msgid "" "When a function *f* that calls another function *g* detects that the latter " "fails, *f* should itself return an error value (usually ``NULL`` or " -"``-1``). It should *not* call one of the :c:func:`PyErr_\\*` functions --- " -"one has already been called by *g*. *f*'s caller is then supposed to also " -"return an error indication to *its* caller, again *without* calling :c:func:" -"`PyErr_\\*`, and so on --- the most detailed cause of the error was already " -"reported by the function that first detected it. Once the error reaches the " -"Python interpreter's main loop, this aborts the currently executing Python " -"code and tries to find an exception handler specified by the Python " -"programmer." +"``-1``). It should *not* call one of the ``PyErr_*`` functions --- one has " +"already been called by *g*. *f*'s caller is then supposed to also return an " +"error indication to *its* caller, again *without* calling ``PyErr_*``, and " +"so on --- the most detailed cause of the error was already reported by the " +"function that first detected it. Once the error reaches the Python " +"interpreter's main loop, this aborts the currently executing Python code and " +"tries to find an exception handler specified by the Python programmer." msgstr "" #: ../../extending/extending.rst:168 msgid "" "(There are situations where a module can actually give a more detailed error " -"message by calling another :c:func:`PyErr_\\*` function, and in such cases " -"it is fine to do so. As a general rule, however, this is not necessary, and " -"can cause information about the cause of the error to be lost: most " -"operations can fail for a variety of reasons.)" +"message by calling another ``PyErr_*`` function, and in such cases it is " +"fine to do so. As a general rule, however, this is not necessary, and can " +"cause information about the cause of the error to be lost: most operations " +"can fail for a variety of reasons.)" msgstr "" #: ../../extending/extending.rst:174 @@ -360,7 +359,7 @@ msgstr "" #: ../../extending/extending.rst:300 msgid "" "If you have a C function that returns no useful argument (a function " -"returning :c:type:`void`), the corresponding Python function must return " +"returning :c:expr:`void`), the corresponding Python function must return " "``None``. You need this idiom to do so (which is implemented by the :c:" "macro:`Py_RETURN_NONE` macro)::" msgstr "" @@ -1142,7 +1141,7 @@ msgstr "" msgid "" "Python provides a special mechanism to pass C-level information (pointers) " "from one extension module to another one: Capsules. A Capsule is a Python " -"data type which stores a pointer (:c:type:`void \\*`). Capsules can only be " +"data type which stores a pointer (:c:expr:`void \\*`). Capsules can only be " "created and accessed via their C API, but they can be passed around like any " "other Python object. In particular, they can be assigned to a name in an " "extension module's namespace. Other extension modules can then import this " @@ -1163,7 +1162,7 @@ msgstr "" #: ../../extending/extending.rst:1186 msgid "" "Whichever method you choose, it's important to name your Capsules properly. " -"The function :c:func:`PyCapsule_New` takes a name parameter (:c:type:`const " +"The function :c:func:`PyCapsule_New` takes a name parameter (:c:expr:`const " "char \\*`); you're permitted to pass in a ``NULL`` name, but we strongly " "encourage you to specify a name. Properly named Capsules provide a degree " "of runtime type-safety; there is no feasible way to tell one unnamed Capsule " @@ -1189,7 +1188,7 @@ msgid "" "The following example demonstrates an approach that puts most of the burden " "on the writer of the exporting module, which is appropriate for commonly " "used library modules. It stores all C API pointers (just one in the " -"example!) in an array of :c:type:`void` pointers which becomes the value of " +"example!) in an array of :c:expr:`void` pointers which becomes the value of " "a Capsule. The header file corresponding to the module provides a macro that " "takes care of importing the module and retrieving its C API pointers; client " "modules only have to call this macro before accessing the C API." diff --git a/extending/newtypes.po b/extending/newtypes.po index 0e42b4832c..8751ac94be 100644 --- a/extending/newtypes.po +++ b/extending/newtypes.po @@ -8,7 +8,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-06 00:23+0000\n" "PO-Revision-Date: 2018-05-23 14:34+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -199,7 +199,7 @@ msgstr "" msgid "" "Python supports two pairs of attribute handlers; a type that supports " "attributes only needs to implement the functions for one pair. The " -"difference is that one pair takes the name of the attribute as a :c:type:" +"difference is that one pair takes the name of the attribute as a :c:expr:" "`char\\*`, while the other accepts a :c:type:`PyObject\\*`. Each type can " "use whichever pair makes more sense for the implementation's convenience. ::" msgstr "" @@ -355,9 +355,9 @@ msgstr "" #: ../../extending/newtypes.rst:342 msgid "" -"For simplicity, only the :c:type:`char\\*` version will be demonstrated " +"For simplicity, only the :c:expr:`char\\*` version will be demonstrated " "here; the type of the name parameter is the only difference between the :c:" -"type:`char\\*` and :c:type:`PyObject\\*` flavors of the interface. This " +"expr:`char\\*` and :c:type:`PyObject\\*` flavors of the interface. This " "example effectively does the same thing as the generic example above, but " "does not use the generic support added in Python 2.2. It explains how the " "handler functions are called, so that if you do need to extend their " diff --git a/library/asyncio-eventloop.po b/library/asyncio-eventloop.po index 36ffb96bc1..628f2aa320 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-10-05 00:24+0000\n" +"POT-Creation-Date: 2022-10-06 00:23+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-" @@ -251,8 +251,8 @@ msgid "" msgstr "" #: ../../library/asyncio-eventloop.rst:173 -#: ../../library/asyncio-eventloop.rst:1080 -#: ../../library/asyncio-eventloop.rst:1466 +#: ../../library/asyncio-eventloop.rst:1104 +#: ../../library/asyncio-eventloop.rst:1490 msgid "Example::" msgstr "" "範例:\n" @@ -491,8 +491,8 @@ msgid "The socket type will be :py:data:`~socket.SOCK_STREAM`." msgstr "" #: ../../library/asyncio-eventloop.rst:385 -#: ../../library/asyncio-eventloop.rst:996 -#: ../../library/asyncio-eventloop.rst:1012 +#: ../../library/asyncio-eventloop.rst:1020 +#: ../../library/asyncio-eventloop.rst:1036 msgid "" "*protocol_factory* must be a callable returning an :ref:`asyncio protocol " "` implementation." @@ -536,7 +536,7 @@ msgid "" msgstr "" #: ../../library/asyncio-eventloop.rst:407 -#: ../../library/asyncio-eventloop.rst:529 +#: ../../library/asyncio-eventloop.rst:535 msgid "Other arguments:" msgstr "" @@ -601,42 +601,51 @@ msgid "" "*interleave* and *local_addr* should be specified." msgstr "" -#: ../../library/asyncio-eventloop.rst:453 +#: ../../library/asyncio-eventloop.rst:455 +#: ../../library/asyncio-eventloop.rst:566 +#: ../../library/asyncio-eventloop.rst:752 +msgid "" +"The *sock* argument transfers ownership of the socket to the transport " +"created. To close the socket, call the transport's :meth:`~asyncio." +"BaseTransport.close` method." +msgstr "" + +#: ../../library/asyncio-eventloop.rst:459 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:457 -#: ../../library/asyncio-eventloop.rst:805 +#: ../../library/asyncio-eventloop.rst:463 +#: ../../library/asyncio-eventloop.rst:829 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:463 -#: ../../library/asyncio-eventloop.rst:675 +#: ../../library/asyncio-eventloop.rst:469 +#: ../../library/asyncio-eventloop.rst:693 msgid "Added support for SSL/TLS in :class:`ProactorEventLoop`." msgstr "" -#: ../../library/asyncio-eventloop.rst:467 +#: ../../library/asyncio-eventloop.rst:473 msgid "" "The socket option :py:data:`~socket.TCP_NODELAY` is set by default for all " "TCP connections." msgstr "" -#: ../../library/asyncio-eventloop.rst:472 -#: ../../library/asyncio-eventloop.rst:745 +#: ../../library/asyncio-eventloop.rst:478 +#: ../../library/asyncio-eventloop.rst:769 msgid "Added the *ssl_handshake_timeout* parameter." msgstr "增加 *ssl_handshake_timeout* 參數。" -#: ../../library/asyncio-eventloop.rst:476 +#: ../../library/asyncio-eventloop.rst:482 msgid "Added the *happy_eyeballs_delay* and *interleave* parameters." msgstr "加入 *happy_eyeballs_delay* 和 *interleave* 參數。" -#: ../../library/asyncio-eventloop.rst:478 +#: ../../library/asyncio-eventloop.rst:484 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 +656,32 @@ msgid "" "visible delay and provides an algorithm." msgstr "" -#: ../../library/asyncio-eventloop.rst:487 +#: ../../library/asyncio-eventloop.rst:493 msgid "For more information: https://tools.ietf.org/html/rfc6555" msgstr "更多資訊請見:\\ https://tools.ietf.org/html/rfc6555" -#: ../../library/asyncio-eventloop.rst:491 +#: ../../library/asyncio-eventloop.rst:497 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:502 +#: ../../library/asyncio-eventloop.rst:508 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:506 +#: ../../library/asyncio-eventloop.rst:512 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:510 +#: ../../library/asyncio-eventloop.rst:516 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 +689,49 @@ msgid "" "from assigning sockets to the same socket address." msgstr "" -#: ../../library/asyncio-eventloop.rst:516 +#: ../../library/asyncio-eventloop.rst:522 msgid "Create a datagram connection." msgstr "" -#: ../../library/asyncio-eventloop.rst:518 +#: ../../library/asyncio-eventloop.rst:524 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:522 +#: ../../library/asyncio-eventloop.rst:528 msgid "The socket type will be :py:data:`~socket.SOCK_DGRAM`." msgstr "" -#: ../../library/asyncio-eventloop.rst:524 -#: ../../library/asyncio-eventloop.rst:616 -#: ../../library/asyncio-eventloop.rst:726 +#: ../../library/asyncio-eventloop.rst:530 +#: ../../library/asyncio-eventloop.rst:628 +#: ../../library/asyncio-eventloop.rst:744 msgid "" "*protocol_factory* must be a callable returning a :ref:`protocol ` implementation." msgstr "" -#: ../../library/asyncio-eventloop.rst:527 -#: ../../library/asyncio-eventloop.rst:581 +#: ../../library/asyncio-eventloop.rst:533 +#: ../../library/asyncio-eventloop.rst:593 msgid "A tuple of ``(transport, protocol)`` is returned on success." msgstr "" -#: ../../library/asyncio-eventloop.rst:531 +#: ../../library/asyncio-eventloop.rst:537 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:535 +#: ../../library/asyncio-eventloop.rst:541 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:539 +#: ../../library/asyncio-eventloop.rst:545 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 +739,7 @@ msgid "" "module constants." msgstr "" -#: ../../library/asyncio-eventloop.rst:544 +#: ../../library/asyncio-eventloop.rst:550 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 +748,13 @@ msgid "" "this capability is unsupported." msgstr "" -#: ../../library/asyncio-eventloop.rst:550 +#: ../../library/asyncio-eventloop.rst:556 msgid "" "*allow_broadcast* tells the kernel to allow this endpoint to send messages " "to the broadcast address." msgstr "" -#: ../../library/asyncio-eventloop.rst:553 +#: ../../library/asyncio-eventloop.rst:559 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 +762,107 @@ msgid "" "`None`)." msgstr "" -#: ../../library/asyncio-eventloop.rst:558 +#: ../../library/asyncio-eventloop.rst:570 msgid "" "See :ref:`UDP echo client protocol ` and :" "ref:`UDP echo server protocol ` examples." msgstr "" -#: ../../library/asyncio-eventloop.rst:561 +#: ../../library/asyncio-eventloop.rst:573 msgid "" "The *family*, *proto*, *flags*, *reuse_address*, *reuse_port, " "*allow_broadcast*, and *sock* parameters were added." msgstr "" -#: ../../library/asyncio-eventloop.rst:565 +#: ../../library/asyncio-eventloop.rst:577 msgid "" "The *reuse_address* parameter is no longer supported due to security " "concerns." msgstr "" -#: ../../library/asyncio-eventloop.rst:569 +#: ../../library/asyncio-eventloop.rst:581 msgid "Added support for Windows." msgstr "新增對於 Windows 的支援。" -#: ../../library/asyncio-eventloop.rst:576 +#: ../../library/asyncio-eventloop.rst:588 msgid "Create a Unix connection." msgstr "" -#: ../../library/asyncio-eventloop.rst:578 +#: ../../library/asyncio-eventloop.rst:590 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:583 +#: ../../library/asyncio-eventloop.rst:595 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:588 +#: ../../library/asyncio-eventloop.rst:600 msgid "" "See the documentation of the :meth:`loop.create_connection` method for " "information about arguments to this method." msgstr "" -#: ../../library/asyncio-eventloop.rst:592 -#: ../../library/asyncio-eventloop.rst:710 -#: ../../library/asyncio-eventloop.rst:1063 +#: ../../library/asyncio-eventloop.rst:604 +#: ../../library/asyncio-eventloop.rst:728 +#: ../../library/asyncio-eventloop.rst:1087 msgid ":ref:`Availability `: Unix." msgstr ":ref:`適用 `:Unix。" -#: ../../library/asyncio-eventloop.rst:593 +#: ../../library/asyncio-eventloop.rst:605 msgid "" "Added the *ssl_handshake_timeout* parameter. The *path* parameter can now be " "a :term:`path-like object`." msgstr "" -#: ../../library/asyncio-eventloop.rst:599 +#: ../../library/asyncio-eventloop.rst:611 msgid "Creating network servers" msgstr "" -#: ../../library/asyncio-eventloop.rst:609 +#: ../../library/asyncio-eventloop.rst:621 msgid "" "Create a TCP server (socket type :data:`~socket.SOCK_STREAM`) listening on " "*port* of the *host* address." msgstr "" -#: ../../library/asyncio-eventloop.rst:612 +#: ../../library/asyncio-eventloop.rst:624 msgid "Returns a :class:`Server` object." msgstr "" -#: ../../library/asyncio-eventloop.rst:614 +#: ../../library/asyncio-eventloop.rst:626 msgid "Arguments:" msgstr "引數:" -#: ../../library/asyncio-eventloop.rst:619 +#: ../../library/asyncio-eventloop.rst:631 msgid "" "The *host* parameter can be set to several types which determine where the " "server would be listening:" msgstr "" -#: ../../library/asyncio-eventloop.rst:622 +#: ../../library/asyncio-eventloop.rst:634 msgid "" "If *host* is a string, the TCP server is bound to a single network interface " "specified by *host*." msgstr "" -#: ../../library/asyncio-eventloop.rst:625 +#: ../../library/asyncio-eventloop.rst:637 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:628 +#: ../../library/asyncio-eventloop.rst:640 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:632 +#: ../../library/asyncio-eventloop.rst:644 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 +870,63 @@ msgid "" "different random port will be selected for each interface)." msgstr "" -#: ../../library/asyncio-eventloop.rst:637 +#: ../../library/asyncio-eventloop.rst:649 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:642 +#: ../../library/asyncio-eventloop.rst:654 msgid "*flags* is a bitmask for :meth:`getaddrinfo`." msgstr "" -#: ../../library/asyncio-eventloop.rst:644 +#: ../../library/asyncio-eventloop.rst:656 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:647 +#: ../../library/asyncio-eventloop.rst:661 +msgid "" +"The *sock* argument transfers ownership of the socket to the server created. " +"To close the socket, call the server's :meth:`~asyncio.Server.close` method." +msgstr "" + +#: ../../library/asyncio-eventloop.rst:665 msgid "" "*backlog* is the maximum number of queued connections passed to :meth:" "`~socket.socket.listen` (defaults to 100)." msgstr "" -#: ../../library/asyncio-eventloop.rst:650 +#: ../../library/asyncio-eventloop.rst:668 msgid "" "*ssl* can be set to an :class:`~ssl.SSLContext` instance to enable TLS over " "the accepted connections." msgstr "" -#: ../../library/asyncio-eventloop.rst:653 +#: ../../library/asyncio-eventloop.rst:671 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:658 +#: ../../library/asyncio-eventloop.rst:676 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:663 +#: ../../library/asyncio-eventloop.rst:681 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:667 +#: ../../library/asyncio-eventloop.rst:685 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 +934,44 @@ msgid "" "to make the server to start accepting connections." msgstr "" -#: ../../library/asyncio-eventloop.rst:679 +#: ../../library/asyncio-eventloop.rst:697 msgid "The *host* parameter can be a sequence of strings." msgstr "" -#: ../../library/asyncio-eventloop.rst:683 +#: ../../library/asyncio-eventloop.rst:701 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:689 +#: ../../library/asyncio-eventloop.rst:707 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:698 +#: ../../library/asyncio-eventloop.rst:716 msgid "" "Similar to :meth:`loop.create_server` but works with the :py:data:`~socket." "AF_UNIX` socket family." msgstr "" -#: ../../library/asyncio-eventloop.rst:701 +#: ../../library/asyncio-eventloop.rst:719 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:706 +#: ../../library/asyncio-eventloop.rst:724 msgid "" "See the documentation of the :meth:`loop.create_server` method for " "information about arguments to this method." msgstr "" -#: ../../library/asyncio-eventloop.rst:713 +#: ../../library/asyncio-eventloop.rst:731 msgid "" "Added the *ssl_handshake_timeout* and *start_serving* parameters. The *path* " "parameter can now be a :class:`~pathlib.Path` object." @@ -964,63 +979,63 @@ msgstr "" "新增 *ssl_handshake_timeout* 與 *start_serving* 參數。\\ *path* 參數現在可為" "一個 :class:`~pathlib.Path` 物件。" -#: ../../library/asyncio-eventloop.rst:719 +#: ../../library/asyncio-eventloop.rst:737 msgid "Wrap an already accepted connection into a transport/protocol pair." msgstr "" -#: ../../library/asyncio-eventloop.rst:721 +#: ../../library/asyncio-eventloop.rst:739 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:724 -#: ../../library/asyncio-eventloop.rst:791 +#: ../../library/asyncio-eventloop.rst:742 +#: ../../library/asyncio-eventloop.rst:815 msgid "Parameters:" msgstr "參數:" -#: ../../library/asyncio-eventloop.rst:729 +#: ../../library/asyncio-eventloop.rst:747 msgid "" "*sock* is a preexisting socket object returned from :meth:`socket.accept " "`." msgstr "" -#: ../../library/asyncio-eventloop.rst:732 +#: ../../library/asyncio-eventloop.rst:756 msgid "" "*ssl* can be set to an :class:`~ssl.SSLContext` to enable SSL over the " "accepted connections." msgstr "" -#: ../../library/asyncio-eventloop.rst:735 +#: ../../library/asyncio-eventloop.rst:759 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:739 +#: ../../library/asyncio-eventloop.rst:763 msgid "Returns a ``(transport, protocol)`` pair." msgstr "" -#: ../../library/asyncio-eventloop.rst:749 +#: ../../library/asyncio-eventloop.rst:773 msgid "Transferring files" msgstr "" -#: ../../library/asyncio-eventloop.rst:754 +#: ../../library/asyncio-eventloop.rst:778 msgid "" "Send a *file* over a *transport*. Return the total number of bytes sent." msgstr "" -#: ../../library/asyncio-eventloop.rst:757 +#: ../../library/asyncio-eventloop.rst:781 msgid "The method uses high-performance :meth:`os.sendfile` if available." msgstr "" -#: ../../library/asyncio-eventloop.rst:759 +#: ../../library/asyncio-eventloop.rst:783 msgid "*file* must be a regular file object opened in binary mode." msgstr "" -#: ../../library/asyncio-eventloop.rst:761 -#: ../../library/asyncio-eventloop.rst:951 +#: ../../library/asyncio-eventloop.rst:785 +#: ../../library/asyncio-eventloop.rst:975 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 +1044,98 @@ msgid "" "obtain the actual number of bytes sent." msgstr "" -#: ../../library/asyncio-eventloop.rst:768 +#: ../../library/asyncio-eventloop.rst:792 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:772 +#: ../../library/asyncio-eventloop.rst:796 msgid "" "Raise :exc:`SendfileNotAvailableError` if the system does not support the " "*sendfile* syscall and *fallback* is ``False``." msgstr "" -#: ../../library/asyncio-eventloop.rst:779 +#: ../../library/asyncio-eventloop.rst:803 msgid "TLS Upgrade" msgstr "" -#: ../../library/asyncio-eventloop.rst:785 +#: ../../library/asyncio-eventloop.rst:809 msgid "Upgrade an existing transport-based connection to TLS." msgstr "" -#: ../../library/asyncio-eventloop.rst:787 +#: ../../library/asyncio-eventloop.rst:811 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:793 +#: ../../library/asyncio-eventloop.rst:817 msgid "" "*transport* and *protocol* instances that methods like :meth:`~loop." "create_server` and :meth:`~loop.create_connection` return." msgstr "" -#: ../../library/asyncio-eventloop.rst:797 +#: ../../library/asyncio-eventloop.rst:821 msgid "*sslcontext*: a configured instance of :class:`~ssl.SSLContext`." msgstr "" -#: ../../library/asyncio-eventloop.rst:799 +#: ../../library/asyncio-eventloop.rst:823 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:802 +#: ../../library/asyncio-eventloop.rst:826 msgid "" "*server_hostname*: sets or overrides the host name that the target server's " "certificate will be matched against." msgstr "" -#: ../../library/asyncio-eventloop.rst:813 +#: ../../library/asyncio-eventloop.rst:837 msgid "Watching file descriptors" msgstr "" -#: ../../library/asyncio-eventloop.rst:817 +#: ../../library/asyncio-eventloop.rst:841 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:823 +#: ../../library/asyncio-eventloop.rst:847 msgid "Stop monitoring the *fd* file descriptor for read availability." msgstr "" -#: ../../library/asyncio-eventloop.rst:827 +#: ../../library/asyncio-eventloop.rst:851 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:831 -#: ../../library/asyncio-eventloop.rst:1050 +#: ../../library/asyncio-eventloop.rst:855 +#: ../../library/asyncio-eventloop.rst:1074 msgid "" "Use :func:`functools.partial` :ref:`to pass keyword arguments ` to *callback*." msgstr "" -#: ../../library/asyncio-eventloop.rst:836 +#: ../../library/asyncio-eventloop.rst:860 msgid "Stop monitoring the *fd* file descriptor for write availability." msgstr "" -#: ../../library/asyncio-eventloop.rst:838 +#: ../../library/asyncio-eventloop.rst:862 msgid "" "See also :ref:`Platform Support ` section for some " "limitations of these methods." msgstr "" -#: ../../library/asyncio-eventloop.rst:843 +#: ../../library/asyncio-eventloop.rst:867 msgid "Working with socket objects directly" msgstr "" -#: ../../library/asyncio-eventloop.rst:845 +#: ../../library/asyncio-eventloop.rst:869 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 +1144,49 @@ msgid "" "socket` objects directly is more convenient." msgstr "" -#: ../../library/asyncio-eventloop.rst:854 +#: ../../library/asyncio-eventloop.rst:878 msgid "" "Receive up to *nbytes* from *sock*. Asynchronous version of :meth:`socket." "recv() `." msgstr "" -#: ../../library/asyncio-eventloop.rst:857 +#: ../../library/asyncio-eventloop.rst:881 msgid "Return the received data as a bytes object." msgstr "" -#: ../../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 +#: ../../library/asyncio-eventloop.rst:883 +#: ../../library/asyncio-eventloop.rst:897 +#: ../../library/asyncio-eventloop.rst:912 +#: ../../library/asyncio-eventloop.rst:925 +#: ../../library/asyncio-eventloop.rst:951 +#: ../../library/asyncio-eventloop.rst:989 msgid "*sock* must be a non-blocking socket." msgstr "" -#: ../../library/asyncio-eventloop.rst:861 +#: ../../library/asyncio-eventloop.rst:885 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:868 +#: ../../library/asyncio-eventloop.rst:892 msgid "" "Receive data from *sock* into the *buf* buffer. Modeled after the blocking :" "meth:`socket.recv_into() ` method." msgstr "" -#: ../../library/asyncio-eventloop.rst:871 +#: ../../library/asyncio-eventloop.rst:895 msgid "Return the number of bytes written to the buffer." msgstr "" -#: ../../library/asyncio-eventloop.rst:879 +#: ../../library/asyncio-eventloop.rst:903 msgid "" "Send *data* to the *sock* socket. Asynchronous version of :meth:`socket." "sendall() `." msgstr "" -#: ../../library/asyncio-eventloop.rst:882 +#: ../../library/asyncio-eventloop.rst:906 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 +1195,23 @@ msgid "" "the connection." msgstr "" -#: ../../library/asyncio-eventloop.rst:890 +#: ../../library/asyncio-eventloop.rst:914 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:897 +#: ../../library/asyncio-eventloop.rst:921 msgid "Connect *sock* to a remote socket at *address*." msgstr "" -#: ../../library/asyncio-eventloop.rst:899 +#: ../../library/asyncio-eventloop.rst:923 msgid "" "Asynchronous version of :meth:`socket.connect() `." msgstr "" -#: ../../library/asyncio-eventloop.rst:903 +#: ../../library/asyncio-eventloop.rst:927 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 +1219,19 @@ msgid "" "*address*." msgstr "" -#: ../../library/asyncio-eventloop.rst:912 +#: ../../library/asyncio-eventloop.rst:936 msgid "" ":meth:`loop.create_connection` and :func:`asyncio.open_connection() " "`." msgstr "" -#: ../../library/asyncio-eventloop.rst:918 +#: ../../library/asyncio-eventloop.rst:942 msgid "" "Accept a connection. Modeled after the blocking :meth:`socket.accept() " "` method." msgstr "" -#: ../../library/asyncio-eventloop.rst:921 +#: ../../library/asyncio-eventloop.rst:945 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 +1239,64 @@ msgid "" "the address bound to the socket on the other end of the connection." msgstr "" -#: ../../library/asyncio-eventloop.rst:929 +#: ../../library/asyncio-eventloop.rst:953 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:936 +#: ../../library/asyncio-eventloop.rst:960 msgid ":meth:`loop.create_server` and :func:`start_server`." msgstr ":meth:`loop.create_server` 和 :func:`start_server`\\ 。" -#: ../../library/asyncio-eventloop.rst:941 +#: ../../library/asyncio-eventloop.rst:965 msgid "" "Send a file using high-performance :mod:`os.sendfile` if possible. Return " "the total number of bytes sent." msgstr "" -#: ../../library/asyncio-eventloop.rst:944 +#: ../../library/asyncio-eventloop.rst:968 msgid "" "Asynchronous version of :meth:`socket.sendfile() `." msgstr "" -#: ../../library/asyncio-eventloop.rst:946 +#: ../../library/asyncio-eventloop.rst:970 msgid "" "*sock* must be a non-blocking :const:`socket.SOCK_STREAM` :class:`~socket." "socket`." msgstr "" -#: ../../library/asyncio-eventloop.rst:949 +#: ../../library/asyncio-eventloop.rst:973 msgid "*file* must be a regular file object open in binary mode." msgstr "" -#: ../../library/asyncio-eventloop.rst:958 +#: ../../library/asyncio-eventloop.rst:982 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:962 +#: ../../library/asyncio-eventloop.rst:986 msgid "" "Raise :exc:`SendfileNotAvailableError` if the system does not support " "*sendfile* syscall and *fallback* is ``False``." msgstr "" -#: ../../library/asyncio-eventloop.rst:971 +#: ../../library/asyncio-eventloop.rst:995 msgid "DNS" msgstr "DNS" -#: ../../library/asyncio-eventloop.rst:976 +#: ../../library/asyncio-eventloop.rst:1000 msgid "Asynchronous version of :meth:`socket.getaddrinfo`." msgstr "" -#: ../../library/asyncio-eventloop.rst:980 +#: ../../library/asyncio-eventloop.rst:1004 msgid "Asynchronous version of :meth:`socket.getnameinfo`." msgstr "" -#: ../../library/asyncio-eventloop.rst:982 +#: ../../library/asyncio-eventloop.rst:1006 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 +1304,67 @@ msgid "" "coroutines." msgstr "" -#: ../../library/asyncio-eventloop.rst:990 +#: ../../library/asyncio-eventloop.rst:1014 msgid "Working with pipes" msgstr "" -#: ../../library/asyncio-eventloop.rst:994 +#: ../../library/asyncio-eventloop.rst:1018 msgid "Register the read end of *pipe* in the event loop." msgstr "" -#: ../../library/asyncio-eventloop.rst:999 +#: ../../library/asyncio-eventloop.rst:1023 msgid "*pipe* is a :term:`file-like object `." msgstr "" -#: ../../library/asyncio-eventloop.rst:1001 +#: ../../library/asyncio-eventloop.rst:1025 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:1005 -#: ../../library/asyncio-eventloop.rst:1021 +#: ../../library/asyncio-eventloop.rst:1029 +#: ../../library/asyncio-eventloop.rst:1045 msgid "" "With :class:`SelectorEventLoop` event loop, the *pipe* is set to non-" "blocking mode." msgstr "" -#: ../../library/asyncio-eventloop.rst:1010 +#: ../../library/asyncio-eventloop.rst:1034 msgid "Register the write end of *pipe* in the event loop." msgstr "" -#: ../../library/asyncio-eventloop.rst:1015 +#: ../../library/asyncio-eventloop.rst:1039 msgid "*pipe* is :term:`file-like object `." msgstr "" -#: ../../library/asyncio-eventloop.rst:1017 +#: ../../library/asyncio-eventloop.rst:1041 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:1026 +#: ../../library/asyncio-eventloop.rst:1050 msgid "" ":class:`SelectorEventLoop` does not support the above methods on Windows. " "Use :class:`ProactorEventLoop` instead for Windows." msgstr "" -#: ../../library/asyncio-eventloop.rst:1031 +#: ../../library/asyncio-eventloop.rst:1055 msgid "" "The :meth:`loop.subprocess_exec` and :meth:`loop.subprocess_shell` methods." msgstr "" -#: ../../library/asyncio-eventloop.rst:1036 +#: ../../library/asyncio-eventloop.rst:1060 msgid "Unix signals" msgstr "" -#: ../../library/asyncio-eventloop.rst:1040 +#: ../../library/asyncio-eventloop.rst:1064 msgid "Set *callback* as the handler for the *signum* signal." msgstr "" -#: ../../library/asyncio-eventloop.rst:1042 +#: ../../library/asyncio-eventloop.rst:1066 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 +1372,56 @@ msgid "" "function is allowed to interact with the event loop." msgstr "" -#: ../../library/asyncio-eventloop.rst:1047 +#: ../../library/asyncio-eventloop.rst:1071 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:1053 +#: ../../library/asyncio-eventloop.rst:1077 msgid "" "Like :func:`signal.signal`, this function must be invoked in the main thread." msgstr "" -#: ../../library/asyncio-eventloop.rst:1058 +#: ../../library/asyncio-eventloop.rst:1082 msgid "Remove the handler for the *sig* signal." msgstr "" -#: ../../library/asyncio-eventloop.rst:1060 +#: ../../library/asyncio-eventloop.rst:1084 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:1067 +#: ../../library/asyncio-eventloop.rst:1091 msgid "The :mod:`signal` module." msgstr "" -#: ../../library/asyncio-eventloop.rst:1071 +#: ../../library/asyncio-eventloop.rst:1095 msgid "Executing code in thread or process pools" msgstr "" -#: ../../library/asyncio-eventloop.rst:1075 +#: ../../library/asyncio-eventloop.rst:1099 msgid "Arrange for *func* to be called in the specified executor." msgstr "" -#: ../../library/asyncio-eventloop.rst:1077 +#: ../../library/asyncio-eventloop.rst:1101 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:1121 +#: ../../library/asyncio-eventloop.rst:1145 msgid "This method returns a :class:`asyncio.Future` object." msgstr "" -#: ../../library/asyncio-eventloop.rst:1123 +#: ../../library/asyncio-eventloop.rst:1147 msgid "" "Use :func:`functools.partial` :ref:`to pass keyword arguments ` to *func*." msgstr "" -#: ../../library/asyncio-eventloop.rst:1126 +#: ../../library/asyncio-eventloop.rst:1150 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 +1429,38 @@ msgid "" "default." msgstr "" -#: ../../library/asyncio-eventloop.rst:1135 +#: ../../library/asyncio-eventloop.rst:1159 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:1139 +#: ../../library/asyncio-eventloop.rst:1163 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:1144 +#: ../../library/asyncio-eventloop.rst:1168 msgid "" "*executor* must be an instance of :class:`concurrent.futures." "ThreadPoolExecutor`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1149 +#: ../../library/asyncio-eventloop.rst:1173 msgid "Error Handling API" msgstr "" -#: ../../library/asyncio-eventloop.rst:1151 +#: ../../library/asyncio-eventloop.rst:1175 msgid "Allows customizing how exceptions are handled in the event loop." msgstr "" -#: ../../library/asyncio-eventloop.rst:1155 +#: ../../library/asyncio-eventloop.rst:1179 msgid "Set *handler* as the new event loop exception handler." msgstr "" -#: ../../library/asyncio-eventloop.rst:1157 +#: ../../library/asyncio-eventloop.rst:1181 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 +1469,158 @@ msgid "" "(see :meth:`call_exception_handler` documentation for details about context)." msgstr "" -#: ../../library/asyncio-eventloop.rst:1167 +#: ../../library/asyncio-eventloop.rst:1191 msgid "" "Return the current exception handler, or ``None`` if no custom exception " "handler was set." msgstr "" -#: ../../library/asyncio-eventloop.rst:1174 +#: ../../library/asyncio-eventloop.rst:1198 msgid "Default exception handler." msgstr "" -#: ../../library/asyncio-eventloop.rst:1176 +#: ../../library/asyncio-eventloop.rst:1200 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:1180 +#: ../../library/asyncio-eventloop.rst:1204 msgid "" "*context* parameter has the same meaning as in :meth:" "`call_exception_handler`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1185 +#: ../../library/asyncio-eventloop.rst:1209 msgid "Call the current event loop exception handler." msgstr "" -#: ../../library/asyncio-eventloop.rst:1187 +#: ../../library/asyncio-eventloop.rst:1211 msgid "" "*context* is a ``dict`` object containing the following keys (new keys may " "be introduced in future Python versions):" msgstr "" -#: ../../library/asyncio-eventloop.rst:1190 +#: ../../library/asyncio-eventloop.rst:1214 msgid "'message': Error message;" msgstr "" -#: ../../library/asyncio-eventloop.rst:1191 +#: ../../library/asyncio-eventloop.rst:1215 msgid "'exception' (optional): Exception object;" msgstr "" -#: ../../library/asyncio-eventloop.rst:1192 +#: ../../library/asyncio-eventloop.rst:1216 msgid "'future' (optional): :class:`asyncio.Future` instance;" msgstr "" -#: ../../library/asyncio-eventloop.rst:1193 +#: ../../library/asyncio-eventloop.rst:1217 msgid "'task' (optional): :class:`asyncio.Task` instance;" msgstr "" -#: ../../library/asyncio-eventloop.rst:1194 +#: ../../library/asyncio-eventloop.rst:1218 msgid "'handle' (optional): :class:`asyncio.Handle` instance;" msgstr "" -#: ../../library/asyncio-eventloop.rst:1195 +#: ../../library/asyncio-eventloop.rst:1219 msgid "'protocol' (optional): :ref:`Protocol ` instance;" msgstr "" -#: ../../library/asyncio-eventloop.rst:1196 +#: ../../library/asyncio-eventloop.rst:1220 msgid "'transport' (optional): :ref:`Transport ` instance;" msgstr "" -#: ../../library/asyncio-eventloop.rst:1197 +#: ../../library/asyncio-eventloop.rst:1221 msgid "'socket' (optional): :class:`socket.socket` instance;" msgstr "" -#: ../../library/asyncio-eventloop.rst:1199 +#: ../../library/asyncio-eventloop.rst:1223 msgid "'asyncgen' (optional): Asynchronous generator that caused" msgstr "" -#: ../../library/asyncio-eventloop.rst:1199 +#: ../../library/asyncio-eventloop.rst:1223 msgid "the exception." msgstr "" -#: ../../library/asyncio-eventloop.rst:1203 +#: ../../library/asyncio-eventloop.rst:1227 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:1208 +#: ../../library/asyncio-eventloop.rst:1232 msgid "Enabling debug mode" msgstr "" -#: ../../library/asyncio-eventloop.rst:1212 +#: ../../library/asyncio-eventloop.rst:1236 msgid "Get the debug mode (:class:`bool`) of the event loop." msgstr "" -#: ../../library/asyncio-eventloop.rst:1214 +#: ../../library/asyncio-eventloop.rst:1238 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:1220 +#: ../../library/asyncio-eventloop.rst:1244 msgid "Set the debug mode of the event loop." msgstr "" -#: ../../library/asyncio-eventloop.rst:1224 +#: ../../library/asyncio-eventloop.rst:1248 msgid "" "The new :ref:`Python Development Mode ` can now also be used to " "enable the debug mode." msgstr "" -#: ../../library/asyncio-eventloop.rst:1229 +#: ../../library/asyncio-eventloop.rst:1253 msgid "The :ref:`debug mode of asyncio `." msgstr "" -#: ../../library/asyncio-eventloop.rst:1233 +#: ../../library/asyncio-eventloop.rst:1257 msgid "Running Subprocesses" msgstr "" -#: ../../library/asyncio-eventloop.rst:1235 +#: ../../library/asyncio-eventloop.rst:1259 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:1242 +#: ../../library/asyncio-eventloop.rst:1266 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:1251 +#: ../../library/asyncio-eventloop.rst:1275 msgid "" "Create a subprocess from one or more string arguments specified by *args*." msgstr "" -#: ../../library/asyncio-eventloop.rst:1254 +#: ../../library/asyncio-eventloop.rst:1278 msgid "*args* must be a list of strings represented by:" msgstr "" -#: ../../library/asyncio-eventloop.rst:1256 +#: ../../library/asyncio-eventloop.rst:1280 msgid ":class:`str`;" msgstr ":class:`str`\\ ;" -#: ../../library/asyncio-eventloop.rst:1257 +#: ../../library/asyncio-eventloop.rst:1281 msgid "" "or :class:`bytes`, encoded to the :ref:`filesystem encoding `." msgstr "" -#: ../../library/asyncio-eventloop.rst:1260 +#: ../../library/asyncio-eventloop.rst:1284 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:1264 +#: ../../library/asyncio-eventloop.rst:1288 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 +1628,136 @@ msgid "" "which is list of strings, *subprocess_exec* takes multiple string arguments." msgstr "" -#: ../../library/asyncio-eventloop.rst:1270 +#: ../../library/asyncio-eventloop.rst:1294 msgid "" "The *protocol_factory* must be a callable returning a subclass of the :class:" "`asyncio.SubprocessProtocol` class." msgstr "" -#: ../../library/asyncio-eventloop.rst:1273 +#: ../../library/asyncio-eventloop.rst:1297 msgid "Other parameters:" msgstr "其他參數:" -#: ../../library/asyncio-eventloop.rst:1275 +#: ../../library/asyncio-eventloop.rst:1299 msgid "*stdin* can be any of these:" msgstr "" -#: ../../library/asyncio-eventloop.rst:1277 +#: ../../library/asyncio-eventloop.rst:1301 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:1280 -#: ../../library/asyncio-eventloop.rst:1292 #: ../../library/asyncio-eventloop.rst:1304 +#: ../../library/asyncio-eventloop.rst:1316 +#: ../../library/asyncio-eventloop.rst:1328 msgid "" "the :const:`subprocess.PIPE` constant (default) which will create a new pipe " "and connect it," msgstr "" -#: ../../library/asyncio-eventloop.rst:1282 -#: ../../library/asyncio-eventloop.rst:1294 #: ../../library/asyncio-eventloop.rst:1306 +#: ../../library/asyncio-eventloop.rst:1318 +#: ../../library/asyncio-eventloop.rst:1330 msgid "" "the value ``None`` which will make the subprocess inherit the file " "descriptor from this process" msgstr "" -#: ../../library/asyncio-eventloop.rst:1284 -#: ../../library/asyncio-eventloop.rst:1296 #: ../../library/asyncio-eventloop.rst:1308 +#: ../../library/asyncio-eventloop.rst:1320 +#: ../../library/asyncio-eventloop.rst:1332 msgid "" "the :const:`subprocess.DEVNULL` constant which indicates that the special :" "data:`os.devnull` file will be used" msgstr "" -#: ../../library/asyncio-eventloop.rst:1287 +#: ../../library/asyncio-eventloop.rst:1311 msgid "*stdout* can be any of these:" msgstr "" -#: ../../library/asyncio-eventloop.rst:1289 +#: ../../library/asyncio-eventloop.rst:1313 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:1299 +#: ../../library/asyncio-eventloop.rst:1323 msgid "*stderr* can be any of these:" msgstr "" -#: ../../library/asyncio-eventloop.rst:1301 +#: ../../library/asyncio-eventloop.rst:1325 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:1310 +#: ../../library/asyncio-eventloop.rst:1334 msgid "" "the :const:`subprocess.STDOUT` constant which will connect the standard " "error stream to the process' standard output stream" msgstr "" -#: ../../library/asyncio-eventloop.rst:1313 +#: ../../library/asyncio-eventloop.rst:1337 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:1318 +#: ../../library/asyncio-eventloop.rst:1342 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:1322 +#: ../../library/asyncio-eventloop.rst:1346 msgid "" "See the constructor of the :class:`subprocess.Popen` class for documentation " "on other arguments." msgstr "" -#: ../../library/asyncio-eventloop.rst:1325 +#: ../../library/asyncio-eventloop.rst:1349 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:1333 +#: ../../library/asyncio-eventloop.rst:1357 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:1338 +#: ../../library/asyncio-eventloop.rst:1362 msgid "" "This is similar to the standard library :class:`subprocess.Popen` class " "called with ``shell=True``." msgstr "" -#: ../../library/asyncio-eventloop.rst:1341 +#: ../../library/asyncio-eventloop.rst:1365 msgid "" "The *protocol_factory* must be a callable returning a subclass of the :class:" "`SubprocessProtocol` class." msgstr "" -#: ../../library/asyncio-eventloop.rst:1344 +#: ../../library/asyncio-eventloop.rst:1368 msgid "" "See :meth:`~loop.subprocess_exec` for more details about the remaining " "arguments." msgstr "" -#: ../../library/asyncio-eventloop.rst:1347 +#: ../../library/asyncio-eventloop.rst:1371 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:1352 +#: ../../library/asyncio-eventloop.rst:1376 msgid "" "It is the application's responsibility to ensure that all whitespace and " "special characters are quoted appropriately to avoid `shell injection " @@ -1752,105 +1767,105 @@ msgid "" "used to construct shell commands." msgstr "" -#: ../../library/asyncio-eventloop.rst:1361 +#: ../../library/asyncio-eventloop.rst:1385 msgid "Callback Handles" msgstr "" -#: ../../library/asyncio-eventloop.rst:1365 +#: ../../library/asyncio-eventloop.rst:1389 msgid "" "A callback wrapper object returned by :meth:`loop.call_soon`, :meth:`loop." "call_soon_threadsafe`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1370 +#: ../../library/asyncio-eventloop.rst:1394 msgid "" "Cancel the callback. If the callback has already been canceled or executed, " "this method has no effect." msgstr "" -#: ../../library/asyncio-eventloop.rst:1375 +#: ../../library/asyncio-eventloop.rst:1399 msgid "Return ``True`` if the callback was cancelled." msgstr "" -#: ../../library/asyncio-eventloop.rst:1381 +#: ../../library/asyncio-eventloop.rst:1405 msgid "" "A callback wrapper object returned by :meth:`loop.call_later`, and :meth:" "`loop.call_at`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1384 +#: ../../library/asyncio-eventloop.rst:1408 msgid "This class is a subclass of :class:`Handle`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1388 +#: ../../library/asyncio-eventloop.rst:1412 msgid "Return a scheduled callback time as :class:`float` seconds." msgstr "" -#: ../../library/asyncio-eventloop.rst:1390 +#: ../../library/asyncio-eventloop.rst:1414 msgid "" "The time is an absolute timestamp, using the same time reference as :meth:" "`loop.time`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1397 +#: ../../library/asyncio-eventloop.rst:1421 msgid "Server Objects" msgstr "" -#: ../../library/asyncio-eventloop.rst:1399 +#: ../../library/asyncio-eventloop.rst:1423 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:1403 +#: ../../library/asyncio-eventloop.rst:1427 msgid "Do not instantiate the class directly." msgstr "" -#: ../../library/asyncio-eventloop.rst:1407 +#: ../../library/asyncio-eventloop.rst:1431 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:1420 +#: ../../library/asyncio-eventloop.rst:1444 msgid "Server object is an asynchronous context manager since Python 3.7." msgstr "" -#: ../../library/asyncio-eventloop.rst:1425 +#: ../../library/asyncio-eventloop.rst:1449 msgid "" "Stop serving: close listening sockets and set the :attr:`sockets` attribute " "to ``None``." msgstr "" -#: ../../library/asyncio-eventloop.rst:1428 +#: ../../library/asyncio-eventloop.rst:1452 msgid "" "The sockets that represent existing incoming client connections are left " "open." msgstr "" -#: ../../library/asyncio-eventloop.rst:1431 +#: ../../library/asyncio-eventloop.rst:1455 msgid "" "The server is closed asynchronously, use the :meth:`wait_closed` coroutine " "to wait until the server is closed." msgstr "" -#: ../../library/asyncio-eventloop.rst:1436 +#: ../../library/asyncio-eventloop.rst:1460 msgid "Return the event loop associated with the server object." msgstr "" -#: ../../library/asyncio-eventloop.rst:1442 +#: ../../library/asyncio-eventloop.rst:1466 msgid "Start accepting connections." msgstr "" -#: ../../library/asyncio-eventloop.rst:1444 +#: ../../library/asyncio-eventloop.rst:1468 msgid "" "This method is idempotent, so it can be called when the server is already " "being serving." msgstr "" -#: ../../library/asyncio-eventloop.rst:1447 +#: ../../library/asyncio-eventloop.rst:1471 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,96 +1874,96 @@ msgid "" "accepting connections." msgstr "" -#: ../../library/asyncio-eventloop.rst:1458 +#: ../../library/asyncio-eventloop.rst:1482 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:1462 +#: ../../library/asyncio-eventloop.rst:1486 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:1484 +#: ../../library/asyncio-eventloop.rst:1508 msgid "Return ``True`` if the server is accepting new connections." msgstr "" -#: ../../library/asyncio-eventloop.rst:1490 +#: ../../library/asyncio-eventloop.rst:1514 msgid "Wait until the :meth:`close` method completes." msgstr "" -#: ../../library/asyncio-eventloop.rst:1494 +#: ../../library/asyncio-eventloop.rst:1518 msgid "List of :class:`socket.socket` objects the server is listening on." msgstr "" -#: ../../library/asyncio-eventloop.rst:1496 +#: ../../library/asyncio-eventloop.rst:1520 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:1506 +#: ../../library/asyncio-eventloop.rst:1530 msgid "Event Loop Implementations" msgstr "" -#: ../../library/asyncio-eventloop.rst:1508 +#: ../../library/asyncio-eventloop.rst:1532 msgid "" "asyncio ships with two different event loop implementations: :class:" "`SelectorEventLoop` and :class:`ProactorEventLoop`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1511 +#: ../../library/asyncio-eventloop.rst:1535 msgid "" "By default asyncio is configured to use :class:`SelectorEventLoop` on Unix " "and :class:`ProactorEventLoop` on Windows." msgstr "" -#: ../../library/asyncio-eventloop.rst:1517 +#: ../../library/asyncio-eventloop.rst:1541 msgid "An event loop based on the :mod:`selectors` module." msgstr "" -#: ../../library/asyncio-eventloop.rst:1519 +#: ../../library/asyncio-eventloop.rst:1543 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:1534 +#: ../../library/asyncio-eventloop.rst:1558 msgid ":ref:`Availability `: Unix, Windows." msgstr ":ref:`適用 `:Unix、Windows。" -#: ../../library/asyncio-eventloop.rst:1539 +#: ../../library/asyncio-eventloop.rst:1563 msgid "An event loop for Windows that uses \"I/O Completion Ports\" (IOCP)." msgstr "" -#: ../../library/asyncio-eventloop.rst:1542 +#: ../../library/asyncio-eventloop.rst:1566 msgid ":ref:`Availability `: Windows." msgstr ":ref:`適用 `:Windows。" -#: ../../library/asyncio-eventloop.rst:1545 +#: ../../library/asyncio-eventloop.rst:1569 msgid "" "`MSDN documentation on I/O Completion Ports `_." msgstr "" -#: ../../library/asyncio-eventloop.rst:1551 +#: ../../library/asyncio-eventloop.rst:1575 msgid "Abstract base class for asyncio-compliant event loops." msgstr "" -#: ../../library/asyncio-eventloop.rst:1553 +#: ../../library/asyncio-eventloop.rst:1577 msgid "" "The :ref:`asyncio-event-loop-methods` section lists all methods that an " "alternative implementation of ``AbstractEventLoop`` should have defined." msgstr "" -#: ../../library/asyncio-eventloop.rst:1559 +#: ../../library/asyncio-eventloop.rst:1583 msgid "Examples" msgstr "範例" -#: ../../library/asyncio-eventloop.rst:1561 +#: ../../library/asyncio-eventloop.rst:1585 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." @@ -1956,70 +1971,70 @@ msgid "" "consider using the high-level functions like :func:`asyncio.run`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1571 +#: ../../library/asyncio-eventloop.rst:1595 msgid "Hello World with call_soon()" msgstr "" -#: ../../library/asyncio-eventloop.rst:1573 +#: ../../library/asyncio-eventloop.rst:1597 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:1597 +#: ../../library/asyncio-eventloop.rst:1621 msgid "" "A similar :ref:`Hello World ` example created with a coroutine " "and the :func:`run` function." msgstr "" -#: ../../library/asyncio-eventloop.rst:1604 +#: ../../library/asyncio-eventloop.rst:1628 msgid "Display the current date with call_later()" msgstr "" -#: ../../library/asyncio-eventloop.rst:1606 +#: ../../library/asyncio-eventloop.rst:1630 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:1634 +#: ../../library/asyncio-eventloop.rst:1658 msgid "" "A similar :ref:`current date ` example created with a " "coroutine and the :func:`run` function." msgstr "" -#: ../../library/asyncio-eventloop.rst:1641 +#: ../../library/asyncio-eventloop.rst:1665 msgid "Watch a file descriptor for read events" msgstr "" -#: ../../library/asyncio-eventloop.rst:1643 +#: ../../library/asyncio-eventloop.rst:1667 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:1681 +#: ../../library/asyncio-eventloop.rst:1705 msgid "" "A similar :ref:`example ` using " "transports, protocols, and the :meth:`loop.create_connection` method." msgstr "" -#: ../../library/asyncio-eventloop.rst:1685 +#: ../../library/asyncio-eventloop.rst:1709 msgid "" "Another similar :ref:`example ` " "using the high-level :func:`asyncio.open_connection` function and streams." msgstr "" -#: ../../library/asyncio-eventloop.rst:1693 +#: ../../library/asyncio-eventloop.rst:1717 msgid "Set signal handlers for SIGINT and SIGTERM" msgstr "" -#: ../../library/asyncio-eventloop.rst:1695 +#: ../../library/asyncio-eventloop.rst:1719 msgid "(This ``signals`` example only works on Unix.)" msgstr "" -#: ../../library/asyncio-eventloop.rst:1697 +#: ../../library/asyncio-eventloop.rst:1721 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-stream.po b/library/asyncio-stream.po index aed779710c..5defe97166 100644 --- a/library/asyncio-stream.po +++ b/library/asyncio-stream.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-02-19 00:13+0000\n" +"POT-Creation-Date: 2022-10-06 00:23+0000\n" "PO-Revision-Date: 2022-06-11 15:06+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -73,7 +73,7 @@ msgstr "" "回傳的 *reader* 和 *writer* 物件是 :class:`StreamReader` 和 :class:" "`StreamWriter` 類別的實例。" -#: ../../library/asyncio-stream.rst:63 ../../library/asyncio-stream.rst:99 +#: ../../library/asyncio-stream.rst:63 ../../library/asyncio-stream.rst:105 msgid "" "*limit* determines the buffer size limit used by the returned :class:" "`StreamReader` instance. By default the *limit* is set to 64 KiB." @@ -87,24 +87,31 @@ msgid "" "create_connection`." msgstr "其餘的引數會直接傳遞到 :meth:`loop.create_connection`。" -#: ../../library/asyncio-stream.rst:70 +#: ../../library/asyncio-stream.rst:72 ../../library/asyncio-stream.rst:140 +msgid "" +"The *sock* argument transfers ownership of the socket to the :class:" +"`StreamWriter` created. To close the socket, call its :meth:`~asyncio." +"StreamWriter.close` method." +msgstr "" + +#: ../../library/asyncio-stream.rst:76 msgid "Added the *ssl_handshake_timeout* parameter." msgstr "新增 *ssl_handshake_timeout* 參數。" -#: ../../library/asyncio-stream.rst:73 +#: ../../library/asyncio-stream.rst:79 msgid "Added *happy_eyeballs_delay* and *interleave* parameters." msgstr "" -#: ../../library/asyncio-stream.rst:76 ../../library/asyncio-stream.rst:109 -#: ../../library/asyncio-stream.rst:132 ../../library/asyncio-stream.rst:152 +#: ../../library/asyncio-stream.rst:82 ../../library/asyncio-stream.rst:121 +#: ../../library/asyncio-stream.rst:150 ../../library/asyncio-stream.rst:176 msgid "Removed the *loop* parameter." msgstr "移除 *loop* 參數。" -#: ../../library/asyncio-stream.rst:88 +#: ../../library/asyncio-stream.rst:94 msgid "Start a socket server." msgstr "啟動 socket 伺服器。" -#: ../../library/asyncio-stream.rst:90 +#: ../../library/asyncio-stream.rst:96 msgid "" "The *client_connected_cb* callback is called whenever a new client " "connection is established. It receives a ``(reader, writer)`` pair as two " @@ -115,7 +122,7 @@ msgstr "" "式會接收到一對引數 ``(reader, writer)``,分別為 :class:`StreamReader` 和 :" "class:`StreamWriter` 的實例。" -#: ../../library/asyncio-stream.rst:95 +#: ../../library/asyncio-stream.rst:101 msgid "" "*client_connected_cb* can be a plain callable or a :ref:`coroutine function " "`; if it is a coroutine function, it will be automatically " @@ -125,37 +132,43 @@ msgstr "" "ref:`協程函式 `;如果它是一個協程函式,它將自動作為 :class:`Task` " "來被排程。" -#: ../../library/asyncio-stream.rst:103 +#: ../../library/asyncio-stream.rst:109 msgid "" "The rest of the arguments are passed directly to :meth:`loop.create_server`." msgstr "剩下的引數將會直接傳遞給 :meth:`loop.create_server`。" -#: ../../library/asyncio-stream.rst:106 +#: ../../library/asyncio-stream.rst:114 ../../library/asyncio-stream.rst:166 +msgid "" +"The *sock* argument transfers ownership of the socket to the server created. " +"To close the socket, call the server's :meth:`~asyncio.Server.close` method." +msgstr "" + +#: ../../library/asyncio-stream.rst:118 msgid "Added the *ssl_handshake_timeout* and *start_serving* parameters." msgstr "新增 *ssl_handshake_timeout* 與 *start_serving* 參數。" -#: ../../library/asyncio-stream.rst:114 +#: ../../library/asyncio-stream.rst:126 msgid "Unix Sockets" msgstr "Unix Sockets" -#: ../../library/asyncio-stream.rst:119 +#: ../../library/asyncio-stream.rst:131 msgid "" "Establish a Unix socket connection and return a pair of ``(reader, writer)``." msgstr "建立一個 Unix socket 連線並回傳一對 ``(reader, writer)``。" -#: ../../library/asyncio-stream.rst:122 +#: ../../library/asyncio-stream.rst:134 msgid "Similar to :func:`open_connection` but operates on Unix sockets." msgstr "與 :func:`open_connection` 相似,但是是操作 Unix sockets。" -#: ../../library/asyncio-stream.rst:124 +#: ../../library/asyncio-stream.rst:136 msgid "See also the documentation of :meth:`loop.create_unix_connection`." msgstr "另請參閱 :meth:`loop.create_unix_connection` 文件。" -#: ../../library/asyncio-stream.rst:127 ../../library/asyncio-stream.rst:147 +#: ../../library/asyncio-stream.rst:145 ../../library/asyncio-stream.rst:171 msgid ":ref:`Availability `: Unix." msgstr ":ref:`適用 `:Unix。" -#: ../../library/asyncio-stream.rst:128 +#: ../../library/asyncio-stream.rst:146 msgid "" "Added the *ssl_handshake_timeout* parameter. The *path* parameter can now be " "a :term:`path-like object`" @@ -163,19 +176,19 @@ msgstr "" "新增 *ssl_handshake_timeout* 參數。*path* 參數現在可以是個 :term:`path-like " "object`" -#: ../../library/asyncio-stream.rst:140 +#: ../../library/asyncio-stream.rst:158 msgid "Start a Unix socket server." msgstr "啟動一個 Unix socket 伺服器。" -#: ../../library/asyncio-stream.rst:142 +#: ../../library/asyncio-stream.rst:160 msgid "Similar to :func:`start_server` but works with Unix sockets." msgstr "與 :func:`start_server` 相似,但會是操作 Unix sockets。" -#: ../../library/asyncio-stream.rst:144 +#: ../../library/asyncio-stream.rst:162 msgid "See also the documentation of :meth:`loop.create_unix_server`." msgstr "另請參閱 :meth:`loop.create_unix_server` 文件。" -#: ../../library/asyncio-stream.rst:148 +#: ../../library/asyncio-stream.rst:172 msgid "" "Added the *ssl_handshake_timeout* and *start_serving* parameters. The *path* " "parameter can now be a :term:`path-like object`." @@ -183,17 +196,17 @@ msgstr "" "新增 *ssl_handshake_timeout* 與 *start_serving* 參數。*path* 參數現在可以是" "個 :term:`path-like object`。" -#: ../../library/asyncio-stream.rst:157 +#: ../../library/asyncio-stream.rst:181 msgid "StreamReader" msgstr "StreamReader" -#: ../../library/asyncio-stream.rst:161 +#: ../../library/asyncio-stream.rst:185 msgid "" "Represents a reader object that provides APIs to read data from the IO " "stream." msgstr "表示一個有提供 API 來從 IO 串流中讀取資料的 reader 物件。" -#: ../../library/asyncio-stream.rst:164 +#: ../../library/asyncio-stream.rst:188 msgid "" "It is not recommended to instantiate *StreamReader* objects directly; use :" "func:`open_connection` and :func:`start_server` instead." @@ -201,7 +214,7 @@ msgstr "" "不建議直接實例化 *StreamReader* 物件;使用 :func:`open_connection` 和 :func:" "`start_server` 會是較好的做法。" -#: ../../library/asyncio-stream.rst:170 +#: ../../library/asyncio-stream.rst:194 msgid "" "Read up to *n* bytes. If *n* is not provided, or set to ``-1``, read until " "EOF and return all read bytes." @@ -209,34 +222,34 @@ msgstr "" "讀取至多 *n* 個位元組。如果沒有設定 *n* 或被設為 ``-1``,則表示要持續讀取直" "到 EOF 並回傳所有已讀取的位元組。" -#: ../../library/asyncio-stream.rst:173 +#: ../../library/asyncio-stream.rst:197 msgid "" "If EOF was received and the internal buffer is empty, return an empty " "``bytes`` object." msgstr "如果讀取到 EOF 且內部緩衝區是空的,則回傳一個空的 ``bytes`` 物件。" -#: ../../library/asyncio-stream.rst:178 +#: ../../library/asyncio-stream.rst:202 msgid "" "Read one line, where \"line\" is a sequence of bytes ending with ``\\n``." msgstr "讀取一行,其中\"行\"指的是以 ``\\n`` 結尾的位元組序列。" -#: ../../library/asyncio-stream.rst:181 +#: ../../library/asyncio-stream.rst:205 msgid "" "If EOF is received and ``\\n`` was not found, the method returns partially " "read data." msgstr "如果讀取到 EOF 而沒有找到 ``\\n``,該方法會回傳部分的已讀取資料。" -#: ../../library/asyncio-stream.rst:184 +#: ../../library/asyncio-stream.rst:208 msgid "" "If EOF is received and the internal buffer is empty, return an empty " "``bytes`` object." msgstr "如果讀取到 EOF 且內部緩衝區是空的,則回傳一個空的 ``bytes`` 物件。" -#: ../../library/asyncio-stream.rst:189 +#: ../../library/asyncio-stream.rst:213 msgid "Read exactly *n* bytes." msgstr "讀取剛好 *n* 個位元組。" -#: ../../library/asyncio-stream.rst:191 +#: ../../library/asyncio-stream.rst:215 msgid "" "Raise an :exc:`IncompleteReadError` if EOF is reached before *n* can be " "read. Use the :attr:`IncompleteReadError.partial` attribute to get the " @@ -246,11 +259,11 @@ msgstr "" "`IncompleteReadError`。使用 :attr:`IncompleteReadError.partial` 屬性來獲取串" "流結束前已讀取的部分資料。" -#: ../../library/asyncio-stream.rst:197 +#: ../../library/asyncio-stream.rst:221 msgid "Read data from the stream until *separator* is found." msgstr "從串流中持續讀取資料直到出現 *separator*。" -#: ../../library/asyncio-stream.rst:199 +#: ../../library/asyncio-stream.rst:223 msgid "" "On success, the data and separator will be removed from the internal buffer " "(consumed). Returned data will include the separator at the end." @@ -258,7 +271,7 @@ msgstr "" "成功後,資料和 separator(分隔符號)會從內部緩衝區中刪除(或者說是被消費掉 " "(consumed))。回傳的資料在末尾會有一個 separator。" -#: ../../library/asyncio-stream.rst:203 +#: ../../library/asyncio-stream.rst:227 msgid "" "If the amount of data read exceeds the configured stream limit, a :exc:" "`LimitOverrunError` exception is raised, and the data is left in the " @@ -267,7 +280,7 @@ msgstr "" "如果讀取的資料量超過了設定的串流限制,將會引發 :exc:`LimitOverrunError` 例" "外,資料將被留在內部緩衝區中,並可以再次被讀取。" -#: ../../library/asyncio-stream.rst:207 +#: ../../library/asyncio-stream.rst:231 msgid "" "If EOF is reached before the complete separator is found, an :exc:" "`IncompleteReadError` exception is raised, and the internal buffer is " @@ -278,20 +291,20 @@ msgstr "" "`IncompleteReadError` 例外,且內部緩衝區會被重置。:attr:`IncompleteReadError." "partial` 屬性可能包含一部分的 separator。" -#: ../../library/asyncio-stream.rst:216 +#: ../../library/asyncio-stream.rst:240 msgid "Return ``True`` if the buffer is empty and :meth:`feed_eof` was called." msgstr "如果緩衝區是空的且 :meth:`feed_eof` 曾被呼叫則回傳 ``True``。" -#: ../../library/asyncio-stream.rst:221 +#: ../../library/asyncio-stream.rst:245 msgid "StreamWriter" msgstr "StreamWriter" -#: ../../library/asyncio-stream.rst:225 +#: ../../library/asyncio-stream.rst:249 msgid "" "Represents a writer object that provides APIs to write data to the IO stream." msgstr "表示一個有提供 API 來將資料寫入 IO 串流的 writer 物件。" -#: ../../library/asyncio-stream.rst:228 +#: ../../library/asyncio-stream.rst:252 msgid "" "It is not recommended to instantiate *StreamWriter* objects directly; use :" "func:`open_connection` and :func:`start_server` instead." @@ -299,7 +312,7 @@ msgstr "" "不建議直接實例化 *StreamWriter* 物件;使用 :func:`open_connection` 和 :func:" "`start_server` 會是較好的做法。" -#: ../../library/asyncio-stream.rst:234 +#: ../../library/asyncio-stream.rst:258 msgid "" "The method attempts to write the *data* to the underlying socket " "immediately. If that fails, the data is queued in an internal write buffer " @@ -308,14 +321,14 @@ msgstr "" "此方法會嘗試立即將 *data* 寫入到底層的 socket。如果失敗,資料會被放到內部寫入" "緩衝中排隊等待 (queue),直到它可被發送。" -#: ../../library/asyncio-stream.rst:238 ../../library/asyncio-stream.rst:250 +#: ../../library/asyncio-stream.rst:262 ../../library/asyncio-stream.rst:274 msgid "The method should be used along with the ``drain()`` method::" msgstr "" "此方法應當與 ``drain()`` 方法一起使用:\n" "\n" "::" -#: ../../library/asyncio-stream.rst:245 +#: ../../library/asyncio-stream.rst:269 msgid "" "The method writes a list (or any iterable) of bytes to the underlying socket " "immediately. If that fails, the data is queued in an internal write buffer " @@ -324,18 +337,18 @@ msgstr "" "此方法會立即嘗試將一個位元組 list(或任何可疊代物件 (iterable))寫入到底層的 " "socket。如果失敗,資料會被放到內部寫入緩衝中排隊等待,直到它可被發送。" -#: ../../library/asyncio-stream.rst:257 +#: ../../library/asyncio-stream.rst:281 msgid "The method closes the stream and the underlying socket." msgstr "此方法會關閉串流以及底層的 socket。" -#: ../../library/asyncio-stream.rst:259 +#: ../../library/asyncio-stream.rst:283 msgid "The method should be used along with the ``wait_closed()`` method::" msgstr "" "此方法應與 ``wait_closed()`` 方法一起使用:\n" "\n" "::" -#: ../../library/asyncio-stream.rst:266 +#: ../../library/asyncio-stream.rst:290 msgid "" "Return ``True`` if the underlying transport supports the :meth:`write_eof` " "method, ``False`` otherwise." @@ -343,29 +356,29 @@ msgstr "" "如果底層的傳輸支援 :meth:`write_eof` 方法就回傳 ``True``,否則回傳 " "``False``。" -#: ../../library/asyncio-stream.rst:271 +#: ../../library/asyncio-stream.rst:295 msgid "" "Close the write end of the stream after the buffered write data is flushed." msgstr "在已緩衝的寫入資料被清理 (flush) 後關閉串流的寫入端。" -#: ../../library/asyncio-stream.rst:276 +#: ../../library/asyncio-stream.rst:300 msgid "Return the underlying asyncio transport." msgstr "回傳底層的 asyncio 傳輸。" -#: ../../library/asyncio-stream.rst:280 +#: ../../library/asyncio-stream.rst:304 msgid "" "Access optional transport information; see :meth:`BaseTransport." "get_extra_info` for details." msgstr "存取可選的傳輸資訊;詳情請見 :meth:`BaseTransport.get_extra_info`。" -#: ../../library/asyncio-stream.rst:285 +#: ../../library/asyncio-stream.rst:309 msgid "Wait until it is appropriate to resume writing to the stream. Example::" msgstr "" "等待直到可以繼續寫入到串流。範例:\n" "\n" "::" -#: ../../library/asyncio-stream.rst:291 +#: ../../library/asyncio-stream.rst:315 msgid "" "This is a flow control method that interacts with the underlying IO write " "buffer. When the size of the buffer reaches the high watermark, *drain()* " @@ -377,37 +390,37 @@ msgstr "" "(high watermark) 時,*drain()* 會阻塞直到緩衝區大小減少至最低標記位 (low " "watermark) 以便繼續寫入。當沒有要等待的資料時,:meth:`drain` 會立即回傳。" -#: ../../library/asyncio-stream.rst:300 +#: ../../library/asyncio-stream.rst:324 msgid "" "Return ``True`` if the stream is closed or in the process of being closed." msgstr "如果串流已被關閉或正在被關閉則回傳 ``True``。" -#: ../../library/asyncio-stream.rst:307 +#: ../../library/asyncio-stream.rst:331 msgid "Wait until the stream is closed." msgstr "等待直到串流被關閉。" -#: ../../library/asyncio-stream.rst:309 +#: ../../library/asyncio-stream.rst:333 msgid "" "Should be called after :meth:`close` to wait until the underlying connection " "is closed." msgstr "應當在 :meth:`close` 之後才被呼叫,這會持續等待直到底層的連線被關閉。" -#: ../../library/asyncio-stream.rst:316 +#: ../../library/asyncio-stream.rst:340 msgid "Examples" msgstr "範例" -#: ../../library/asyncio-stream.rst:321 +#: ../../library/asyncio-stream.rst:345 msgid "TCP echo client using streams" msgstr "使用串流的 TCP echo 客戶端" -#: ../../library/asyncio-stream.rst:323 +#: ../../library/asyncio-stream.rst:347 msgid "TCP echo client using the :func:`asyncio.open_connection` function::" msgstr "" "使用 :func:`asyncio.open_connection` 函式的 TCP echo 客戶端:\n" "\n" "::" -#: ../../library/asyncio-stream.rst:345 +#: ../../library/asyncio-stream.rst:369 msgid "" "The :ref:`TCP echo client protocol " "` example uses the low-level :meth:" @@ -416,18 +429,18 @@ msgstr "" "使用低階 :meth:`loop.create_connection` 方法的 :ref:`TCP echo 客戶端協定 " "`\\ 範例。" -#: ../../library/asyncio-stream.rst:352 +#: ../../library/asyncio-stream.rst:376 msgid "TCP echo server using streams" msgstr "使用串流的 TCP echo 伺服器" -#: ../../library/asyncio-stream.rst:354 +#: ../../library/asyncio-stream.rst:378 msgid "TCP echo server using the :func:`asyncio.start_server` function::" msgstr "" "TCP echo 伺服器使用 :func:`asyncio.start_server` 函式:\n" "\n" "::" -#: ../../library/asyncio-stream.rst:387 +#: ../../library/asyncio-stream.rst:411 msgid "" "The :ref:`TCP echo server protocol " "` example uses the :meth:`loop." @@ -436,11 +449,11 @@ msgstr "" "使用 :meth:`loop.create_server` 方法的 :ref:`TCP echo 伺服器協定 " "` 範例。" -#: ../../library/asyncio-stream.rst:392 +#: ../../library/asyncio-stream.rst:416 msgid "Get HTTP headers" msgstr "獲取 HTTP 標頭" -#: ../../library/asyncio-stream.rst:394 +#: ../../library/asyncio-stream.rst:418 msgid "" "Simple example querying HTTP headers of the URL passed on the command line::" msgstr "" @@ -448,25 +461,25 @@ msgstr "" "\n" "::" -#: ../../library/asyncio-stream.rst:432 +#: ../../library/asyncio-stream.rst:456 msgid "Usage::" msgstr "" "用法:\n" "\n" "::" -#: ../../library/asyncio-stream.rst:436 +#: ../../library/asyncio-stream.rst:460 msgid "or with HTTPS::" msgstr "" "或使用 HTTPS:\n" "\n" "::" -#: ../../library/asyncio-stream.rst:444 +#: ../../library/asyncio-stream.rst:468 msgid "Register an open socket to wait for data using streams" msgstr "註冊一個使用串流來等待資料的開放 socket" -#: ../../library/asyncio-stream.rst:446 +#: ../../library/asyncio-stream.rst:470 msgid "" "Coroutine waiting until a socket receives data using the :func:" "`open_connection` function::" @@ -475,7 +488,7 @@ msgstr "" "\n" "::" -#: ../../library/asyncio-stream.rst:480 +#: ../../library/asyncio-stream.rst:504 msgid "" "The :ref:`register an open socket to wait for data using a protocol " "` example uses a low-level protocol and " @@ -485,7 +498,7 @@ msgstr "" "`\\ 範例中,有使用了低階協定以及 :meth:" "`loop.create_connection` 方法。" -#: ../../library/asyncio-stream.rst:484 +#: ../../library/asyncio-stream.rst:508 msgid "" "The :ref:`watch a file descriptor for read events " "` example uses the low-level :meth:`loop." diff --git a/library/ctypes.po b/library/ctypes.po index 8195ec6ae6..d305b386c8 100644 --- a/library/ctypes.po +++ b/library/ctypes.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-10-06 00:23+0000\n" "PO-Revision-Date: 2018-05-23 14:42+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -193,9 +193,9 @@ msgid "" "``None``, integers, bytes objects and (unicode) strings are the only native " "Python objects that can directly be used as parameters in these function " "calls. ``None`` is passed as a C ``NULL`` pointer, bytes objects and strings " -"are passed as pointer to the memory block that contains their data (:c:type:" -"`char *` or :c:type:`wchar_t *`). Python integers are passed as the " -"platforms default C :c:type:`int` type, their value is masked to fit into " +"are passed as pointer to the memory block that contains their data (:c:expr:" +"`char *` or :c:expr:`wchar_t *`). Python integers are passed as the " +"platforms default C :c:expr:`int` type, their value is masked to fit into " "the C type." msgstr "" @@ -230,7 +230,8 @@ msgid ":class:`c_bool`" msgstr ":class:`c_bool`" #: ../../library/ctypes.rst:218 -msgid ":c:type:`_Bool`" +#, fuzzy +msgid ":c:expr:`_Bool`" msgstr ":c:type:`_Bool`" #: ../../library/ctypes.rst:218 @@ -242,7 +243,8 @@ msgid ":class:`c_char`" msgstr ":class:`c_char`" #: ../../library/ctypes.rst:220 ../../library/ctypes.rst:224 -msgid ":c:type:`char`" +#, fuzzy +msgid ":c:expr:`char`" msgstr ":c:type:`char`" #: ../../library/ctypes.rst:220 @@ -254,7 +256,8 @@ msgid ":class:`c_wchar`" msgstr ":class:`c_wchar`" #: ../../library/ctypes.rst:222 -msgid ":c:type:`wchar_t`" +#, fuzzy +msgid ":c:expr:`wchar_t`" msgstr ":c:type:`wchar_t`" #: ../../library/ctypes.rst:222 @@ -279,7 +282,8 @@ msgid ":class:`c_ubyte`" msgstr ":class:`c_ubyte`" #: ../../library/ctypes.rst:226 -msgid ":c:type:`unsigned char`" +#, fuzzy +msgid ":c:expr:`unsigned char`" msgstr ":c:type:`unsigned char`" #: ../../library/ctypes.rst:228 @@ -287,7 +291,8 @@ msgid ":class:`c_short`" msgstr ":class:`c_short`" #: ../../library/ctypes.rst:228 -msgid ":c:type:`short`" +#, fuzzy +msgid ":c:expr:`short`" msgstr ":c:type:`short`" #: ../../library/ctypes.rst:230 @@ -295,7 +300,8 @@ msgid ":class:`c_ushort`" msgstr ":class:`c_ushort`" #: ../../library/ctypes.rst:230 -msgid ":c:type:`unsigned short`" +#, fuzzy +msgid ":c:expr:`unsigned short`" msgstr ":c:type:`unsigned short`" #: ../../library/ctypes.rst:232 @@ -303,7 +309,8 @@ msgid ":class:`c_int`" msgstr ":class:`c_int`" #: ../../library/ctypes.rst:232 -msgid ":c:type:`int`" +#, fuzzy +msgid ":c:expr:`int`" msgstr ":c:type:`int`" #: ../../library/ctypes.rst:234 @@ -311,7 +318,8 @@ msgid ":class:`c_uint`" msgstr ":class:`c_uint`" #: ../../library/ctypes.rst:234 -msgid ":c:type:`unsigned int`" +#, fuzzy +msgid ":c:expr:`unsigned int`" msgstr ":c:type:`unsigned int`" #: ../../library/ctypes.rst:236 @@ -319,7 +327,8 @@ msgid ":class:`c_long`" msgstr ":class:`c_long`" #: ../../library/ctypes.rst:236 -msgid ":c:type:`long`" +#, fuzzy +msgid ":c:expr:`long`" msgstr ":c:type:`long`" #: ../../library/ctypes.rst:238 @@ -327,7 +336,8 @@ msgid ":class:`c_ulong`" msgstr ":class:`c_ulong`" #: ../../library/ctypes.rst:238 -msgid ":c:type:`unsigned long`" +#, fuzzy +msgid ":c:expr:`unsigned long`" msgstr ":c:type:`unsigned long`" #: ../../library/ctypes.rst:240 @@ -335,7 +345,8 @@ msgid ":class:`c_longlong`" msgstr ":class:`c_longlong`" #: ../../library/ctypes.rst:240 -msgid ":c:type:`__int64` or :c:type:`long long`" +#, fuzzy +msgid ":c:expr:`__int64` or :c:expr:`long long`" msgstr ":c:type:`__int64` 或 :c:type:`long long`" #: ../../library/ctypes.rst:242 @@ -343,7 +354,8 @@ msgid ":class:`c_ulonglong`" msgstr ":class:`c_ulonglong`" #: ../../library/ctypes.rst:242 -msgid ":c:type:`unsigned __int64` or :c:type:`unsigned long long`" +#, fuzzy +msgid ":c:expr:`unsigned __int64` or :c:expr:`unsigned long long`" msgstr ":c:type:`unsigned __int64` 或 :c:type:`unsigned long long`" #: ../../library/ctypes.rst:245 @@ -351,7 +363,8 @@ msgid ":class:`c_size_t`" msgstr ":class:`c_size_t`" #: ../../library/ctypes.rst:245 -msgid ":c:type:`size_t`" +#, fuzzy +msgid ":c:expr:`size_t`" msgstr ":c:type:`size_t`" #: ../../library/ctypes.rst:247 @@ -359,7 +372,8 @@ msgid ":class:`c_ssize_t`" msgstr ":class:`c_ssize_t`" #: ../../library/ctypes.rst:247 -msgid ":c:type:`ssize_t` or :c:type:`Py_ssize_t`" +#, fuzzy +msgid ":c:expr:`ssize_t` or :c:expr:`Py_ssize_t`" msgstr ":c:type:`ssize_t` 或 :c:type:`Py_ssize_t`" #: ../../library/ctypes.rst:250 @@ -367,7 +381,8 @@ msgid ":class:`c_float`" msgstr ":class:`c_float`" #: ../../library/ctypes.rst:250 -msgid ":c:type:`float`" +#, fuzzy +msgid ":c:expr:`float`" msgstr ":c:type:`float`" #: ../../library/ctypes.rst:250 ../../library/ctypes.rst:252 @@ -380,7 +395,8 @@ msgid ":class:`c_double`" msgstr ":class:`c_double`" #: ../../library/ctypes.rst:252 -msgid ":c:type:`double`" +#, fuzzy +msgid ":c:expr:`double`" msgstr ":c:type:`double`" #: ../../library/ctypes.rst:254 @@ -388,7 +404,8 @@ msgid ":class:`c_longdouble`" msgstr ":class:`c_longdouble`" #: ../../library/ctypes.rst:254 -msgid ":c:type:`long double`" +#, fuzzy +msgid ":c:expr:`long double`" msgstr ":c:type:`long double`" #: ../../library/ctypes.rst:256 @@ -396,7 +413,7 @@ msgid ":class:`c_char_p`" msgstr ":class:`c_char_p`" #: ../../library/ctypes.rst:256 -msgid ":c:type:`char *` (NUL terminated)" +msgid ":c:expr:`char *` (NUL terminated)" msgstr "" #: ../../library/ctypes.rst:256 @@ -408,7 +425,7 @@ msgid ":class:`c_wchar_p`" msgstr ":class:`c_wchar_p`" #: ../../library/ctypes.rst:258 -msgid ":c:type:`wchar_t *` (NUL terminated)" +msgid ":c:expr:`wchar_t *` (NUL terminated)" msgstr "" #: ../../library/ctypes.rst:258 @@ -420,7 +437,8 @@ msgid ":class:`c_void_p`" msgstr ":class:`c_void_p`" #: ../../library/ctypes.rst:260 -msgid ":c:type:`void *`" +#, fuzzy +msgid ":c:expr:`void *`" msgstr ":c:type:`void *`" #: ../../library/ctypes.rst:260 @@ -465,7 +483,7 @@ msgid "" "The :func:`create_string_buffer` function replaces the :func:`c_buffer` " "function (which is still available as an alias), as well as the :func:" "`c_string` function from earlier ctypes releases. To create a mutable " -"memory block containing unicode characters of the C type :c:type:`wchar_t` " +"memory block containing unicode characters of the C type :c:expr:`wchar_t` " "use the :func:`create_unicode_buffer` function." msgstr "" @@ -550,7 +568,7 @@ msgstr "" #: ../../library/ctypes.rst:447 msgid "" -"By default functions are assumed to return the C :c:type:`int` type. Other " +"By default functions are assumed to return the C :c:expr:`int` type. Other " "return types can be specified by setting the :attr:`restype` attribute of " "the function object." msgstr "" @@ -1024,7 +1042,7 @@ msgstr "" #: ../../library/ctypes.rst:1078 msgid "" -"This pointer is initialized to point to an array of :c:type:`struct _frozen` " +"This pointer is initialized to point to an array of :c:struct:`_frozen` " "records, terminated by one whose members are all ``NULL`` or zero. When a " "frozen module is imported, it is searched in this table. Third-party code " "could play tricks with this to provide a dynamically created collection of " @@ -1039,8 +1057,8 @@ msgstr "" #: ../../library/ctypes.rst:1095 msgid "" -"We have defined the :c:type:`struct _frozen` data type, so we can get the " -"pointer to the table::" +"We have defined the :c:struct:`_frozen` data type, so we can get the pointer " +"to the table::" msgstr "" #: ../../library/ctypes.rst:1102 @@ -1245,7 +1263,7 @@ msgstr "" msgid "" "Instances of this class represent loaded shared libraries. Functions in " "these libraries use the standard C calling convention, and are assumed to " -"return :c:type:`int`." +"return :c:expr:`int`." msgstr "" #: ../../library/ctypes.rst:1329 @@ -1284,7 +1302,7 @@ msgstr "" msgid "" "Windows only: Instances of this class represent loaded shared libraries, " "functions in these libraries use the ``stdcall`` calling convention, and are " -"assumed to return :c:type:`int` by default." +"assumed to return :c:expr:`int` by default." msgstr "" #: ../../library/ctypes.rst:1364 @@ -1460,7 +1478,7 @@ msgstr "" #: ../../library/ctypes.rst:1516 msgid "" "An instance of :class:`PyDLL` that exposes Python C API functions as " -"attributes. Note that all these functions are assumed to return C :c:type:" +"attributes. Note that all these functions are assumed to return C :c:expr:" "`int`, which is of course not always the truth, so you have to assign the " "correct :attr:`restype` attribute to use these functions." msgstr "" @@ -1536,13 +1554,13 @@ msgstr "" #: ../../library/ctypes.rst:1563 msgid "" "Assign a ctypes type to specify the result type of the foreign function. Use " -"``None`` for :c:type:`void`, a function not returning anything." +"``None`` for :c:expr:`void`, a function not returning anything." msgstr "" #: ../../library/ctypes.rst:1566 msgid "" "It is possible to assign a callable Python object that is not a ctypes type, " -"in this case the function is assumed to return a C :c:type:`int`, and the " +"in this case the function is assumed to return a C :c:expr:`int`, and the " "callable will be called with this integer, allowing further processing or " "error checking. Using this is deprecated, for more flexible post processing " "or error checking use a ctypes data type as :attr:`restype` and assign a " @@ -2271,21 +2289,21 @@ msgstr "" #: ../../library/ctypes.rst:2180 msgid "" -"Represents the C :c:type:`signed char` datatype, and interprets the value as " +"Represents the C :c:expr:`signed char` datatype, and interprets the value as " "small integer. The constructor accepts an optional integer initializer; no " "overflow checking is done." msgstr "" #: ../../library/ctypes.rst:2187 msgid "" -"Represents the C :c:type:`char` datatype, and interprets the value as a " +"Represents the C :c:expr:`char` datatype, and interprets the value as a " "single character. The constructor accepts an optional string initializer, " "the length of the string must be exactly one character." msgstr "" #: ../../library/ctypes.rst:2194 msgid "" -"Represents the C :c:type:`char *` datatype when it points to a zero-" +"Represents the C :c:expr:`char *` datatype when it points to a zero-" "terminated string. For a general character pointer that may also point to " "binary data, ``POINTER(c_char)`` must be used. The constructor accepts an " "integer address, or a bytes object." @@ -2293,69 +2311,69 @@ msgstr "" #: ../../library/ctypes.rst:2202 msgid "" -"Represents the C :c:type:`double` datatype. The constructor accepts an " +"Represents the C :c:expr:`double` datatype. The constructor accepts an " "optional float initializer." msgstr "" #: ../../library/ctypes.rst:2208 msgid "" -"Represents the C :c:type:`long double` datatype. The constructor accepts an " +"Represents the C :c:expr:`long double` datatype. The constructor accepts an " "optional float initializer. On platforms where ``sizeof(long double) == " "sizeof(double)`` it is an alias to :class:`c_double`." msgstr "" #: ../../library/ctypes.rst:2214 msgid "" -"Represents the C :c:type:`float` datatype. The constructor accepts an " +"Represents the C :c:expr:`float` datatype. The constructor accepts an " "optional float initializer." msgstr "" #: ../../library/ctypes.rst:2220 msgid "" -"Represents the C :c:type:`signed int` datatype. The constructor accepts an " +"Represents the C :c:expr:`signed int` datatype. The constructor accepts an " "optional integer initializer; no overflow checking is done. On platforms " "where ``sizeof(int) == sizeof(long)`` it is an alias to :class:`c_long`." msgstr "" #: ../../library/ctypes.rst:2227 msgid "" -"Represents the C 8-bit :c:type:`signed int` datatype. Usually an alias for :" +"Represents the C 8-bit :c:expr:`signed int` datatype. Usually an alias for :" "class:`c_byte`." msgstr "" #: ../../library/ctypes.rst:2233 msgid "" -"Represents the C 16-bit :c:type:`signed int` datatype. Usually an alias " +"Represents the C 16-bit :c:expr:`signed int` datatype. Usually an alias " "for :class:`c_short`." msgstr "" #: ../../library/ctypes.rst:2239 msgid "" -"Represents the C 32-bit :c:type:`signed int` datatype. Usually an alias " +"Represents the C 32-bit :c:expr:`signed int` datatype. Usually an alias " "for :class:`c_int`." msgstr "" #: ../../library/ctypes.rst:2245 msgid "" -"Represents the C 64-bit :c:type:`signed int` datatype. Usually an alias " +"Represents the C 64-bit :c:expr:`signed int` datatype. Usually an alias " "for :class:`c_longlong`." msgstr "" #: ../../library/ctypes.rst:2251 msgid "" -"Represents the C :c:type:`signed long` datatype. The constructor accepts an " +"Represents the C :c:expr:`signed long` datatype. The constructor accepts an " "optional integer initializer; no overflow checking is done." msgstr "" #: ../../library/ctypes.rst:2257 msgid "" -"Represents the C :c:type:`signed long long` datatype. The constructor " +"Represents the C :c:expr:`signed long long` datatype. The constructor " "accepts an optional integer initializer; no overflow checking is done." msgstr "" #: ../../library/ctypes.rst:2263 msgid "" -"Represents the C :c:type:`signed short` datatype. The constructor accepts " +"Represents the C :c:expr:`signed short` datatype. The constructor accepts " "an optional integer initializer; no overflow checking is done." msgstr "" @@ -2369,83 +2387,83 @@ msgstr "" #: ../../library/ctypes.rst:2281 msgid "" -"Represents the C :c:type:`unsigned char` datatype, it interprets the value " +"Represents the C :c:expr:`unsigned char` datatype, it interprets the value " "as small integer. The constructor accepts an optional integer initializer; " "no overflow checking is done." msgstr "" #: ../../library/ctypes.rst:2288 msgid "" -"Represents the C :c:type:`unsigned int` datatype. The constructor accepts " +"Represents the C :c:expr:`unsigned int` datatype. The constructor accepts " "an optional integer initializer; no overflow checking is done. On platforms " "where ``sizeof(int) == sizeof(long)`` it is an alias for :class:`c_ulong`." msgstr "" #: ../../library/ctypes.rst:2295 msgid "" -"Represents the C 8-bit :c:type:`unsigned int` datatype. Usually an alias " +"Represents the C 8-bit :c:expr:`unsigned int` datatype. Usually an alias " "for :class:`c_ubyte`." msgstr "" #: ../../library/ctypes.rst:2301 msgid "" -"Represents the C 16-bit :c:type:`unsigned int` datatype. Usually an alias " +"Represents the C 16-bit :c:expr:`unsigned int` datatype. Usually an alias " "for :class:`c_ushort`." msgstr "" #: ../../library/ctypes.rst:2307 msgid "" -"Represents the C 32-bit :c:type:`unsigned int` datatype. Usually an alias " +"Represents the C 32-bit :c:expr:`unsigned int` datatype. Usually an alias " "for :class:`c_uint`." msgstr "" #: ../../library/ctypes.rst:2313 msgid "" -"Represents the C 64-bit :c:type:`unsigned int` datatype. Usually an alias " +"Represents the C 64-bit :c:expr:`unsigned int` datatype. Usually an alias " "for :class:`c_ulonglong`." msgstr "" #: ../../library/ctypes.rst:2319 msgid "" -"Represents the C :c:type:`unsigned long` datatype. The constructor accepts " +"Represents the C :c:expr:`unsigned long` datatype. The constructor accepts " "an optional integer initializer; no overflow checking is done." msgstr "" #: ../../library/ctypes.rst:2325 msgid "" -"Represents the C :c:type:`unsigned long long` datatype. The constructor " +"Represents the C :c:expr:`unsigned long long` datatype. The constructor " "accepts an optional integer initializer; no overflow checking is done." msgstr "" #: ../../library/ctypes.rst:2331 msgid "" -"Represents the C :c:type:`unsigned short` datatype. The constructor accepts " +"Represents the C :c:expr:`unsigned short` datatype. The constructor accepts " "an optional integer initializer; no overflow checking is done." msgstr "" #: ../../library/ctypes.rst:2337 msgid "" -"Represents the C :c:type:`void *` type. The value is represented as " +"Represents the C :c:expr:`void *` type. The value is represented as " "integer. The constructor accepts an optional integer initializer." msgstr "" #: ../../library/ctypes.rst:2343 msgid "" -"Represents the C :c:type:`wchar_t` datatype, and interprets the value as a " +"Represents the C :c:expr:`wchar_t` datatype, and interprets the value as a " "single character unicode string. The constructor accepts an optional string " "initializer, the length of the string must be exactly one character." msgstr "" #: ../../library/ctypes.rst:2350 msgid "" -"Represents the C :c:type:`wchar_t *` datatype, which must be a pointer to a " +"Represents the C :c:expr:`wchar_t *` datatype, which must be a pointer to a " "zero-terminated wide character string. The constructor accepts an integer " "address, or a string." msgstr "" #: ../../library/ctypes.rst:2357 msgid "" -"Represent the C :c:type:`bool` datatype (more accurately, :c:type:`_Bool` " +"Represent the C :c:expr:`bool` datatype (more accurately, :c:expr:`_Bool` " "from C99). Its value can be ``True`` or ``False``, and the constructor " "accepts any object that has a truth value." msgstr "" @@ -2458,8 +2476,8 @@ msgstr "" #: ../../library/ctypes.rst:2370 msgid "" -"Represents the C :c:type:`PyObject *` datatype. Calling this without an " -"argument creates a ``NULL`` :c:type:`PyObject *` pointer." +"Represents the C :c:expr:`PyObject *` datatype. Calling this without an " +"argument creates a ``NULL`` :c:expr:`PyObject *` pointer." msgstr "" #: ../../library/ctypes.rst:2373 diff --git a/library/posix.po b/library/posix.po index a106eeeff7..162aa2659f 100644 --- a/library/posix.po +++ b/library/posix.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-06-10 00:16+0000\n" +"POT-Creation-Date: 2022-10-06 00:23+0000\n" "PO-Revision-Date: 2015-12-09 17:51+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -55,8 +55,8 @@ msgstr "" #: ../../library/posix.rst:40 msgid "" "Several operating systems (including AIX and Solaris) provide support for " -"files that are larger than 2 GiB from a C programming model where :c:type:" -"`int` and :c:type:`long` are 32-bit values. This is typically accomplished " +"files that are larger than 2 GiB from a C programming model where :c:expr:" +"`int` and :c:expr:`long` are 32-bit values. This is typically accomplished " "by defining the relevant size and offset types as 64-bit values. Such files " "are sometimes referred to as :dfn:`large files`." msgstr "" @@ -64,7 +64,7 @@ msgstr "" #: ../../library/posix.rst:46 msgid "" "Large file support is enabled in Python when the size of an :c:type:`off_t` " -"is larger than a :c:type:`long` and the :c:type:`long long` is at least as " +"is larger than a :c:expr:`long` and the :c:expr:`long long` is at least as " "large as an :c:type:`off_t`. It may be necessary to configure and compile " "Python with certain compiler flags to enable this mode. For example, with " "Solaris 2.6 and 2.7 you need to do something like::" diff --git a/library/socket.po b/library/socket.po index bb3a064403..83aa6864c5 100644 --- a/library/socket.po +++ b/library/socket.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-10-06 00:23+0000\n" "PO-Revision-Date: 2018-05-23 16:10+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1131,9 +1131,8 @@ msgid "" "Convert an IPv4 address from dotted-quad string format (for example, " "'123.45.67.89') to 32-bit packed binary format, as a bytes object four " "characters in length. This is useful when conversing with a program that " -"uses the standard C library and needs objects of type :c:type:`struct " -"in_addr`, which is the C type for the 32-bit packed binary this function " -"returns." +"uses the standard C library and needs objects of type :c:struct:`in_addr`, " +"which is the C type for the 32-bit packed binary this function returns." msgstr "" #: ../../library/socket.rst:954 @@ -1160,9 +1159,9 @@ msgid "" "Convert a 32-bit packed IPv4 address (a :term:`bytes-like object` four bytes " "in length) to its standard dotted-quad string representation (for example, " "'123.45.67.89'). This is useful when conversing with a program that uses " -"the standard C library and needs objects of type :c:type:`struct in_addr`, " -"which is the C type for the 32-bit packed binary data this function takes as " -"an argument." +"the standard C library and needs objects of type :c:struct:`in_addr`, which " +"is the C type for the 32-bit packed binary data this function takes as an " +"argument." msgstr "" #: ../../library/socket.rst:974 @@ -1177,8 +1176,8 @@ msgstr "" msgid "" "Convert an IP address from its family-specific string format to a packed, " "binary format. :func:`inet_pton` is useful when a library or network " -"protocol calls for an object of type :c:type:`struct in_addr` (similar to :" -"func:`inet_aton`) or :c:type:`struct in6_addr`." +"protocol calls for an object of type :c:struct:`in_addr` (similar to :func:" +"`inet_aton`) or :c:struct:`in6_addr`." msgstr "" #: ../../library/socket.rst:990 @@ -1204,8 +1203,8 @@ msgid "" "Convert a packed IP address (a :term:`bytes-like object` of some number of " "bytes) to its standard, family-specific string representation (for example, " "``'7.10.0.5'`` or ``'5aef:2b::8'``). :func:`inet_ntop` is useful when a " -"library or network protocol returns an object of type :c:type:`struct " -"in_addr` (similar to :func:`inet_ntoa`) or :c:type:`struct in6_addr`." +"library or network protocol returns an object of type :c:struct:`in_addr` " +"(similar to :func:`inet_ntoa`) or :c:struct:`in6_addr`." msgstr "" #: ../../library/socket.rst:1011 @@ -1702,7 +1701,7 @@ msgid "" "sockets), :meth:`recvmsg` will return, in its ancillary data, items of the " "form ``(socket.SOL_SOCKET, socket.SCM_RIGHTS, fds)``, where *fds* is a :" "class:`bytes` object representing the new file descriptors as a binary array " -"of the native C :c:type:`int` type. If :meth:`recvmsg` raises an exception " +"of the native C :c:expr:`int` type. If :meth:`recvmsg` raises an exception " "after the system call returns, it will first attempt to close any file " "descriptors received via this mechanism." msgstr "" diff --git a/library/sqlite3.po b/library/sqlite3.po index 0cb830b77c..5bf9b036eb 100644 --- a/library/sqlite3.po +++ b/library/sqlite3.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-09-16 10:07+0000\n" +"POT-Creation-Date: 2022-10-06 00:23+0000\n" "PO-Revision-Date: 2018-05-23 16:10+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -624,7 +624,7 @@ msgstr "新增 *deterministic* 參數。" #: ../../library/sqlite3.rst:589 ../../library/sqlite3.rst:627 #: ../../library/sqlite3.rst:846 ../../library/sqlite3.rst:952 #: ../../library/sqlite3.rst:982 ../../library/sqlite3.rst:1087 -#: ../../library/sqlite3.rst:1108 ../../library/sqlite3.rst:1245 +#: ../../library/sqlite3.rst:1108 ../../library/sqlite3.rst:1247 msgid "Example:" msgstr "範例:" @@ -1012,17 +1012,18 @@ msgstr "" #: ../../library/sqlite3.rst:1124 msgid "" -"Return the next row of a query result set as a :class:`tuple`. Return " -"``None`` if no more data is available." +"If :attr:`~Connection.row_factory` is ``None``, return the next row query " +"result set as a :class:`tuple`. Else, pass it to the row factory and return " +"its result. Return ``None`` if no more data is available." msgstr "" -#: ../../library/sqlite3.rst:1130 +#: ../../library/sqlite3.rst:1132 msgid "" "Return the next set of rows of a query result as a :class:`list`. Return an " "empty list if no more rows are available." msgstr "" -#: ../../library/sqlite3.rst:1133 +#: ../../library/sqlite3.rst:1135 msgid "" "The number of rows to fetch per call is specified by the *size* parameter. " "If *size* is not given, :attr:`arraysize` determines the number of rows to " @@ -1030,7 +1031,7 @@ msgid "" "available are returned." msgstr "" -#: ../../library/sqlite3.rst:1139 +#: ../../library/sqlite3.rst:1141 msgid "" "Note there are performance considerations involved with the *size* " "parameter. For optimal performance, it is usually best to use the arraysize " @@ -1038,36 +1039,36 @@ msgid "" "the same value from one :meth:`fetchmany` call to the next." msgstr "" -#: ../../library/sqlite3.rst:1146 +#: ../../library/sqlite3.rst:1148 msgid "" "Return all (remaining) rows of a query result as a :class:`list`. Return an " "empty list if no rows are available. Note that the :attr:`arraysize` " "attribute can affect the performance of this operation." msgstr "" -#: ../../library/sqlite3.rst:1153 +#: ../../library/sqlite3.rst:1155 msgid "Close the cursor now (rather than whenever ``__del__`` is called)." msgstr "" -#: ../../library/sqlite3.rst:1155 +#: ../../library/sqlite3.rst:1157 msgid "" "The cursor will be unusable from this point forward; a :exc:" "`ProgrammingError` exception will be raised if any operation is attempted " "with the cursor." msgstr "" -#: ../../library/sqlite3.rst:1160 ../../library/sqlite3.rst:1164 +#: ../../library/sqlite3.rst:1162 ../../library/sqlite3.rst:1166 msgid "Required by the DB-API. Does nothing in :mod:`!sqlite3`." msgstr "" -#: ../../library/sqlite3.rst:1168 +#: ../../library/sqlite3.rst:1170 msgid "" "Read/write attribute that controls the number of rows returned by :meth:" "`fetchmany`. The default value is 1 which means a single row would be " "fetched per call." msgstr "" -#: ../../library/sqlite3.rst:1173 +#: ../../library/sqlite3.rst:1175 msgid "" "Read-only attribute that provides the SQLite database :class:`Connection` " "belonging to the cursor. A :class:`Cursor` object created by calling :meth:" @@ -1075,18 +1076,18 @@ msgid "" "that refers to *con*:" msgstr "" -#: ../../library/sqlite3.rst:1187 +#: ../../library/sqlite3.rst:1189 msgid "" "Read-only attribute that provides the column names of the last query. To " "remain compatible with the Python DB API, it returns a 7-tuple for each " "column where the last six items of each tuple are ``None``." msgstr "" -#: ../../library/sqlite3.rst:1191 +#: ../../library/sqlite3.rst:1193 msgid "It is set for ``SELECT`` statements without any matching rows as well." msgstr "" -#: ../../library/sqlite3.rst:1195 +#: ../../library/sqlite3.rst:1197 msgid "" "Read-only attribute that provides the row id of the last inserted row. It is " "only updated after successful ``INSERT`` or ``REPLACE`` statements using " @@ -1096,15 +1097,15 @@ msgid "" "``None``." msgstr "" -#: ../../library/sqlite3.rst:1203 +#: ../../library/sqlite3.rst:1205 msgid "Inserts into ``WITHOUT ROWID`` tables are not recorded." msgstr "" -#: ../../library/sqlite3.rst:1205 +#: ../../library/sqlite3.rst:1207 msgid "Added support for the ``REPLACE`` statement." msgstr "新增 ``REPLACE`` 陳述式的支援。" -#: ../../library/sqlite3.rst:1210 +#: ../../library/sqlite3.rst:1212 msgid "" "Read-only attribute that provides the number of modified rows for " "``INSERT``, ``UPDATE``, ``DELETE``, and ``REPLACE`` statements; is ``-1`` " @@ -1113,11 +1114,11 @@ msgid "" "methods." msgstr "" -#: ../../library/sqlite3.rst:1225 +#: ../../library/sqlite3.rst:1227 msgid "Row objects" msgstr "" -#: ../../library/sqlite3.rst:1229 +#: ../../library/sqlite3.rst:1231 msgid "" "A :class:`!Row` instance serves as a highly optimized :attr:`~Connection." "row_factory` for :class:`Connection` objects. It supports iteration, " @@ -1125,41 +1126,41 @@ msgid "" "index." msgstr "" -#: ../../library/sqlite3.rst:1234 +#: ../../library/sqlite3.rst:1236 msgid "Two row objects compare equal if have equal columns and equal members." msgstr "" -#: ../../library/sqlite3.rst:1238 +#: ../../library/sqlite3.rst:1240 msgid "" "Return a :class:`list` of column names as :class:`strings `. " "Immediately after a query, it is the first member of each tuple in :attr:" "`Cursor.description`." msgstr "" -#: ../../library/sqlite3.rst:1242 +#: ../../library/sqlite3.rst:1244 msgid "Added support of slicing." msgstr "" -#: ../../library/sqlite3.rst:1262 +#: ../../library/sqlite3.rst:1264 msgid "PrepareProtocol objects" msgstr "" -#: ../../library/sqlite3.rst:1266 +#: ../../library/sqlite3.rst:1268 msgid "" "The PrepareProtocol type's single purpose is to act as a :pep:`246` style " "adaption protocol for objects that can :ref:`adapt themselves ` to :ref:`native SQLite types `." msgstr "" -#: ../../library/sqlite3.rst:1274 +#: ../../library/sqlite3.rst:1276 msgid "Exceptions" msgstr "例外" -#: ../../library/sqlite3.rst:1276 +#: ../../library/sqlite3.rst:1278 msgid "The exception hierarchy is defined by the DB-API 2.0 (:pep:`249`)." msgstr "" -#: ../../library/sqlite3.rst:1280 +#: ../../library/sqlite3.rst:1282 msgid "" "This exception is raised by :mod:`!sqlite3` if an SQL query is not a :class:" "`string `, or if multiple statements are passed to :meth:`~Cursor." @@ -1167,21 +1168,21 @@ msgid "" "`Exception`." msgstr "" -#: ../../library/sqlite3.rst:1287 +#: ../../library/sqlite3.rst:1289 msgid "" "The base class of the other exceptions in this module. Use this to catch all " "errors with one single :keyword:`except` statement. ``Error`` is a subclass " "of :exc:`Exception`." msgstr "" -#: ../../library/sqlite3.rst:1293 +#: ../../library/sqlite3.rst:1295 msgid "" "This exception is raised by :mod:`!sqlite3` for fetch across rollback, or " "if :mod:`!sqlite3` is unable to bind parameters. ``InterfaceError`` is a " "subclass of :exc:`Error`." msgstr "" -#: ../../library/sqlite3.rst:1299 +#: ../../library/sqlite3.rst:1301 msgid "" "Exception raised for errors that are related to the database. This serves as " "the base exception for several types of database errors. It is only raised " @@ -1189,14 +1190,14 @@ msgid "" "subclass of :exc:`Error`." msgstr "" -#: ../../library/sqlite3.rst:1306 +#: ../../library/sqlite3.rst:1308 msgid "" "Exception raised for errors caused by problems with the processed data, like " "numeric values out of range, and strings which are too long. ``DataError`` " "is a subclass of :exc:`DatabaseError`." msgstr "" -#: ../../library/sqlite3.rst:1312 +#: ../../library/sqlite3.rst:1314 msgid "" "Exception raised for errors that are related to the database's operation, " "and not necessarily under the control of the programmer. For example, the " @@ -1204,20 +1205,20 @@ msgid "" "``OperationalError`` is a subclass of :exc:`DatabaseError`." msgstr "" -#: ../../library/sqlite3.rst:1320 +#: ../../library/sqlite3.rst:1322 msgid "" "Exception raised when the relational integrity of the database is affected, " "e.g. a foreign key check fails. It is a subclass of :exc:`DatabaseError`." msgstr "" -#: ../../library/sqlite3.rst:1325 +#: ../../library/sqlite3.rst:1327 msgid "" "Exception raised when SQLite encounters an internal error. If this is " "raised, it may indicate that there is a problem with the runtime SQLite " "library. ``InternalError`` is a subclass of :exc:`DatabaseError`." msgstr "" -#: ../../library/sqlite3.rst:1332 +#: ../../library/sqlite3.rst:1334 msgid "" "Exception raised for :mod:`!sqlite3` API programming errors, for example " "trying to operate on a closed :class:`Connection`, or trying to execute non-" @@ -1225,7 +1226,7 @@ msgid "" "subclass of :exc:`DatabaseError`." msgstr "" -#: ../../library/sqlite3.rst:1339 +#: ../../library/sqlite3.rst:1341 msgid "" "Exception raised in case a method or database API is not supported by the " "underlying SQLite library. For example, setting *deterministic* to ``True`` " @@ -1234,78 +1235,78 @@ msgid "" "subclass of :exc:`DatabaseError`." msgstr "" -#: ../../library/sqlite3.rst:1349 +#: ../../library/sqlite3.rst:1351 msgid "SQLite and Python types" msgstr "" -#: ../../library/sqlite3.rst:1351 +#: ../../library/sqlite3.rst:1353 msgid "" "SQLite natively supports the following types: ``NULL``, ``INTEGER``, " "``REAL``, ``TEXT``, ``BLOB``." msgstr "" -#: ../../library/sqlite3.rst:1354 +#: ../../library/sqlite3.rst:1356 msgid "" "The following Python types can thus be sent to SQLite without any problem:" msgstr "" -#: ../../library/sqlite3.rst:1357 ../../library/sqlite3.rst:1374 +#: ../../library/sqlite3.rst:1359 ../../library/sqlite3.rst:1376 msgid "Python type" msgstr "" -#: ../../library/sqlite3.rst:1357 ../../library/sqlite3.rst:1374 +#: ../../library/sqlite3.rst:1359 ../../library/sqlite3.rst:1376 msgid "SQLite type" msgstr "" -#: ../../library/sqlite3.rst:1359 ../../library/sqlite3.rst:1376 +#: ../../library/sqlite3.rst:1361 ../../library/sqlite3.rst:1378 msgid "``None``" msgstr "" -#: ../../library/sqlite3.rst:1359 ../../library/sqlite3.rst:1376 +#: ../../library/sqlite3.rst:1361 ../../library/sqlite3.rst:1378 msgid "``NULL``" msgstr "``NULL``" -#: ../../library/sqlite3.rst:1361 ../../library/sqlite3.rst:1378 +#: ../../library/sqlite3.rst:1363 ../../library/sqlite3.rst:1380 msgid ":class:`int`" msgstr ":class:`int`" -#: ../../library/sqlite3.rst:1361 ../../library/sqlite3.rst:1378 +#: ../../library/sqlite3.rst:1363 ../../library/sqlite3.rst:1380 msgid "``INTEGER``" msgstr "``INTEGER``" -#: ../../library/sqlite3.rst:1363 ../../library/sqlite3.rst:1380 +#: ../../library/sqlite3.rst:1365 ../../library/sqlite3.rst:1382 msgid ":class:`float`" msgstr ":class:`float`" -#: ../../library/sqlite3.rst:1363 ../../library/sqlite3.rst:1380 +#: ../../library/sqlite3.rst:1365 ../../library/sqlite3.rst:1382 msgid "``REAL``" msgstr "``REAL``" -#: ../../library/sqlite3.rst:1365 +#: ../../library/sqlite3.rst:1367 msgid ":class:`str`" msgstr ":class:`str`" -#: ../../library/sqlite3.rst:1365 ../../library/sqlite3.rst:1382 +#: ../../library/sqlite3.rst:1367 ../../library/sqlite3.rst:1384 msgid "``TEXT``" msgstr "``TEXT``" -#: ../../library/sqlite3.rst:1367 ../../library/sqlite3.rst:1385 +#: ../../library/sqlite3.rst:1369 ../../library/sqlite3.rst:1387 msgid ":class:`bytes`" msgstr ":class:`bytes`" -#: ../../library/sqlite3.rst:1367 ../../library/sqlite3.rst:1385 +#: ../../library/sqlite3.rst:1369 ../../library/sqlite3.rst:1387 msgid "``BLOB``" msgstr "``BLOB``" -#: ../../library/sqlite3.rst:1371 +#: ../../library/sqlite3.rst:1373 msgid "This is how SQLite types are converted to Python types by default:" msgstr "" -#: ../../library/sqlite3.rst:1382 +#: ../../library/sqlite3.rst:1384 msgid "depends on :attr:`~Connection.text_factory`, :class:`str` by default" msgstr "" -#: ../../library/sqlite3.rst:1388 +#: ../../library/sqlite3.rst:1390 msgid "" "The type system of the :mod:`!sqlite3` module is extensible in two ways: you " "can store additional Python types in an SQLite database via :ref:`object " @@ -1314,42 +1315,42 @@ msgid "" "converters>`." msgstr "" -#: ../../library/sqlite3.rst:1398 +#: ../../library/sqlite3.rst:1400 msgid "Default adapters and converters" msgstr "" -#: ../../library/sqlite3.rst:1400 +#: ../../library/sqlite3.rst:1402 msgid "" "There are default adapters for the date and datetime types in the datetime " "module. They will be sent as ISO dates/ISO timestamps to SQLite." msgstr "" -#: ../../library/sqlite3.rst:1403 +#: ../../library/sqlite3.rst:1405 msgid "" "The default converters are registered under the name \"date\" for :class:" "`datetime.date` and under the name \"timestamp\" for :class:`datetime." "datetime`." msgstr "" -#: ../../library/sqlite3.rst:1407 +#: ../../library/sqlite3.rst:1409 msgid "" "This way, you can use date/timestamps from Python without any additional " "fiddling in most cases. The format of the adapters is also compatible with " "the experimental SQLite date/time functions." msgstr "" -#: ../../library/sqlite3.rst:1411 +#: ../../library/sqlite3.rst:1413 msgid "The following example demonstrates this." msgstr "" -#: ../../library/sqlite3.rst:1415 +#: ../../library/sqlite3.rst:1417 msgid "" "If a timestamp stored in SQLite has a fractional part longer than 6 numbers, " "its value will be truncated to microsecond precision by the timestamp " "converter." msgstr "" -#: ../../library/sqlite3.rst:1421 +#: ../../library/sqlite3.rst:1423 msgid "" "The default \"timestamp\" converter ignores UTC offsets in the database and " "always returns a naive :class:`datetime.datetime` object. To preserve UTC " @@ -1357,15 +1358,15 @@ msgid "" "offset-aware converter with :func:`register_converter`." msgstr "" -#: ../../library/sqlite3.rst:1430 +#: ../../library/sqlite3.rst:1432 msgid "How-to guides" msgstr "" -#: ../../library/sqlite3.rst:1435 +#: ../../library/sqlite3.rst:1437 msgid "How to use placeholders to bind values in SQL queries" msgstr "" -#: ../../library/sqlite3.rst:1437 +#: ../../library/sqlite3.rst:1439 msgid "" "SQL operations usually need to use values from Python variables. However, " "beware of using Python's string operations to assemble queries, as they are " @@ -1373,7 +1374,7 @@ msgid "" "com/327/>`_ for a humorous example of what can go wrong)::" msgstr "" -#: ../../library/sqlite3.rst:1446 +#: ../../library/sqlite3.rst:1448 msgid "" "Instead, use the DB-API's parameter substitution. To insert a variable into " "a query string, use a placeholder in the string, and substitute the actual " @@ -1389,18 +1390,18 @@ msgid "" "ignored. Here's an example of both styles:" msgstr "" -#: ../../library/sqlite3.rst:1488 +#: ../../library/sqlite3.rst:1490 msgid "How to adapt custom Python types to SQLite values" msgstr "" -#: ../../library/sqlite3.rst:1490 +#: ../../library/sqlite3.rst:1492 msgid "" "SQLite supports only a limited set of data types natively. To store custom " "Python types in SQLite databases, *adapt* them to one of the :ref:`Python " "types SQLite natively understands `." msgstr "" -#: ../../library/sqlite3.rst:1494 +#: ../../library/sqlite3.rst:1496 msgid "" "There are two ways to adapt Python objects to SQLite types: letting your " "object adapt itself, or using an *adapter callable*. The latter will take " @@ -1410,11 +1411,11 @@ msgid "" "custom adapter functions." msgstr "" -#: ../../library/sqlite3.rst:1506 +#: ../../library/sqlite3.rst:1508 msgid "How to write adaptable objects" msgstr "" -#: ../../library/sqlite3.rst:1508 +#: ../../library/sqlite3.rst:1510 msgid "" "Suppose we have a :class:`!Point` class that represents a pair of " "coordinates, ``x`` and ``y``, in a Cartesian coordinate system. The " @@ -1424,84 +1425,84 @@ msgid "" "object passed to *protocol* will be of type :class:`PrepareProtocol`." msgstr "" -#: ../../library/sqlite3.rst:1539 +#: ../../library/sqlite3.rst:1541 msgid "How to register adapter callables" msgstr "" -#: ../../library/sqlite3.rst:1541 +#: ../../library/sqlite3.rst:1543 msgid "" "The other possibility is to create a function that converts the Python " "object to an SQLite-compatible type. This function can then be registered " "using :func:`register_adapter`." msgstr "" -#: ../../library/sqlite3.rst:1571 +#: ../../library/sqlite3.rst:1573 msgid "How to convert SQLite values to custom Python types" msgstr "" -#: ../../library/sqlite3.rst:1573 +#: ../../library/sqlite3.rst:1575 msgid "" "Writing an adapter lets you convert *from* custom Python types *to* SQLite " "values. To be able to convert *from* SQLite values *to* custom Python types, " "we use *converters*." msgstr "" -#: ../../library/sqlite3.rst:1578 +#: ../../library/sqlite3.rst:1580 msgid "" "Let's go back to the :class:`!Point` class. We stored the x and y " "coordinates separated via semicolons as strings in SQLite." msgstr "" -#: ../../library/sqlite3.rst:1581 +#: ../../library/sqlite3.rst:1583 msgid "" "First, we'll define a converter function that accepts the string as a " "parameter and constructs a :class:`!Point` object from it." msgstr "" -#: ../../library/sqlite3.rst:1586 +#: ../../library/sqlite3.rst:1588 msgid "" "Converter functions are **always** passed a :class:`bytes` object, no matter " "the underlying SQLite data type." msgstr "" -#: ../../library/sqlite3.rst:1595 +#: ../../library/sqlite3.rst:1597 msgid "" "We now need to tell :mod:`!sqlite3` when it should convert a given SQLite " "value. This is done when connecting to a database, using the *detect_types* " "parameter of :func:`connect`. There are three options:" msgstr "" -#: ../../library/sqlite3.rst:1599 +#: ../../library/sqlite3.rst:1601 msgid "Implicit: set *detect_types* to :const:`PARSE_DECLTYPES`" msgstr "" -#: ../../library/sqlite3.rst:1600 +#: ../../library/sqlite3.rst:1602 msgid "Explicit: set *detect_types* to :const:`PARSE_COLNAMES`" msgstr "" -#: ../../library/sqlite3.rst:1601 +#: ../../library/sqlite3.rst:1603 msgid "" "Both: set *detect_types* to ``sqlite3.PARSE_DECLTYPES | sqlite3." "PARSE_COLNAMES``. Column names take precedence over declared types." msgstr "" -#: ../../library/sqlite3.rst:1605 +#: ../../library/sqlite3.rst:1607 msgid "The following example illustrates the implicit and explicit approaches:" msgstr "" -#: ../../library/sqlite3.rst:1656 +#: ../../library/sqlite3.rst:1658 msgid "Adapter and converter recipes" msgstr "" -#: ../../library/sqlite3.rst:1658 +#: ../../library/sqlite3.rst:1660 msgid "This section shows recipes for common adapters and converters." msgstr "" -#: ../../library/sqlite3.rst:1701 +#: ../../library/sqlite3.rst:1703 msgid "How to use connection shortcut methods" msgstr "" -#: ../../library/sqlite3.rst:1703 +#: ../../library/sqlite3.rst:1705 msgid "" "Using the :meth:`~Connection.execute`, :meth:`~Connection.executemany`, and :" "meth:`~Connection.executescript` methods of the :class:`Connection` class, " @@ -1513,11 +1514,11 @@ msgid "" "object." msgstr "" -#: ../../library/sqlite3.rst:1744 +#: ../../library/sqlite3.rst:1746 msgid "How to use the connection context manager" msgstr "" -#: ../../library/sqlite3.rst:1746 +#: ../../library/sqlite3.rst:1748 msgid "" "A :class:`Connection` object can be used as a context manager that " "automatically commits or rolls back open transactions when leaving the body " @@ -1527,61 +1528,61 @@ msgid "" "exception, the transaction is rolled back." msgstr "" -#: ../../library/sqlite3.rst:1755 +#: ../../library/sqlite3.rst:1757 msgid "" "If there is no open transaction upon leaving the body of the ``with`` " "statement, the context manager is a no-op." msgstr "" -#: ../../library/sqlite3.rst:1760 +#: ../../library/sqlite3.rst:1762 msgid "" "The context manager neither implicitly opens a new transaction nor closes " "the connection." msgstr "" -#: ../../library/sqlite3.rst:1793 +#: ../../library/sqlite3.rst:1795 msgid "How to work with SQLite URIs" msgstr "" -#: ../../library/sqlite3.rst:1795 +#: ../../library/sqlite3.rst:1797 msgid "Some useful URI tricks include:" msgstr "" -#: ../../library/sqlite3.rst:1797 +#: ../../library/sqlite3.rst:1799 msgid "Open a database in read-only mode:" msgstr "" -#: ../../library/sqlite3.rst:1806 +#: ../../library/sqlite3.rst:1808 msgid "" "Do not implicitly create a new database file if it does not already exist; " "will raise :exc:`~sqlite3.OperationalError` if unable to create a new file:" msgstr "" -#: ../../library/sqlite3.rst:1816 +#: ../../library/sqlite3.rst:1818 msgid "Create a shared named in-memory database:" msgstr "" -#: ../../library/sqlite3.rst:1830 +#: ../../library/sqlite3.rst:1832 msgid "" "More information about this feature, including a list of parameters, can be " "found in the `SQLite URI documentation`_." msgstr "" -#: ../../library/sqlite3.rst:1839 +#: ../../library/sqlite3.rst:1841 msgid "Explanation" msgstr "解釋" -#: ../../library/sqlite3.rst:1844 +#: ../../library/sqlite3.rst:1846 msgid "Transaction control" msgstr "" -#: ../../library/sqlite3.rst:1846 +#: ../../library/sqlite3.rst:1848 msgid "" "The :mod:`!sqlite3` module does not adhere to the transaction handling " "recommended by :pep:`249`." msgstr "" -#: ../../library/sqlite3.rst:1849 +#: ../../library/sqlite3.rst:1851 msgid "" "If the connection attribute :attr:`~Connection.isolation_level` is not " "``None``, new transactions are implicitly opened before :meth:`~Cursor." @@ -1595,7 +1596,7 @@ msgid "" "attribute." msgstr "" -#: ../../library/sqlite3.rst:1862 +#: ../../library/sqlite3.rst:1864 msgid "" "If :attr:`~Connection.isolation_level` is set to ``None``, no transactions " "are implicitly opened at all. This leaves the underlying SQLite library in " @@ -1605,14 +1606,14 @@ msgid "" "in_transaction` attribute." msgstr "" -#: ../../library/sqlite3.rst:1870 +#: ../../library/sqlite3.rst:1872 msgid "" "The :meth:`~Cursor.executescript` method implicitly commits any pending " "transaction before execution of the given SQL script, regardless of the " "value of :attr:`~Connection.isolation_level`." msgstr "" -#: ../../library/sqlite3.rst:1874 +#: ../../library/sqlite3.rst:1876 msgid "" ":mod:`!sqlite3` used to implicitly commit an open transaction before DDL " "statements. This is no longer the case." diff --git a/library/stdtypes.po b/library/stdtypes.po index 43d2f02bb2..9b5dccac63 100644 --- a/library/stdtypes.po +++ b/library/stdtypes.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-09-05 00:20+0000\n" +"POT-Creation-Date: 2022-10-06 00:23+0000\n" "PO-Revision-Date: 2022-06-12 15:22+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -348,7 +348,7 @@ msgid "" "There are three distinct numeric types: :dfn:`integers`, :dfn:`floating " "point numbers`, and :dfn:`complex numbers`. In addition, Booleans are a " "subtype of integers. Integers have unlimited precision. Floating point " -"numbers are usually implemented using :c:type:`double` in C; information " +"numbers are usually implemented using :c:expr:`double` in C; information " "about the precision and internal representation of floating point numbers " "for the machine on which your program is running is available in :data:`sys." "float_info`. Complex numbers have a real and imaginary part, which are each " diff --git a/library/struct.po b/library/struct.po index c6cbe95dbd..9000db2e80 100644 --- a/library/struct.po +++ b/library/struct.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-06 00:23+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-" @@ -332,7 +332,8 @@ msgid "``c``" msgstr "``c``" #: ../../library/struct.rst:199 -msgid ":c:type:`char`" +#, fuzzy +msgid ":c:expr:`char`" msgstr ":c:type:`char`" #: ../../library/struct.rst:199 @@ -349,7 +350,8 @@ msgid "``b``" msgstr "``b``" #: ../../library/struct.rst:201 -msgid ":c:type:`signed char`" +#, fuzzy +msgid ":c:expr:`signed char`" msgstr ":c:type:`signed char`" #: ../../library/struct.rst:201 ../../library/struct.rst:203 @@ -371,7 +373,8 @@ msgid "``B``" msgstr "``B``" #: ../../library/struct.rst:203 -msgid ":c:type:`unsigned char`" +#, fuzzy +msgid ":c:expr:`unsigned char`" msgstr ":c:type:`unsigned char`" #: ../../library/struct.rst:203 ../../library/struct.rst:207 @@ -387,7 +390,8 @@ msgid "``?``" msgstr "``?``" #: ../../library/struct.rst:205 -msgid ":c:type:`_Bool`" +#, fuzzy +msgid ":c:expr:`_Bool`" msgstr ":c:type:`_Bool`" #: ../../library/struct.rst:205 @@ -403,7 +407,8 @@ msgid "``h``" msgstr "``h``" #: ../../library/struct.rst:207 -msgid ":c:type:`short`" +#, fuzzy +msgid ":c:expr:`short`" msgstr ":c:type:`short`" #: ../../library/struct.rst:207 ../../library/struct.rst:209 @@ -416,7 +421,8 @@ msgid "``H``" msgstr "``H``" #: ../../library/struct.rst:209 -msgid ":c:type:`unsigned short`" +#, fuzzy +msgid ":c:expr:`unsigned short`" msgstr ":c:type:`unsigned short`" #: ../../library/struct.rst:211 @@ -424,7 +430,8 @@ msgid "``i``" msgstr "``i``" #: ../../library/struct.rst:211 -msgid ":c:type:`int`" +#, fuzzy +msgid ":c:expr:`int`" msgstr ":c:type:`int`" #: ../../library/struct.rst:211 ../../library/struct.rst:213 @@ -438,7 +445,8 @@ msgid "``I``" msgstr "``I``" #: ../../library/struct.rst:213 -msgid ":c:type:`unsigned int`" +#, fuzzy +msgid ":c:expr:`unsigned int`" msgstr ":c:type:`unsigned int`" #: ../../library/struct.rst:215 @@ -446,7 +454,8 @@ msgid "``l``" msgstr "``l``" #: ../../library/struct.rst:215 -msgid ":c:type:`long`" +#, fuzzy +msgid ":c:expr:`long`" msgstr ":c:type:`long`" #: ../../library/struct.rst:217 @@ -454,7 +463,8 @@ msgid "``L``" msgstr "``L``" #: ../../library/struct.rst:217 -msgid ":c:type:`unsigned long`" +#, fuzzy +msgid ":c:expr:`unsigned long`" msgstr ":c:type:`unsigned long`" #: ../../library/struct.rst:219 @@ -462,7 +472,8 @@ msgid "``q``" msgstr "``q``" #: ../../library/struct.rst:219 -msgid ":c:type:`long long`" +#, fuzzy +msgid ":c:expr:`long long`" msgstr ":c:type:`long long`" #: ../../library/struct.rst:219 ../../library/struct.rst:221 @@ -475,7 +486,8 @@ msgid "``Q``" msgstr "``Q``" #: ../../library/struct.rst:221 -msgid ":c:type:`unsigned long long`" +#, fuzzy +msgid ":c:expr:`unsigned long long`" msgstr ":c:type:`unsigned long long`" #: ../../library/struct.rst:224 @@ -483,7 +495,8 @@ msgid "``n``" msgstr "``n``" #: ../../library/struct.rst:224 -msgid ":c:type:`ssize_t`" +#, fuzzy +msgid ":c:expr:`ssize_t`" msgstr ":c:type:`ssize_t`" #: ../../library/struct.rst:224 ../../library/struct.rst:226 @@ -495,7 +508,8 @@ msgid "``N``" msgstr "``N``" #: ../../library/struct.rst:226 -msgid ":c:type:`size_t`" +#, fuzzy +msgid ":c:expr:`size_t`" msgstr ":c:type:`size_t`" #: ../../library/struct.rst:228 @@ -521,7 +535,8 @@ msgid "``f``" msgstr "``f``" #: ../../library/struct.rst:230 -msgid ":c:type:`float`" +#, fuzzy +msgid ":c:expr:`float`" msgstr ":c:type:`float`" #: ../../library/struct.rst:232 @@ -529,7 +544,8 @@ msgid "``d``" msgstr "``d``" #: ../../library/struct.rst:232 -msgid ":c:type:`double`" +#, fuzzy +msgid ":c:expr:`double`" msgstr ":c:type:`double`" #: ../../library/struct.rst:234 @@ -537,7 +553,8 @@ msgid "``s``" msgstr "``s``" #: ../../library/struct.rst:234 ../../library/struct.rst:236 -msgid ":c:type:`char[]`" +#, fuzzy +msgid ":c:expr:`char[]`" msgstr ":c:type:`char[]`" #: ../../library/struct.rst:234 ../../library/struct.rst:236 @@ -553,7 +570,8 @@ msgid "``P``" msgstr "``P``" #: ../../library/struct.rst:238 -msgid ":c:type:`void \\*`" +#, fuzzy +msgid ":c:expr:`void \\*`" msgstr ":c:type:`void \\*`" #: ../../library/struct.rst:238 @@ -570,8 +588,8 @@ msgstr "新增 ``'e'`` 格式的支援。" #: ../../library/struct.rst:253 msgid "" -"The ``'?'`` conversion code corresponds to the :c:type:`_Bool` type defined " -"by C99. If this type is not available, it is simulated using a :c:type:" +"The ``'?'`` conversion code corresponds to the :c:expr:`_Bool` type defined " +"by C99. If this type is not available, it is simulated using a :c:expr:" "`char`. In standard mode, it is always represented by one byte." msgstr "" diff --git a/reference/datamodel.po b/reference/datamodel.po index bc7c6ed080..885ff32841 100644 --- a/reference/datamodel.po +++ b/reference/datamodel.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-03 00:22+0000\n" +"POT-Creation-Date: 2022-10-06 00:23+0000\n" "PO-Revision-Date: 2018-05-23 16:17+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -388,7 +388,7 @@ msgstr "字串 (String)" msgid "" "A string is a sequence of values that represent Unicode code points. All the " "code points in the range ``U+0000 - U+10FFFF`` can be represented in a " -"string. Python doesn't have a :c:type:`char` type; instead, every code " +"string. Python doesn't have a :c:expr:`char` type; instead, every code " "point in the string is represented as a string object with length ``1``. " "The built-in function :func:`ord` converts a code point from its string form " "to an integer in the range ``0 - 10FFFF``; :func:`chr` converts an integer " diff --git a/tutorial/errors.po b/tutorial/errors.po index c143785f56..ce15fd317b 100644 --- a/tutorial/errors.po +++ b/tutorial/errors.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-01-04 00:10+0000\n" +"POT-Creation-Date: 2022-10-06 00:23+0000\n" "PO-Revision-Date: 2022-01-04 12:58+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -359,40 +359,40 @@ msgstr "例外鏈接 (Exception Chaining)" #: ../../tutorial/errors.rst:278 msgid "" -"The :keyword:`raise` statement allows an optional :keyword:`from` " -"which enables chaining exceptions. For example::" +"If an unhandled exception occurs inside an :keyword:`except` section, it " +"will have the exception being handled attached to it and included in the " +"error message::" +msgstr "" + +#: ../../tutorial/errors.rst:297 +msgid "" +"To indicate that an exception is a direct consequence of another, the :" +"keyword:`raise` statement allows an optional :keyword:`from` clause::" msgstr "" -":keyword:`raise` 陳述式容許一個選擇性的 :keyword:`from`\\ ,它透過被引" -"發例外中的 ``__cause__`` 屬性的設定,來啟用例外鏈接。例如:\n" -"\n" -"::" -#: ../../tutorial/errors.rst:284 +#: ../../tutorial/errors.rst:303 msgid "This can be useful when you are transforming exceptions. For example::" msgstr "" "要變換例外時,這種方式很有用。例如:\n" "\n" "::" -#: ../../tutorial/errors.rst:305 +#: ../../tutorial/errors.rst:324 msgid "" -"Exception chaining happens automatically when an exception is raised inside " -"an :keyword:`except` or :keyword:`finally` section. This can be disabled by " -"using ``from None`` idiom:" +"It also allows disabling automatic exception chaining using the ``from " +"None`` idiom::" msgstr "" -"當例外是在一個 :keyword:`except` 或 :keyword:`finally` 段落的內部被引發時,例" -"外鏈接會自動發生。要使其停止作用,可以使用慣用語 ``from None``:" -#: ../../tutorial/errors.rst:318 +#: ../../tutorial/errors.rst:336 msgid "" "For more information about chaining mechanics, see :ref:`bltin-exceptions`." msgstr "更多關於鏈接機制的資訊,詳見\\ :ref:`bltin-exceptions`\\ 。" -#: ../../tutorial/errors.rst:324 +#: ../../tutorial/errors.rst:342 msgid "User-defined Exceptions" msgstr "使用者自定的例外" -#: ../../tutorial/errors.rst:326 +#: ../../tutorial/errors.rst:344 msgid "" "Programs may name their own exceptions by creating a new exception class " "(see :ref:`tut-classes` for more about Python classes). Exceptions should " @@ -403,7 +403,7 @@ msgstr "" "\\ :ref:`tut-classes`\\ )。不論是直接還是間接地,例外通常應該從 :exc:" "`Exception` class 衍生出來。" -#: ../../tutorial/errors.rst:330 +#: ../../tutorial/errors.rst:348 msgid "" "Exception classes can be defined which do anything any other class can do, " "but are usually kept simple, often only offering a number of attributes that " @@ -413,13 +413,13 @@ msgstr "" "例外 class 可被定義來做任何其他 class 能夠做的事,但通常會讓它維持簡單,只提" "供一些屬性,讓關於錯誤的資訊可被例外的處理者抽取出來。" -#: ../../tutorial/errors.rst:334 +#: ../../tutorial/errors.rst:352 msgid "" "Most exceptions are defined with names that end in \"Error\", similar to the " "naming of the standard exceptions." msgstr "大多數的例外定義,都會以「Error」作為名稱結尾,類似於標準例外的命名。" -#: ../../tutorial/errors.rst:337 +#: ../../tutorial/errors.rst:355 msgid "" "Many standard modules define their own exceptions to report errors that may " "occur in functions they define. More information on classes is presented in " @@ -428,11 +428,11 @@ msgstr "" "許多標準模組會定義它們自己的例外,以報告在其定義的函式中發生的錯誤。更多有關 " "class 的資訊,詳見\\ :ref:`tut-classes`\\ 章節。" -#: ../../tutorial/errors.rst:345 +#: ../../tutorial/errors.rst:363 msgid "Defining Clean-up Actions" msgstr "定義清理動作" -#: ../../tutorial/errors.rst:347 +#: ../../tutorial/errors.rst:365 msgid "" "The :keyword:`try` statement has another optional clause which is intended " "to define clean-up actions that must be executed under all circumstances. " @@ -443,7 +443,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/errors.rst:361 +#: ../../tutorial/errors.rst:379 msgid "" "If a :keyword:`finally` clause is present, the :keyword:`!finally` clause " "will execute as the last task before the :keyword:`try` statement completes. " @@ -456,7 +456,7 @@ msgstr "" "外,都會執行 :keyword:`!finally` 子句。以下幾點將探討例外發生時,比較複雜的情" "況:" -#: ../../tutorial/errors.rst:367 +#: ../../tutorial/errors.rst:385 msgid "" "If an exception occurs during execution of the :keyword:`!try` clause, the " "exception may be handled by an :keyword:`except` clause. If the exception is " @@ -467,7 +467,7 @@ msgstr "" "`except` 子句處理。如果該例外沒有被 :keyword:`!except` 子句處理,它會在 :" "keyword:`!finally` 子句執行後被重新引發。" -#: ../../tutorial/errors.rst:373 +#: ../../tutorial/errors.rst:391 msgid "" "An exception could occur during execution of an :keyword:`!except` or :" "keyword:`!else` clause. Again, the exception is re-raised after the :keyword:" @@ -476,7 +476,7 @@ msgstr "" "一個例外可能發生於 :keyword:`!except` 或 :keyword:`!else` 子句的執行過程。同" "樣地,該例外會在 :keyword:`!finally` 子句執行後被重新引發。" -#: ../../tutorial/errors.rst:377 +#: ../../tutorial/errors.rst:395 msgid "" "If the :keyword:`!finally` clause executes a :keyword:`break`, :keyword:" "`continue` or :keyword:`return` statement, exceptions are not re-raised." @@ -484,7 +484,7 @@ msgstr "" "如果 :keyword:`!finally` 子句執行 :keyword:`break`\\ 、\\ :keyword:" "`continue` 或 :keyword:`return` 陳述式,則例外不會被重新引發。" -#: ../../tutorial/errors.rst:381 +#: ../../tutorial/errors.rst:399 msgid "" "If the :keyword:`!try` statement reaches a :keyword:`break`, :keyword:" "`continue` or :keyword:`return` statement, the :keyword:`!finally` clause " @@ -495,7 +495,7 @@ msgstr "" "或 :keyword:`return` 陳述式,則 :keyword:`!finally` 子句會在執行 :keyword:`!" "break`\\ 、\\ :keyword:`!continue` 或 :keyword:`!return` 陳述式之前先執行。" -#: ../../tutorial/errors.rst:387 +#: ../../tutorial/errors.rst:405 msgid "" "If a :keyword:`!finally` clause includes a :keyword:`!return` statement, the " "returned value will be the one from the :keyword:`!finally` clause's :" @@ -506,21 +506,21 @@ msgstr "" "自 :keyword:`!finally` 子句的 :keyword:`!return` 陳述式的回傳值,而不是來自 :" "keyword:`!try` 子句的 :keyword:`!return` 陳述式的回傳值。" -#: ../../tutorial/errors.rst:393 +#: ../../tutorial/errors.rst:411 msgid "For example::" msgstr "" "例如:\n" "\n" "::" -#: ../../tutorial/errors.rst:404 +#: ../../tutorial/errors.rst:422 msgid "A more complicated example::" msgstr "" "另一個比較複雜的範例:\n" "\n" "::" -#: ../../tutorial/errors.rst:429 +#: ../../tutorial/errors.rst:447 msgid "" "As you can see, the :keyword:`finally` clause is executed in any event. " "The :exc:`TypeError` raised by dividing two strings is not handled by the :" @@ -531,7 +531,7 @@ msgstr "" "發的 :exc:`TypeError` 沒有被 :keyword:`except` 子句處理,因此會在 :keyword:`!" "finally` 子句執行後被重新引發。" -#: ../../tutorial/errors.rst:434 +#: ../../tutorial/errors.rst:452 msgid "" "In real world applications, the :keyword:`finally` clause is useful for " "releasing external resources (such as files or network connections), " @@ -540,11 +540,11 @@ msgstr "" "在真實應用程式中,\\ :keyword:`finally` 子句對於釋放外部資源(例如檔案或網路" "連線)很有用,無論該資源的使用是否成功。" -#: ../../tutorial/errors.rst:442 +#: ../../tutorial/errors.rst:460 msgid "Predefined Clean-up Actions" msgstr "預定義的清理動作" -#: ../../tutorial/errors.rst:444 +#: ../../tutorial/errors.rst:462 msgid "" "Some objects define standard clean-up actions to be undertaken when the " "object is no longer needed, regardless of whether or not the operation using " @@ -556,7 +556,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/errors.rst:452 +#: ../../tutorial/errors.rst:470 msgid "" "The problem with this code is that it leaves the file open for an " "indeterminate amount of time after this part of the code has finished " @@ -572,7 +572,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/errors.rst:462 +#: ../../tutorial/errors.rst:480 msgid "" "After the statement is executed, the file *f* is always closed, even if a " "problem was encountered while processing the lines. Objects which, like " @@ -581,3 +581,20 @@ msgid "" msgstr "" "陳述式執行完畢後,就算是在處理內容時遇到問題,檔案 *f* 總是會被關閉。和檔案一" "樣,提供預定義清理動作的物件會在說明文件中表明這一點。" + +#~ msgid "" +#~ "The :keyword:`raise` statement allows an optional :keyword:`from` " +#~ "which enables chaining exceptions. For example::" +#~ msgstr "" +#~ ":keyword:`raise` 陳述式容許一個選擇性的 :keyword:`from`\\ ,它透過" +#~ "被引發例外中的 ``__cause__`` 屬性的設定,來啟用例外鏈接。例如:\n" +#~ "\n" +#~ "::" + +#~ msgid "" +#~ "Exception chaining happens automatically when an exception is raised " +#~ "inside an :keyword:`except` or :keyword:`finally` section. This can be " +#~ "disabled by using ``from None`` idiom:" +#~ msgstr "" +#~ "當例外是在一個 :keyword:`except` 或 :keyword:`finally` 段落的內部被引發" +#~ "時,例外鏈接會自動發生。要使其停止作用,可以使用慣用語 ``from None``:" diff --git a/whatsnew/2.2.po b/whatsnew/2.2.po index c42210d046..e2477d8955 100644 --- a/whatsnew/2.2.po +++ b/whatsnew/2.2.po @@ -7,7 +7,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-10-06 00:23+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-" @@ -1122,7 +1122,7 @@ msgstr "" #: ../../whatsnew/2.2.rst:985 msgid "" "Two new format characters were added to the :mod:`struct` module for 64-bit " -"integers on platforms that support the C :c:type:`long long` type. ``q`` is " +"integers on platforms that support the C :c:expr:`long long` type. ``q`` is " "for a signed 64-bit integer, and ``Q`` is for an unsigned one. The value is " "returned in Python's long integer type. (Contributed by Tim Peters.)" msgstr "" diff --git a/whatsnew/2.3.po b/whatsnew/2.3.po index c97396fb4d..d18d30ce30 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-09-28 00:27+0000\n" +"POT-Creation-Date: 2022-10-06 00:23+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-" @@ -2095,9 +2095,9 @@ msgstr "" #: ../../whatsnew/2.3.rst:1907 msgid "" ":c:func:`PyArg_ParseTuple` accepts new format characters for various sizes " -"of unsigned integers: ``B`` for :c:type:`unsigned char`, ``H`` for :c:type:" -"`unsigned short int`, ``I`` for :c:type:`unsigned int`, and ``K`` for :c:" -"type:`unsigned long long`." +"of unsigned integers: ``B`` for :c:expr:`unsigned char`, ``H`` for :c:expr:" +"`unsigned short int`, ``I`` for :c:expr:`unsigned int`, and ``K`` for :c:" +"expr:`unsigned long long`." msgstr "" #: ../../whatsnew/2.3.rst:1912 diff --git a/whatsnew/2.4.po b/whatsnew/2.4.po index 266f9d7286..0327388b6c 100644 --- a/whatsnew/2.4.po +++ b/whatsnew/2.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-10-06 00:23+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-" @@ -518,7 +518,7 @@ msgstr "" #: ../../whatsnew/2.4.rst:474 msgid "" "Python has always supported floating-point (FP) numbers, based on the " -"underlying C :c:type:`double` type, as a data type. However, while most " +"underlying C :c:expr:`double` type, as a data type. However, while most " "programming languages provide a floating-point type, many people (even " "programmers) are unaware that floating-point numbers don't represent certain " "decimal fractions accurately. The new :class:`Decimal` type can represent " @@ -564,7 +564,7 @@ msgstr "" #: ../../whatsnew/2.4.rst:503 msgid "" "Modern systems usually provide floating-point support that conforms to a " -"standard called IEEE 754. C's :c:type:`double` type is usually implemented " +"standard called IEEE 754. C's :c:expr:`double` type is usually implemented " "as a 64-bit IEEE 754 number, which uses 52 bits of space for the mantissa. " "This means that numbers can only be specified to 52 bits of precision. If " "you're trying to represent numbers whose expansion repeats endlessly, the " @@ -831,12 +831,12 @@ msgstr "" #: ../../whatsnew/2.4.rst:752 msgid "" "``PyOS_ascii_strtod(str, ptr)`` and ``PyOS_ascii_atof(str, ptr)`` both " -"convert a string to a C :c:type:`double`." +"convert a string to a C :c:expr:`double`." msgstr "" #: ../../whatsnew/2.4.rst:755 msgid "" -"``PyOS_ascii_formatd(buffer, buf_len, format, d)`` converts a :c:type:" +"``PyOS_ascii_formatd(buffer, buf_len, format, d)`` converts a :c:expr:" "`double` to an ASCII string." msgstr "" @@ -1641,8 +1641,8 @@ msgstr "" #: ../../whatsnew/2.4.rst:1456 msgid "" -"Another new macro, :c:macro:`Py_CLEAR(obj)`, decreases the reference count " -"of *obj* and sets *obj* to the null pointer. (Contributed by Jim Fulton.)" +"Another new macro, :c:macro:`Py_CLEAR`, decreases the reference count of " +"*obj* and sets *obj* to the null pointer. (Contributed by Jim Fulton.)" msgstr "" #: ../../whatsnew/2.4.rst:1459 @@ -1661,7 +1661,7 @@ msgstr "" #: ../../whatsnew/2.4.rst:1467 msgid "" -"The :c:macro:`Py_IS_NAN(X)` macro returns 1 if its float or double argument " +"The :c:expr:`Py_IS_NAN(X)` macro returns 1 if its float or double argument " "*X* is a NaN. (Contributed by Tim Peters.)" msgstr "" diff --git a/whatsnew/2.5.po b/whatsnew/2.5.po index e41e3b9550..da06d6e6bd 100644 --- a/whatsnew/2.5.po +++ b/whatsnew/2.5.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-08-09 00:18+0000\n" +"POT-Creation-Date: 2022-10-06 00:23+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-" @@ -995,21 +995,21 @@ msgstr "" #: ../../whatsnew/2.5.rst:874 msgid "" "A wide-ranging change to Python's C API, using a new :c:type:`Py_ssize_t` " -"type definition instead of :c:type:`int`, will permit the interpreter to " +"type definition instead of :c:expr:`int`, will permit the interpreter to " "handle more data on 64-bit platforms. This change doesn't affect Python's " "capacity on 32-bit platforms." msgstr "" #: ../../whatsnew/2.5.rst:879 msgid "" -"Various pieces of the Python interpreter used C's :c:type:`int` type to " +"Various pieces of the Python interpreter used C's :c:expr:`int` type to " "store sizes or counts; for example, the number of items in a list or tuple " -"were stored in an :c:type:`int`. The C compilers for most 64-bit platforms " -"still define :c:type:`int` as a 32-bit type, so that meant that lists could " +"were stored in an :c:expr:`int`. The C compilers for most 64-bit platforms " +"still define :c:expr:`int` as a 32-bit type, so that meant that lists could " "only hold up to ``2**31 - 1`` = 2147483647 items. (There are actually a few " "different programming models that 64-bit C compilers can use -- see https://" "unix.org/version2/whatsnew/lp64_wp.html for a discussion -- but the most " -"commonly available model leaves :c:type:`int` as 32 bits.)" +"commonly available model leaves :c:expr:`int` as 32 bits.)" msgstr "" #: ../../whatsnew/2.5.rst:888 @@ -1027,7 +1027,7 @@ msgid "" "The pointers for a list that size would only require 16 GiB of space, so " "it's not unreasonable that Python programmers might construct lists that " "large. Therefore, the Python interpreter had to be changed to use some type " -"other than :c:type:`int`, and this will be a 64-bit type on 64-bit " +"other than :c:expr:`int`, and this will be a 64-bit type on 64-bit " "platforms. The change will cause incompatibilities on 64-bit machines, so " "it was deemed worth making the transition now, while the number of 64-bit " "users is still relatively small. (In 5 or 10 years, we may *all* be on 64-" @@ -1047,7 +1047,7 @@ msgstr "" msgid "" "The :c:func:`PyArg_ParseTuple` and :c:func:`Py_BuildValue` functions have a " "new conversion code, ``n``, for :c:type:`Py_ssize_t`. :c:func:" -"`PyArg_ParseTuple`'s ``s#`` and ``t#`` still output :c:type:`int` by " +"`PyArg_ParseTuple`'s ``s#`` and ``t#`` still output :c:expr:`int` by " "default, but you can define the macro :c:macro:`PY_SSIZE_T_CLEAN` before " "including :file:`Python.h` to make them return :c:type:`Py_ssize_t`." msgstr "" @@ -2002,7 +2002,7 @@ msgstr "" #: ../../whatsnew/2.5.rst:1697 msgid "" "Type constructors for the various C types are provided: :func:`c_int`, :func:" -"`c_float`, :func:`c_double`, :func:`c_char_p` (equivalent to :c:type:`char " +"`c_float`, :func:`c_double`, :func:`c_char_p` (equivalent to :c:expr:`char " "\\*`), and so forth. Unlike Python's types, the C versions are all mutable; " "you can assign to their :attr:`value` attribute to change the wrapped " "value. Python integers and strings will be automatically converted to the " @@ -2490,7 +2490,7 @@ msgstr "" #: ../../whatsnew/2.5.rst:2094 msgid "" "The largest change to the C API came from :pep:`353`, which modifies the " -"interpreter to use a :c:type:`Py_ssize_t` type definition instead of :c:type:" +"interpreter to use a :c:type:`Py_ssize_t` type definition instead of :c:expr:" "`int`. See the earlier section :ref:`pep-353` for a discussion of this " "change." msgstr "" @@ -2720,7 +2720,7 @@ msgstr "" #: ../../whatsnew/2.5.rst:2267 msgid "" -"C API: Many functions now use :c:type:`Py_ssize_t` instead of :c:type:`int` " +"C API: Many functions now use :c:type:`Py_ssize_t` instead of :c:expr:`int` " "to allow processing more data on 64-bit machines. Extension code may need " "to make the same change to avoid warnings and to support 64-bit machines. " "See the earlier section :ref:`pep-353` for a discussion of this change." @@ -2729,9 +2729,9 @@ msgstr "" #: ../../whatsnew/2.5.rst:2272 msgid "" "C API: The obmalloc changes mean that you must be careful to not mix usage " -"of the :c:func:`PyMem_\\*` and :c:func:`PyObject_\\*` families of functions. " -"Memory allocated with one family's :c:func:`\\*_Malloc` must be freed with " -"the corresponding family's :c:func:`\\*_Free` function." +"of the ``PyMem_*`` and ``PyObject_*`` families of functions. Memory " +"allocated with one family's ``*_Malloc`` must be freed with the " +"corresponding family's ``*_Free`` function." msgstr "" #: ../../whatsnew/2.5.rst:2281 diff --git a/whatsnew/2.6.po b/whatsnew/2.6.po index 2886bca075..16d7f6b8b1 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-09-26 00:21+0000\n" +"POT-Creation-Date: 2022-10-06 00:23+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-" @@ -2682,7 +2682,7 @@ msgstr "" #: ../../whatsnew/2.6.rst:2392 msgid "" -"The :mod:`struct` module now supports the C99 :c:type:`_Bool` type, using " +"The :mod:`struct` module now supports the C99 :c:expr:`_Bool` type, using " "the format character ``'?'``. (Contributed by David Remahl.)" msgstr "" diff --git a/whatsnew/2.7.po b/whatsnew/2.7.po index c1cbde62fb..f4f7b1316a 100644 --- a/whatsnew/2.7.po +++ b/whatsnew/2.7.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-10-06 00:23+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-" @@ -2504,7 +2504,7 @@ msgstr "" msgid "" "New functions: :c:func:`PyLong_AsLongAndOverflow` and :c:func:" "`PyLong_AsLongLongAndOverflow` approximates a Python long integer as a C :c:" -"type:`long` or :c:type:`long long`. If the number is too large to fit into " +"expr:`long` or :c:expr:`long long`. If the number is too large to fit into " "the output type, an *overflow* flag is set and returned to the caller. " "(Contributed by Case Van Horsen; :issue:`7528` and :issue:`7767`.)" msgstr "" @@ -2575,7 +2575,7 @@ msgstr "" msgid "" "New format codes: the :c:func:`PyFormat_FromString`, :c:func:" "`PyFormat_FromStringV`, and :c:func:`PyErr_Format` functions now accept ``" -"%lld`` and ``%llu`` format codes for displaying C's :c:type:`long long` " +"%lld`` and ``%llu`` format codes for displaying C's :c:expr:`long long` " "types. (Contributed by Mark Dickinson; :issue:`7228`.)" msgstr "" diff --git a/whatsnew/3.3.po b/whatsnew/3.3.po index bce2a207b2..de67dc5c04 100644 --- a/whatsnew/3.3.po +++ b/whatsnew/3.3.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-05 00:24+0000\n" +"POT-Creation-Date: 2022-10-06 00:23+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-" @@ -1242,7 +1242,7 @@ msgstr "array" #: ../../whatsnew/3.3.rst:935 msgid "" -"The :mod:`array` module supports the :c:type:`long long` type using ``q`` " +"The :mod:`array` module supports the :c:expr:`long long` type using ``q`` " "and ``Q`` type codes." msgstr "" diff --git a/whatsnew/3.7.po b/whatsnew/3.7.po index 58ec78dd31..b9b0d22fd0 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-09-28 00:27+0000\n" +"POT-Creation-Date: 2022-10-06 00:23+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-" @@ -402,7 +402,7 @@ msgstr "" msgid "" "While Python provides a C API for thread-local storage support; the " "existing :ref:`Thread Local Storage (TLS) API ` " -"has used :c:type:`int` to represent TLS keys across all platforms. This has " +"has used :c:expr:`int` to represent TLS keys across all platforms. This has " "not generally been a problem for officially support platforms, but that is " "neither POSIX-compliant, nor portable in any practical sense." msgstr "" @@ -413,16 +413,16 @@ msgid "" "(TSS) API ` to CPython which supersedes use of " "the existing TLS API within the CPython interpreter, while deprecating the " "existing API. The TSS API uses a new type :c:type:`Py_tss_t` instead of :c:" -"type:`int` to represent TSS keys--an opaque type the definition of which may " +"expr:`int` to represent TSS keys--an opaque type the definition of which may " "depend on the underlying TLS implementation. Therefore, this will allow to " "build CPython on platforms where the native TLS key is defined in a way that " -"cannot be safely cast to :c:type:`int`." +"cannot be safely cast to :c:expr:`int`." msgstr "" #: ../../whatsnew/3.7.rst:306 msgid "" "Note that on platforms where the native TLS key is defined in a way that " -"cannot be safely cast to :c:type:`int`, all functions of the existing TLS " +"cannot be safely cast to :c:expr:`int`, all functions of the existing TLS " "API will be no-op and immediately return failure. This indicates clearly " "that the old API is not supported on platforms where it cannot be used " "reliably, and that no effort will be made to add such support." @@ -2425,14 +2425,14 @@ msgstr "" msgid "" "The type of results of :c:func:`PyThread_start_new_thread` and :c:func:" "`PyThread_get_thread_ident`, and the *id* parameter of :c:func:" -"`PyThreadState_SetAsyncExc` changed from :c:type:`long` to :c:type:`unsigned " +"`PyThreadState_SetAsyncExc` changed from :c:expr:`long` to :c:expr:`unsigned " "long`. (Contributed by Serhiy Storchaka in :issue:`6532`.)" msgstr "" #: ../../whatsnew/3.7.rst:1715 msgid "" ":c:func:`PyUnicode_AsWideCharString` now raises a :exc:`ValueError` if the " -"second argument is ``NULL`` and the :c:type:`wchar_t*` string contains null " +"second argument is ``NULL`` and the :c:expr:`wchar_t*` string contains null " "characters. (Contributed by Serhiy Storchaka in :issue:`30708`.)" msgstr "" diff --git a/whatsnew/3.8.po b/whatsnew/3.8.po index 7528171878..4f603d9d05 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-28 00:27+0000\n" +"POT-Creation-Date: 2022-10-06 00:23+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-" @@ -2626,7 +2626,7 @@ msgstr "C API 中的改動" #: ../../whatsnew/3.8.rst:2015 msgid "" -"The :c:type:`PyCompilerFlags` structure got a new *cf_feature_version* " +"The :c:struct:`PyCompilerFlags` structure got a new *cf_feature_version* " "field. It should be initialized to ``PY_MINOR_VERSION``. The field is " "ignored by default, and is used if and only if ``PyCF_ONLY_AST`` flag is set " "in *cf_flags*. (Contributed by Guido van Rossum in :issue:`35766`.)" diff --git a/whatsnew/3.9.po b/whatsnew/3.9.po index a34c25d20f..f2ae41ddf5 100644 --- a/whatsnew/3.9.po +++ b/whatsnew/3.9.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-05-30 00:18+0000\n" +"POT-Creation-Date: 2022-10-06 00:23+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-" @@ -1170,7 +1170,7 @@ msgstr "" #: ../../whatsnew/3.9.rst:775 msgid "" ":c:func:`PyLong_FromDouble` is now up to 1.87x faster for values that fit " -"into :c:type:`long`. (Contributed by Sergey Fedoseev in :issue:`37986`.)" +"into :c:expr:`long`. (Contributed by Sergey Fedoseev in :issue:`37986`.)" msgstr "" #: ../../whatsnew/3.9.rst:779 From 0030559204719f7ef072079fd86334b150646a4c Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 7 Oct 2022 00:28:57 +0000 Subject: [PATCH 08/14] sync with cpython bc03bf42 --- c-api/unicode.po | 14 ++-- extending/newtypes.po | 12 +-- extending/newtypes_tutorial.po | 4 +- library/io.po | 4 +- reference/expressions.po | 143 ++++++++++++++++++--------------- reference/import.po | 57 +++---------- whatsnew/2.2.po | 4 +- whatsnew/2.5.po | 4 +- 8 files changed, 109 insertions(+), 133 deletions(-) diff --git a/c-api/unicode.po b/c-api/unicode.po index f804d74fc7..55c04fde53 100644 --- a/c-api/unicode.po +++ b/c-api/unicode.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-06 00:23+0000\n" +"POT-Creation-Date: 2022-10-07 00:27+0000\n" "PO-Revision-Date: 2018-05-23 14:08+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -40,8 +40,8 @@ msgstr "" #: ../../c-api/unicode.rst:20 msgid "" -":c:type:`Py_UNICODE*` and UTF-8 representations are created on demand and " -"cached in the Unicode object. The :c:type:`Py_UNICODE*` representation is " +":c:expr:`Py_UNICODE*` and UTF-8 representations are created on demand and " +"cached in the Unicode object. The :c:expr:`Py_UNICODE*` representation is " "deprecated and inefficient." msgstr "" @@ -61,7 +61,7 @@ msgstr "" #: ../../c-api/unicode.rst:31 msgid "" "\"legacy\" Unicode objects have been created through one of the deprecated " -"APIs (typically :c:func:`PyUnicode_FromUnicode`) and only bear the :c:type:" +"APIs (typically :c:func:`PyUnicode_FromUnicode`) and only bear the :c:expr:" "`Py_UNICODE*` representation; you will have to call :c:func:" "`PyUnicode_READY` on them before calling any other API." msgstr "" @@ -242,7 +242,7 @@ msgid "" "The returned buffer is always terminated with an extra null code point. It " "may also contain embedded null code points, which would cause the string to " "be truncated when used in most C functions. The ``AS_DATA`` form casts the " -"pointer to :c:type:`const char *`. The *o* argument has to be a Unicode " +"pointer to :c:expr:`const char *`. The *o* argument has to be a Unicode " "object (not checked)." msgstr "" @@ -895,7 +895,7 @@ msgstr "" #: ../../c-api/unicode.rst:708 msgid "" "Return a read-only pointer to the Unicode object's internal :c:type:" -"`Py_UNICODE` buffer, or ``NULL`` on error. This will create the :c:type:" +"`Py_UNICODE` buffer, or ``NULL`` on error. This will create the :c:expr:" "`Py_UNICODE*` representation of the object if it is not yet available. The " "buffer is always terminated with an extra null code point. Note that the " "resulting :c:type:`Py_UNICODE` string may also contain embedded null code " @@ -927,7 +927,7 @@ msgstr "" msgid "" "Like :c:func:`PyUnicode_AsUnicode`, but also saves the :c:func:`Py_UNICODE` " "array length (excluding the extra null terminator) in *size*. Note that the " -"resulting :c:type:`Py_UNICODE*` string may contain embedded null code " +"resulting :c:expr:`Py_UNICODE*` string may contain embedded null code " "points, which would cause the string to be truncated when used in most C " "functions." msgstr "" diff --git a/extending/newtypes.po b/extending/newtypes.po index 8751ac94be..b4147feccc 100644 --- a/extending/newtypes.po +++ b/extending/newtypes.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-06 00:23+0000\n" +"POT-Creation-Date: 2022-10-07 00:27+0000\n" "PO-Revision-Date: 2018-05-23 14:34+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -200,15 +200,15 @@ msgid "" "Python supports two pairs of attribute handlers; a type that supports " "attributes only needs to implement the functions for one pair. The " "difference is that one pair takes the name of the attribute as a :c:expr:" -"`char\\*`, while the other accepts a :c:type:`PyObject\\*`. Each type can " -"use whichever pair makes more sense for the implementation's convenience. ::" +"`char\\*`, while the other accepts a :c:expr:`PyObject*`. Each type can use " +"whichever pair makes more sense for the implementation's convenience. ::" msgstr "" #: ../../extending/newtypes.rst:220 msgid "" "If accessing attributes of an object is always a simple operation (this will " "be explained shortly), there are generic implementations which can be used " -"to provide the :c:type:`PyObject\\*` version of the attribute management " +"to provide the :c:expr:`PyObject*` version of the attribute management " "functions. The actual need for type-specific attribute handlers almost " "completely disappeared starting with Python 2.2, though there are many " "examples which have not been updated to use some of the new generic " @@ -357,7 +357,7 @@ msgstr "" msgid "" "For simplicity, only the :c:expr:`char\\*` version will be demonstrated " "here; the type of the name parameter is the only difference between the :c:" -"expr:`char\\*` and :c:type:`PyObject\\*` flavors of the interface. This " +"expr:`char\\*` and :c:expr:`PyObject*` flavors of the interface. This " "example effectively does the same thing as the generic example above, but " "does not use the generic support added in Python 2.2. It explains how the " "handler functions are called, so that if you do need to extend their " @@ -575,7 +575,7 @@ msgstr "" #: ../../extending/newtypes.rst:575 msgid "" -"Include a :c:type:`PyObject\\*` field in the C object structure dedicated to " +"Include a :c:expr:`PyObject*` field in the C object structure dedicated to " "the weak reference mechanism. The object's constructor should leave it " "``NULL`` (which is automatic when using the default :c:member:`~PyTypeObject." "tp_alloc`)." diff --git a/extending/newtypes_tutorial.po b/extending/newtypes_tutorial.po index a6ae0a0d0e..5133485900 100644 --- a/extending/newtypes_tutorial.po +++ b/extending/newtypes_tutorial.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-04-06 00:13+0000\n" +"POT-Creation-Date: 2022-10-07 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" @@ -35,7 +35,7 @@ msgstr "" #: ../../extending/newtypes_tutorial.rst:26 msgid "" "The :term:`CPython` runtime sees all Python objects as variables of type :c:" -"type:`PyObject\\*`, which serves as a \"base type\" for all Python objects. " +"expr:`PyObject*`, which serves as a \"base type\" for all Python objects. " "The :c:type:`PyObject` structure itself only contains the object's :term:" "`reference count` and a pointer to the object's \"type object\". This is " "where the action is; the type object determines which (C) functions get " diff --git a/library/io.po b/library/io.po index 7bca2f2cb4..91694f4826 100644 --- a/library/io.po +++ b/library/io.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-03-04 18:37+0000\n" +"POT-Creation-Date: 2022-10-07 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-" @@ -349,7 +349,7 @@ msgid "" "The :class:`BufferedIOBase` ABC extends :class:`IOBase`. It deals with " "buffering on a raw binary stream (:class:`RawIOBase`). Its subclasses, :" "class:`BufferedWriter`, :class:`BufferedReader`, and :class:`BufferedRWPair` " -"buffer raw binary streams that are readable, writable, and both readable and " +"buffer raw binary streams that are writable, readable, and both readable and " "writable, respectively. :class:`BufferedRandom` provides a buffered " "interface to seekable streams. Another :class:`BufferedIOBase` subclass, :" "class:`BytesIO`, is a stream of in-memory bytes." diff --git a/reference/expressions.po b/reference/expressions.po index 4ab05739c4..2668e3b72d 100644 --- a/reference/expressions.po +++ b/reference/expressions.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-09-23 00:21+0000\n" +"POT-Creation-Date: 2022-10-07 00:27+0000\n" "PO-Revision-Date: 2018-05-23 16:17+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1162,7 +1162,7 @@ msgid "" "as if that method was called." msgstr "" -#: ../../reference/expressions.rst:1138 ../../reference/expressions.rst:1904 +#: ../../reference/expressions.rst:1138 ../../reference/expressions.rst:1911 msgid "Await expression" msgstr "" @@ -1871,35 +1871,44 @@ msgid "Or, when processing a file stream in chunks:" msgstr "" #: ../../reference/expressions.rst:1751 -msgid "See :pep:`572` for more details about assignment expressions." +msgid "" +"Assignment expressions must be surrounded by parentheses when used as sub-" +"expressions in slicing, conditional, lambda, keyword-argument, and " +"comprehension-if expressions and in ``assert`` and ``with`` statements. In " +"all other places where they can be used, parentheses are not required, " +"including in ``if`` and ``while`` statements." msgstr "" #: ../../reference/expressions.rst:1758 +msgid "See :pep:`572` for more details about assignment expressions." +msgstr "" + +#: ../../reference/expressions.rst:1765 msgid "Conditional expressions" msgstr "" -#: ../../reference/expressions.rst:1770 +#: ../../reference/expressions.rst:1777 msgid "" "Conditional expressions (sometimes called a \"ternary operator\") have the " "lowest priority of all Python operations." msgstr "" -#: ../../reference/expressions.rst:1773 +#: ../../reference/expressions.rst:1780 msgid "" "The expression ``x if C else y`` first evaluates the condition, *C* rather " "than *x*. If *C* is true, *x* is evaluated and its value is returned; " "otherwise, *y* is evaluated and its value is returned." msgstr "" -#: ../../reference/expressions.rst:1777 +#: ../../reference/expressions.rst:1784 msgid "See :pep:`308` for more details about conditional expressions." msgstr "" -#: ../../reference/expressions.rst:1784 +#: ../../reference/expressions.rst:1791 msgid "Lambdas" msgstr "" -#: ../../reference/expressions.rst:1795 +#: ../../reference/expressions.rst:1802 msgid "" "Lambda expressions (sometimes called lambda forms) are used to create " "anonymous functions. The expression ``lambda parameters: expression`` yields " @@ -1907,25 +1916,25 @@ msgid "" "defined with:" msgstr "" -#: ../../reference/expressions.rst:1804 +#: ../../reference/expressions.rst:1811 msgid "" "See section :ref:`function` for the syntax of parameter lists. Note that " "functions created with lambda expressions cannot contain statements or " "annotations." msgstr "" -#: ../../reference/expressions.rst:1812 +#: ../../reference/expressions.rst:1819 msgid "Expression lists" msgstr "" -#: ../../reference/expressions.rst:1826 +#: ../../reference/expressions.rst:1833 msgid "" "Except when part of a list or set display, an expression list containing at " "least one comma yields a tuple. The length of the tuple is the number of " "expressions in the list. The expressions are evaluated from left to right." msgstr "" -#: ../../reference/expressions.rst:1835 +#: ../../reference/expressions.rst:1842 msgid "" "An asterisk ``*`` denotes :dfn:`iterable unpacking`. Its operand must be " "an :term:`iterable`. The iterable is expanded into a sequence of items, " @@ -1933,12 +1942,12 @@ msgid "" "unpacking." msgstr "" -#: ../../reference/expressions.rst:1840 +#: ../../reference/expressions.rst:1847 msgid "" "Iterable unpacking in expression lists, originally proposed by :pep:`448`." msgstr "" -#: ../../reference/expressions.rst:1845 +#: ../../reference/expressions.rst:1852 msgid "" "The trailing comma is required only to create a single tuple (a.k.a. a " "*singleton*); it is optional in all other cases. A single expression " @@ -1947,28 +1956,28 @@ msgid "" "parentheses: ``()``.)" msgstr "" -#: ../../reference/expressions.rst:1855 +#: ../../reference/expressions.rst:1862 msgid "Evaluation order" msgstr "" -#: ../../reference/expressions.rst:1859 +#: ../../reference/expressions.rst:1866 msgid "" "Python evaluates expressions from left to right. Notice that while " "evaluating an assignment, the right-hand side is evaluated before the left-" "hand side." msgstr "" -#: ../../reference/expressions.rst:1862 +#: ../../reference/expressions.rst:1869 msgid "" "In the following lines, expressions will be evaluated in the arithmetic " "order of their suffixes::" msgstr "" -#: ../../reference/expressions.rst:1876 +#: ../../reference/expressions.rst:1883 msgid "Operator precedence" msgstr "" -#: ../../reference/expressions.rst:1881 +#: ../../reference/expressions.rst:1888 msgid "" "The following table summarizes the operator precedence in Python, from " "highest precedence (most binding) to lowest precedence (least binding). " @@ -1977,176 +1986,176 @@ msgid "" "left to right (except for exponentiation, which groups from right to left)." msgstr "" -#: ../../reference/expressions.rst:1887 +#: ../../reference/expressions.rst:1894 msgid "" "Note that comparisons, membership tests, and identity tests, all have the " "same precedence and have a left-to-right chaining feature as described in " "the :ref:`comparisons` section." msgstr "" -#: ../../reference/expressions.rst:1893 +#: ../../reference/expressions.rst:1900 msgid "Operator" msgstr "" -#: ../../reference/expressions.rst:1893 +#: ../../reference/expressions.rst:1900 msgid "Description" msgstr "描述" -#: ../../reference/expressions.rst:1895 +#: ../../reference/expressions.rst:1902 msgid "``(expressions...)``," msgstr "``(expressions...)``," -#: ../../reference/expressions.rst:1897 +#: ../../reference/expressions.rst:1904 msgid "``[expressions...]``, ``{key: value...}``, ``{expressions...}``" msgstr "``[expressions...]``, ``{key: value...}``, ``{expressions...}``" -#: ../../reference/expressions.rst:1895 +#: ../../reference/expressions.rst:1902 msgid "" "Binding or parenthesized expression, list display, dictionary display, set " "display" msgstr "" -#: ../../reference/expressions.rst:1901 +#: ../../reference/expressions.rst:1908 msgid "``x[index]``, ``x[index:index]``, ``x(arguments...)``, ``x.attribute``" msgstr "``x[index]``, ``x[index:index]``, ``x(arguments...)``, ``x.attribute``" -#: ../../reference/expressions.rst:1901 +#: ../../reference/expressions.rst:1908 msgid "Subscription, slicing, call, attribute reference" msgstr "" -#: ../../reference/expressions.rst:1904 +#: ../../reference/expressions.rst:1911 msgid ":keyword:`await x `" msgstr ":keyword:`await x `" -#: ../../reference/expressions.rst:1906 +#: ../../reference/expressions.rst:1913 msgid "``**``" msgstr "``**``" -#: ../../reference/expressions.rst:1906 +#: ../../reference/expressions.rst:1913 msgid "Exponentiation [#]_" msgstr "" -#: ../../reference/expressions.rst:1908 +#: ../../reference/expressions.rst:1915 msgid "``+x``, ``-x``, ``~x``" msgstr "``+x``, ``-x``, ``~x``" -#: ../../reference/expressions.rst:1908 +#: ../../reference/expressions.rst:1915 msgid "Positive, negative, bitwise NOT" msgstr "" -#: ../../reference/expressions.rst:1910 +#: ../../reference/expressions.rst:1917 msgid "``*``, ``@``, ``/``, ``//``, ``%``" msgstr "``*``, ``@``, ``/``, ``//``, ``%``" -#: ../../reference/expressions.rst:1910 +#: ../../reference/expressions.rst:1917 msgid "" "Multiplication, matrix multiplication, division, floor division, remainder " "[#]_" msgstr "" -#: ../../reference/expressions.rst:1914 +#: ../../reference/expressions.rst:1921 msgid "``+``, ``-``" msgstr "``+``, ``-``" -#: ../../reference/expressions.rst:1914 +#: ../../reference/expressions.rst:1921 msgid "Addition and subtraction" msgstr "" -#: ../../reference/expressions.rst:1916 +#: ../../reference/expressions.rst:1923 msgid "``<<``, ``>>``" msgstr "``<<``, ``>>``" -#: ../../reference/expressions.rst:1916 +#: ../../reference/expressions.rst:1923 msgid "Shifts" msgstr "" -#: ../../reference/expressions.rst:1918 +#: ../../reference/expressions.rst:1925 msgid "``&``" msgstr "``&``" -#: ../../reference/expressions.rst:1918 +#: ../../reference/expressions.rst:1925 msgid "Bitwise AND" msgstr "" -#: ../../reference/expressions.rst:1920 +#: ../../reference/expressions.rst:1927 msgid "``^``" msgstr "``^``" -#: ../../reference/expressions.rst:1920 +#: ../../reference/expressions.rst:1927 msgid "Bitwise XOR" msgstr "" -#: ../../reference/expressions.rst:1922 +#: ../../reference/expressions.rst:1929 msgid "``|``" msgstr "``|``" -#: ../../reference/expressions.rst:1922 +#: ../../reference/expressions.rst:1929 msgid "Bitwise OR" msgstr "" -#: ../../reference/expressions.rst:1924 +#: ../../reference/expressions.rst:1931 msgid "" ":keyword:`in`, :keyword:`not in`, :keyword:`is`, :keyword:`is not`, ``<``, " "``<=``, ``>``, ``>=``, ``!=``, ``==``" msgstr "" -#: ../../reference/expressions.rst:1924 +#: ../../reference/expressions.rst:1931 msgid "Comparisons, including membership tests and identity tests" msgstr "" -#: ../../reference/expressions.rst:1928 +#: ../../reference/expressions.rst:1935 msgid ":keyword:`not x `" msgstr ":keyword:`not x `" -#: ../../reference/expressions.rst:1928 +#: ../../reference/expressions.rst:1935 msgid "Boolean NOT" msgstr "" -#: ../../reference/expressions.rst:1930 +#: ../../reference/expressions.rst:1937 msgid ":keyword:`and`" msgstr ":keyword:`and`" -#: ../../reference/expressions.rst:1930 +#: ../../reference/expressions.rst:1937 msgid "Boolean AND" msgstr "" -#: ../../reference/expressions.rst:1932 +#: ../../reference/expressions.rst:1939 msgid ":keyword:`or`" msgstr ":keyword:`or`" -#: ../../reference/expressions.rst:1932 +#: ../../reference/expressions.rst:1939 msgid "Boolean OR" msgstr "" -#: ../../reference/expressions.rst:1934 +#: ../../reference/expressions.rst:1941 msgid ":keyword:`if ` -- :keyword:`!else`" msgstr ":keyword:`if ` -- :keyword:`!else`" -#: ../../reference/expressions.rst:1934 +#: ../../reference/expressions.rst:1941 msgid "Conditional expression" msgstr "" -#: ../../reference/expressions.rst:1936 +#: ../../reference/expressions.rst:1943 msgid ":keyword:`lambda`" msgstr ":keyword:`lambda`" -#: ../../reference/expressions.rst:1936 +#: ../../reference/expressions.rst:1943 msgid "Lambda expression" msgstr "" -#: ../../reference/expressions.rst:1938 +#: ../../reference/expressions.rst:1945 msgid "``:=``" msgstr "``:=``" -#: ../../reference/expressions.rst:1938 +#: ../../reference/expressions.rst:1945 msgid "Assignment expression" msgstr "" -#: ../../reference/expressions.rst:1943 +#: ../../reference/expressions.rst:1950 msgid "Footnotes" msgstr "註解" -#: ../../reference/expressions.rst:1944 +#: ../../reference/expressions.rst:1951 msgid "" "While ``abs(x%y) < abs(y)`` is true mathematically, for floats it may not be " "true numerically due to roundoff. For example, and assuming a platform on " @@ -2158,7 +2167,7 @@ msgid "" "approach is more appropriate depends on the application." msgstr "" -#: ../../reference/expressions.rst:1953 +#: ../../reference/expressions.rst:1960 msgid "" "If x is very close to an exact integer multiple of y, it's possible for ``x//" "y`` to be one larger than ``(x-x%y)//y`` due to rounding. In such cases, " @@ -2166,7 +2175,7 @@ msgid "" "* y + x % y`` be very close to ``x``." msgstr "" -#: ../../reference/expressions.rst:1958 +#: ../../reference/expressions.rst:1965 msgid "" "The Unicode standard distinguishes between :dfn:`code points` (e.g. U+0041) " "and :dfn:`abstract characters` (e.g. \"LATIN CAPITAL LETTER A\"). While most " @@ -2180,7 +2189,7 @@ msgid "" "(COMBINING CEDILLA)." msgstr "" -#: ../../reference/expressions.rst:1969 +#: ../../reference/expressions.rst:1976 msgid "" "The comparison operators on strings compare at the level of Unicode code " "points. This may be counter-intuitive to humans. For example, ``\"\\u00C7\" " @@ -2188,13 +2197,13 @@ msgid "" "same abstract character \"LATIN CAPITAL LETTER C WITH CEDILLA\"." msgstr "" -#: ../../reference/expressions.rst:1974 +#: ../../reference/expressions.rst:1981 msgid "" "To compare strings at the level of abstract characters (that is, in a way " "intuitive to humans), use :func:`unicodedata.normalize`." msgstr "" -#: ../../reference/expressions.rst:1977 +#: ../../reference/expressions.rst:1984 msgid "" "Due to automatic garbage-collection, free lists, and the dynamic nature of " "descriptors, you may notice seemingly unusual behaviour in certain uses of " @@ -2202,13 +2211,13 @@ msgid "" "instance methods, or constants. Check their documentation for more info." msgstr "" -#: ../../reference/expressions.rst:1982 +#: ../../reference/expressions.rst:1989 msgid "" "The power operator ``**`` binds less tightly than an arithmetic or bitwise " "unary operator on its right, that is, ``2**-1`` is ``0.5``." msgstr "" -#: ../../reference/expressions.rst:1985 +#: ../../reference/expressions.rst:1992 msgid "" "The ``%`` operator is also used for string formatting; the same precedence " "applies." diff --git a/reference/import.po b/reference/import.po index 5cdb06702d..24378fb120 100644 --- a/reference/import.po +++ b/reference/import.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-07 00:27+0000\n" "PO-Revision-Date: 2018-05-23 16:17+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1309,43 +1309,10 @@ msgid "" msgstr "" #: ../../reference/import.rst:1019 -msgid "Open issues" -msgstr "" - -#: ../../reference/import.rst:1021 -msgid "XXX It would be really nice to have a diagram." -msgstr "" - -#: ../../reference/import.rst:1023 -msgid "" -"XXX * (import_machinery.rst) how about a section devoted just to the " -"attributes of modules and packages, perhaps expanding upon or supplanting " -"the related entries in the data model reference page?" -msgstr "" - -#: ../../reference/import.rst:1027 -msgid "" -"XXX runpy, pkgutil, et al in the library manual should all get \"See Also\" " -"links at the top pointing to the new import system section." -msgstr "" - -#: ../../reference/import.rst:1030 -msgid "" -"XXX Add more explanation regarding the different ways in which ``__main__`` " -"is initialized?" -msgstr "" - -#: ../../reference/import.rst:1033 -msgid "" -"XXX Add more info on ``__main__`` quirks/pitfalls (i.e. copy from :pep:" -"`395`)." -msgstr "" - -#: ../../reference/import.rst:1038 msgid "References" msgstr "" -#: ../../reference/import.rst:1040 +#: ../../reference/import.rst:1021 msgid "" "The import machinery has evolved considerably since Python's early days. " "The original `specification for packages ` for " "Python 3.3. :pep:`420` also introduced the :meth:`find_loader` protocol as " "an alternative to :meth:`find_module`." msgstr "" -#: ../../reference/import.rst:1052 +#: ../../reference/import.rst:1033 msgid "" ":pep:`366` describes the addition of the ``__package__`` attribute for " "explicit relative imports in main modules." msgstr "" -#: ../../reference/import.rst:1055 +#: ../../reference/import.rst:1036 msgid "" ":pep:`328` introduced absolute and explicit relative imports and initially " "proposed ``__name__`` for semantics :pep:`366` would eventually specify for " "``__package__``." msgstr "" -#: ../../reference/import.rst:1059 +#: ../../reference/import.rst:1040 msgid ":pep:`338` defines executing modules as scripts." msgstr "" -#: ../../reference/import.rst:1061 +#: ../../reference/import.rst:1042 msgid "" ":pep:`451` adds the encapsulation of per-module import state in spec " "objects. It also off-loads most of the boilerplate responsibilities of " @@ -1392,15 +1359,15 @@ msgid "" "finders and loaders." msgstr "" -#: ../../reference/import.rst:1068 +#: ../../reference/import.rst:1049 msgid "Footnotes" msgstr "註解" -#: ../../reference/import.rst:1069 +#: ../../reference/import.rst:1050 msgid "See :class:`types.ModuleType`." msgstr "參閱 :class:`types.ModuleType`\\ 。" -#: ../../reference/import.rst:1071 +#: ../../reference/import.rst:1052 msgid "" "The importlib implementation avoids using the return value directly. " "Instead, it gets the module object by looking the module name up in :data:" @@ -1409,7 +1376,7 @@ msgid "" "behavior that is not guaranteed to work in other Python implementations." msgstr "" -#: ../../reference/import.rst:1078 +#: ../../reference/import.rst:1059 msgid "" "In legacy code, it is possible to find instances of :class:`imp." "NullImporter` in the :data:`sys.path_importer_cache`. It is recommended " diff --git a/whatsnew/2.2.po b/whatsnew/2.2.po index e2477d8955..dd995a0a1c 100644 --- a/whatsnew/2.2.po +++ b/whatsnew/2.2.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-06 00:23+0000\n" +"POT-Creation-Date: 2022-10-07 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-" @@ -1310,7 +1310,7 @@ msgid "" "A different argument parsing function, :c:func:`PyArg_UnpackTuple`, has been " "added that's simpler and presumably faster. Instead of specifying a format " "string, the caller simply gives the minimum and maximum number of arguments " -"expected, and a set of pointers to :c:type:`PyObject\\*` variables that will " +"expected, and a set of pointers to :c:expr:`PyObject*` variables that will " "be filled in with argument values." msgstr "" diff --git a/whatsnew/2.5.po b/whatsnew/2.5.po index da06d6e6bd..c835db0098 100644 --- a/whatsnew/2.5.po +++ b/whatsnew/2.5.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-06 00:23+0000\n" +"POT-Creation-Date: 2022-10-07 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-" @@ -2031,7 +2031,7 @@ msgid "" "pythonapi`` object. This object does *not* release the global interpreter " "lock before calling a function, because the lock must be held when calling " "into the interpreter's code. There's a :class:`py_object()` type " -"constructor that will create a :c:type:`PyObject \\*` pointer. A simple " +"constructor that will create a :c:expr:`PyObject *` pointer. A simple " "usage::" msgstr "" From 3179e7701f3e6833dde2d4ab4ee334adfaa83076 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sat, 8 Oct 2022 00:23:26 +0000 Subject: [PATCH 09/14] sync with cpython 02394400 --- c-api/conversion.po | 46 ++-- library/csv.po | 4 +- library/dis.po | 479 ++++++++++++++++++++-------------------- library/functions.po | 8 +- library/urllib.parse.po | 305 +++++++++++++------------ 5 files changed, 424 insertions(+), 418 deletions(-) diff --git a/c-api/conversion.po b/c-api/conversion.po index c74e195c44..ddb056770a 100644 --- a/c-api/conversion.po +++ b/c-api/conversion.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-06 00:23+0000\n" +"POT-Creation-Date: 2022-10-08 00:21+0000\n" "PO-Revision-Date: 2017-09-22 18:26+0000\n" "Last-Translator: Leon H.\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -55,42 +55,44 @@ msgid "" "The wrappers ensure that ``str[size-1]`` is always ``'\\0'`` upon return. " "They never write more than *size* bytes (including the trailing ``'\\0'``) " "into str. Both functions require that ``str != NULL``, ``size > 0``, " -"``format != NULL`` and ``size < INT_MAX``." +"``format != NULL`` and ``size < INT_MAX``. Note that this means there is no " +"equivalent to the C99 ``n = snprintf(NULL, 0, ...)`` which would determine " +"the necessary buffer size." msgstr "" -#: ../../c-api/conversion.rst:33 +#: ../../c-api/conversion.rst:34 msgid "" "The return value (*rv*) for these functions should be interpreted as follows:" msgstr "當回傳值 (*rv*) 給這些函數應該被編譯如下:" -#: ../../c-api/conversion.rst:35 +#: ../../c-api/conversion.rst:36 msgid "" "When ``0 <= rv < size``, the output conversion was successful and *rv* " "characters were written to *str* (excluding the trailing ``'\\0'`` byte at " "``str[rv]``)." msgstr "" -#: ../../c-api/conversion.rst:39 +#: ../../c-api/conversion.rst:40 msgid "" "When ``rv >= size``, the output conversion was truncated and a buffer with " "``rv + 1`` bytes would have been needed to succeed. ``str[size-1]`` is " "``'\\0'`` in this case." msgstr "" -#: ../../c-api/conversion.rst:43 +#: ../../c-api/conversion.rst:44 msgid "" "When ``rv < 0``, \"something bad happened.\" ``str[size-1]`` is ``'\\0'`` in " "this case too, but the rest of *str* is undefined. The exact cause of the " "error depends on the underlying platform." msgstr "" -#: ../../c-api/conversion.rst:48 +#: ../../c-api/conversion.rst:49 msgid "" "The following functions provide locale-independent string to number " "conversions." msgstr "" -#: ../../c-api/conversion.rst:52 +#: ../../c-api/conversion.rst:53 msgid "" "Convert a string ``s`` to a :c:expr:`double`, raising a Python exception on " "failure. The set of accepted strings corresponds to the set of strings " @@ -99,14 +101,14 @@ msgid "" "current locale." msgstr "" -#: ../../c-api/conversion.rst:58 +#: ../../c-api/conversion.rst:59 msgid "" "If ``endptr`` is ``NULL``, convert the whole string. Raise :exc:" "`ValueError` and return ``-1.0`` if the string is not a valid representation " "of a floating-point number." msgstr "" -#: ../../c-api/conversion.rst:62 +#: ../../c-api/conversion.rst:63 msgid "" "If endptr is not ``NULL``, convert as much of the string as possible and set " "``*endptr`` to point to the first unconverted character. If no initial " @@ -115,7 +117,7 @@ msgid "" "ValueError, and return ``-1.0``." msgstr "" -#: ../../c-api/conversion.rst:69 +#: ../../c-api/conversion.rst:70 msgid "" "If ``s`` represents a value that is too large to store in a float (for " "example, ``\"1e500\"`` is such a string on many platforms) then if " @@ -126,50 +128,50 @@ msgid "" "the first character after the converted value." msgstr "" -#: ../../c-api/conversion.rst:77 +#: ../../c-api/conversion.rst:78 msgid "" "If any other error occurs during the conversion (for example an out-of-" "memory error), set the appropriate Python exception and return ``-1.0``." msgstr "" -#: ../../c-api/conversion.rst:86 +#: ../../c-api/conversion.rst:87 msgid "" "Convert a :c:expr:`double` *val* to a string using supplied *format_code*, " "*precision*, and *flags*." msgstr "" -#: ../../c-api/conversion.rst:89 +#: ../../c-api/conversion.rst:90 msgid "" "*format_code* must be one of ``'e'``, ``'E'``, ``'f'``, ``'F'``, ``'g'``, " "``'G'`` or ``'r'``. For ``'r'``, the supplied *precision* must be 0 and is " "ignored. The ``'r'`` format code specifies the standard :func:`repr` format." msgstr "" -#: ../../c-api/conversion.rst:94 +#: ../../c-api/conversion.rst:95 msgid "" "*flags* can be zero or more of the values ``Py_DTSF_SIGN``, " "``Py_DTSF_ADD_DOT_0``, or ``Py_DTSF_ALT``, or-ed together:" msgstr "" -#: ../../c-api/conversion.rst:97 +#: ../../c-api/conversion.rst:98 msgid "" "``Py_DTSF_SIGN`` means to always precede the returned string with a sign " "character, even if *val* is non-negative." msgstr "" -#: ../../c-api/conversion.rst:100 +#: ../../c-api/conversion.rst:101 msgid "" "``Py_DTSF_ADD_DOT_0`` means to ensure that the returned string will not look " "like an integer." msgstr "" -#: ../../c-api/conversion.rst:103 +#: ../../c-api/conversion.rst:104 msgid "" "``Py_DTSF_ALT`` means to apply \"alternate\" formatting rules. See the " "documentation for the :c:func:`PyOS_snprintf` ``'#'`` specifier for details." msgstr "" -#: ../../c-api/conversion.rst:107 +#: ../../c-api/conversion.rst:108 msgid "" "If *ptype* is non-``NULL``, then the value it points to will be set to one " "of ``Py_DTST_FINITE``, ``Py_DTST_INFINITE``, or ``Py_DTST_NAN``, signifying " @@ -177,20 +179,20 @@ msgid "" "respectively." msgstr "" -#: ../../c-api/conversion.rst:111 +#: ../../c-api/conversion.rst:112 msgid "" "The return value is a pointer to *buffer* with the converted string or " "``NULL`` if the conversion failed. The caller is responsible for freeing the " "returned string by calling :c:func:`PyMem_Free`." msgstr "" -#: ../../c-api/conversion.rst:120 +#: ../../c-api/conversion.rst:121 msgid "" "Case insensitive comparison of strings. The function works almost " "identically to :c:func:`strcmp` except that it ignores the case." msgstr "" -#: ../../c-api/conversion.rst:126 +#: ../../c-api/conversion.rst:127 msgid "" "Case insensitive comparison of strings. The function works almost " "identically to :c:func:`strncmp` except that it ignores the case." diff --git a/library/csv.po b/library/csv.po index 9715aacb69..5d8917b98e 100644 --- a/library/csv.po +++ b/library/csv.po @@ -7,7 +7,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-10-08 00:21+0000\n" "PO-Revision-Date: 2018-05-23 14:42+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -429,7 +429,7 @@ msgstr "" #: ../../library/csv.rst:415 msgid "" -"When :const:`True`, whitespace immediately following the *delimiter* is " +"When :const:`True`, spaces immediately following the *delimiter* are " "ignored. The default is :const:`False`." msgstr "" diff --git a/library/dis.po b/library/dis.po index 3a7100c383..efecb32f8b 100644 --- a/library/dis.po +++ b/library/dis.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-07-01 00:17+0000\n" +"POT-Creation-Date: 2022-10-08 00:21+0000\n" "PO-Revision-Date: 2018-07-27 16:55+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -52,46 +52,52 @@ msgid "" "instruction." msgstr "" -#: ../../library/dis.rst:28 +#: ../../library/dis.rst:27 +msgid "" +"The argument of jump, exception handling and loop instructions is now the " +"instruction offset rather than the byte offset." +msgstr "" + +#: ../../library/dis.rst:32 msgid "Example: Given the function :func:`myfunc`::" msgstr "" -#: ../../library/dis.rst:33 +#: ../../library/dis.rst:37 msgid "" "the following command can be used to display the disassembly of :func:" "`myfunc`::" msgstr "" -#: ../../library/dis.rst:42 +#: ../../library/dis.rst:46 msgid "(The \"2\" is a line number)." msgstr "" -#: ../../library/dis.rst:45 +#: ../../library/dis.rst:49 msgid "Bytecode analysis" msgstr "" -#: ../../library/dis.rst:49 +#: ../../library/dis.rst:53 msgid "" "The bytecode analysis API allows pieces of Python code to be wrapped in a :" "class:`Bytecode` object that provides easy access to details of the compiled " "code." msgstr "" -#: ../../library/dis.rst:56 +#: ../../library/dis.rst:60 msgid "" "Analyse the bytecode corresponding to a function, generator, asynchronous " "generator, coroutine, method, string of source code, or a code object (as " "returned by :func:`compile`)." msgstr "" -#: ../../library/dis.rst:60 +#: ../../library/dis.rst:64 msgid "" "This is a convenience wrapper around many of the functions listed below, " "most notably :func:`get_instructions`, as iterating over a :class:`Bytecode` " "instance yields the bytecode operations as :class:`Instruction` instances." msgstr "" -#: ../../library/dis.rst:64 ../../library/dis.rst:225 +#: ../../library/dis.rst:68 ../../library/dis.rst:229 msgid "" "If *first_line* is not ``None``, it indicates the line number that should be " "reported for the first source line in the disassembled code. Otherwise, the " @@ -99,55 +105,56 @@ msgid "" "code object." msgstr "" -#: ../../library/dis.rst:69 +#: ../../library/dis.rst:73 msgid "" "If *current_offset* is not ``None``, it refers to an instruction offset in " "the disassembled code. Setting this means :meth:`.dis` will display a " "\"current instruction\" marker against the specified opcode." msgstr "" -#: ../../library/dis.rst:75 +#: ../../library/dis.rst:79 msgid "" "Construct a :class:`Bytecode` instance from the given traceback, setting " "*current_offset* to the instruction responsible for the exception." msgstr "" -#: ../../library/dis.rst:80 +#: ../../library/dis.rst:84 msgid "The compiled code object." msgstr "" -#: ../../library/dis.rst:84 +#: ../../library/dis.rst:88 msgid "The first source line of the code object (if available)" msgstr "" -#: ../../library/dis.rst:88 +#: ../../library/dis.rst:92 msgid "" "Return a formatted view of the bytecode operations (the same as printed by :" "func:`dis.dis`, but returned as a multi-line string)." msgstr "" -#: ../../library/dis.rst:93 +#: ../../library/dis.rst:97 msgid "" "Return a formatted multi-line string with detailed information about the " "code object, like :func:`code_info`." msgstr "" -#: ../../library/dis.rst:96 ../../library/dis.rst:130 ../../library/dis.rst:176 +#: ../../library/dis.rst:100 ../../library/dis.rst:134 +#: ../../library/dis.rst:180 msgid "This can now handle coroutine and asynchronous generator objects." msgstr "" -#: ../../library/dis.rst:99 +#: ../../library/dis.rst:103 msgid "Example::" msgstr "" "範例:\n" "\n" "::" -#: ../../library/dis.rst:112 +#: ../../library/dis.rst:116 msgid "Analysis functions" msgstr "" -#: ../../library/dis.rst:114 +#: ../../library/dis.rst:118 msgid "" "The :mod:`dis` module also defines the following analysis functions that " "convert the input directly to the desired output. They can be useful if only " @@ -155,39 +162,39 @@ msgid "" "isn't useful:" msgstr "" -#: ../../library/dis.rst:120 +#: ../../library/dis.rst:124 msgid "" "Return a formatted multi-line string with detailed code object information " "for the supplied function, generator, asynchronous generator, coroutine, " "method, source code string or code object." msgstr "" -#: ../../library/dis.rst:124 +#: ../../library/dis.rst:128 msgid "" "Note that the exact contents of code info strings are highly implementation " "dependent and they may change arbitrarily across Python VMs or Python " "releases." msgstr "" -#: ../../library/dis.rst:136 +#: ../../library/dis.rst:140 msgid "" "Print detailed code object information for the supplied function, method, " "source code string or code object to *file* (or ``sys.stdout`` if *file* is " "not specified)." msgstr "" -#: ../../library/dis.rst:140 +#: ../../library/dis.rst:144 msgid "" "This is a convenient shorthand for ``print(code_info(x), file=file)``, " "intended for interactive exploration at the interpreter prompt." msgstr "" -#: ../../library/dis.rst:145 ../../library/dis.rst:170 -#: ../../library/dis.rst:189 ../../library/dis.rst:213 +#: ../../library/dis.rst:149 ../../library/dis.rst:174 +#: ../../library/dis.rst:193 ../../library/dis.rst:217 msgid "Added *file* parameter." msgstr "新增 *file* 參數。" -#: ../../library/dis.rst:151 +#: ../../library/dis.rst:155 msgid "" "Disassemble the *x* object. *x* can denote either a module, a class, a " "method, a function, a generator, an asynchronous generator, a coroutine, a " @@ -202,110 +209,110 @@ msgid "" "provided, this function disassembles the last traceback." msgstr "" -#: ../../library/dis.rst:164 ../../library/dis.rst:186 -#: ../../library/dis.rst:210 +#: ../../library/dis.rst:168 ../../library/dis.rst:190 +#: ../../library/dis.rst:214 msgid "" "The disassembly is written as text to the supplied *file* argument if " "provided and to ``sys.stdout`` otherwise." msgstr "" -#: ../../library/dis.rst:167 +#: ../../library/dis.rst:171 msgid "" "The maximal depth of recursion is limited by *depth* unless it is ``None``. " "``depth=0`` means no recursion." msgstr "" -#: ../../library/dis.rst:173 +#: ../../library/dis.rst:177 msgid "Implemented recursive disassembling and added *depth* parameter." msgstr "" -#: ../../library/dis.rst:182 +#: ../../library/dis.rst:186 msgid "" "Disassemble the top-of-stack function of a traceback, using the last " "traceback if none was passed. The instruction causing the exception is " "indicated." msgstr "" -#: ../../library/dis.rst:196 +#: ../../library/dis.rst:200 msgid "" "Disassemble a code object, indicating the last instruction if *lasti* was " "provided. The output is divided in the following columns:" msgstr "" -#: ../../library/dis.rst:199 +#: ../../library/dis.rst:203 msgid "the line number, for the first instruction of each line" msgstr "" -#: ../../library/dis.rst:200 +#: ../../library/dis.rst:204 msgid "the current instruction, indicated as ``-->``," msgstr "" -#: ../../library/dis.rst:201 +#: ../../library/dis.rst:205 msgid "a labelled instruction, indicated with ``>>``," msgstr "" -#: ../../library/dis.rst:202 +#: ../../library/dis.rst:206 msgid "the address of the instruction," msgstr "" -#: ../../library/dis.rst:203 +#: ../../library/dis.rst:207 msgid "the operation code name," msgstr "" -#: ../../library/dis.rst:204 +#: ../../library/dis.rst:208 msgid "operation parameters, and" msgstr "" -#: ../../library/dis.rst:205 +#: ../../library/dis.rst:209 msgid "interpretation of the parameters in parentheses." msgstr "" -#: ../../library/dis.rst:207 +#: ../../library/dis.rst:211 msgid "" "The parameter interpretation recognizes local and global variable names, " "constant values, branch targets, and compare operators." msgstr "" -#: ../../library/dis.rst:219 +#: ../../library/dis.rst:223 msgid "" "Return an iterator over the instructions in the supplied function, method, " "source code string or code object." msgstr "" -#: ../../library/dis.rst:222 +#: ../../library/dis.rst:226 msgid "" "The iterator generates a series of :class:`Instruction` named tuples giving " "the details of each operation in the supplied code." msgstr "" -#: ../../library/dis.rst:235 +#: ../../library/dis.rst:239 msgid "" "This generator function uses the ``co_lines`` method of the code object " "*code* to find the offsets which are starts of lines in the source code. " "They are generated as ``(offset, lineno)`` pairs." msgstr "" -#: ../../library/dis.rst:239 +#: ../../library/dis.rst:243 msgid "Line numbers can be decreasing. Before, they were always increasing." msgstr "" -#: ../../library/dis.rst:242 +#: ../../library/dis.rst:246 msgid "" "The :pep:`626` ``co_lines`` method is used instead of the ``co_firstlineno`` " "and ``co_lnotab`` attributes of the code object." msgstr "" -#: ../../library/dis.rst:249 +#: ../../library/dis.rst:253 msgid "" "Detect all offsets in the raw compiled bytecode string *code* which are jump " "targets, and return a list of these offsets." msgstr "" -#: ../../library/dis.rst:255 +#: ../../library/dis.rst:259 msgid "Compute the stack effect of *opcode* with argument *oparg*." msgstr "" -#: ../../library/dis.rst:257 +#: ../../library/dis.rst:261 msgid "" "If the code has a jump target and *jump* is ``True``, :func:`~stack_effect` " "will return the stack effect of jumping. If *jump* is ``False``, it will " @@ -313,209 +320,209 @@ msgid "" "it will return the maximal stack effect of both cases." msgstr "" -#: ../../library/dis.rst:264 +#: ../../library/dis.rst:268 msgid "Added *jump* parameter." msgstr "新增 *jump* 參數。" -#: ../../library/dis.rst:271 +#: ../../library/dis.rst:275 msgid "Python Bytecode Instructions" msgstr "" -#: ../../library/dis.rst:273 +#: ../../library/dis.rst:277 msgid "" "The :func:`get_instructions` function and :class:`Bytecode` class provide " "details of bytecode instructions as :class:`Instruction` instances:" msgstr "" -#: ../../library/dis.rst:278 +#: ../../library/dis.rst:282 msgid "Details for a bytecode operation" msgstr "" -#: ../../library/dis.rst:282 +#: ../../library/dis.rst:286 msgid "" "numeric code for operation, corresponding to the opcode values listed below " "and the bytecode values in the :ref:`opcode_collections`." msgstr "" -#: ../../library/dis.rst:288 +#: ../../library/dis.rst:292 msgid "human readable name for operation" msgstr "" -#: ../../library/dis.rst:293 +#: ../../library/dis.rst:297 msgid "numeric argument to operation (if any), otherwise ``None``" msgstr "" -#: ../../library/dis.rst:298 +#: ../../library/dis.rst:302 msgid "resolved arg value (if known), otherwise same as arg" msgstr "" -#: ../../library/dis.rst:303 +#: ../../library/dis.rst:307 msgid "human readable description of operation argument" msgstr "" -#: ../../library/dis.rst:308 +#: ../../library/dis.rst:312 msgid "start index of operation within bytecode sequence" msgstr "" -#: ../../library/dis.rst:313 +#: ../../library/dis.rst:317 msgid "line started by this opcode (if any), otherwise ``None``" msgstr "" -#: ../../library/dis.rst:318 +#: ../../library/dis.rst:322 msgid "``True`` if other code jumps to here, otherwise ``False``" msgstr "" -#: ../../library/dis.rst:323 +#: ../../library/dis.rst:327 msgid "" "The Python compiler currently generates the following bytecode instructions." msgstr "" -#: ../../library/dis.rst:326 +#: ../../library/dis.rst:330 msgid "**General instructions**" msgstr "" -#: ../../library/dis.rst:330 +#: ../../library/dis.rst:334 msgid "Do nothing code. Used as a placeholder by the bytecode optimizer." msgstr "" -#: ../../library/dis.rst:335 +#: ../../library/dis.rst:339 msgid "Removes the top-of-stack (TOS) item." msgstr "" -#: ../../library/dis.rst:340 +#: ../../library/dis.rst:344 msgid "Swaps the two top-most stack items." msgstr "" -#: ../../library/dis.rst:345 +#: ../../library/dis.rst:349 msgid "" "Lifts second and third stack item one position up, moves top down to " "position three." msgstr "" -#: ../../library/dis.rst:351 +#: ../../library/dis.rst:355 msgid "" "Lifts second, third and fourth stack items one position up, moves top down " "to position four." msgstr "" -#: ../../library/dis.rst:359 +#: ../../library/dis.rst:363 msgid "Duplicates the reference on top of the stack." msgstr "" -#: ../../library/dis.rst:366 +#: ../../library/dis.rst:370 msgid "" "Duplicates the two references on top of the stack, leaving them in the same " "order." msgstr "" -#: ../../library/dis.rst:372 +#: ../../library/dis.rst:376 msgid "**Unary operations**" msgstr "" -#: ../../library/dis.rst:374 +#: ../../library/dis.rst:378 msgid "" "Unary operations take the top of the stack, apply the operation, and push " "the result back on the stack." msgstr "" -#: ../../library/dis.rst:379 +#: ../../library/dis.rst:383 msgid "Implements ``TOS = +TOS``." msgstr "" -#: ../../library/dis.rst:384 +#: ../../library/dis.rst:388 msgid "Implements ``TOS = -TOS``." msgstr "" -#: ../../library/dis.rst:389 +#: ../../library/dis.rst:393 msgid "Implements ``TOS = not TOS``." msgstr "" -#: ../../library/dis.rst:394 +#: ../../library/dis.rst:398 msgid "Implements ``TOS = ~TOS``." msgstr "" -#: ../../library/dis.rst:399 +#: ../../library/dis.rst:403 msgid "Implements ``TOS = iter(TOS)``." msgstr "" -#: ../../library/dis.rst:404 +#: ../../library/dis.rst:408 msgid "" "If ``TOS`` is a :term:`generator iterator` or :term:`coroutine` object it is " "left as is. Otherwise, implements ``TOS = iter(TOS)``." msgstr "" -#: ../../library/dis.rst:410 +#: ../../library/dis.rst:414 msgid "**Binary operations**" msgstr "" -#: ../../library/dis.rst:412 +#: ../../library/dis.rst:416 msgid "" "Binary operations remove the top of the stack (TOS) and the second top-most " "stack item (TOS1) from the stack. They perform the operation, and put the " "result back on the stack." msgstr "" -#: ../../library/dis.rst:418 +#: ../../library/dis.rst:422 msgid "Implements ``TOS = TOS1 ** TOS``." msgstr "" -#: ../../library/dis.rst:423 +#: ../../library/dis.rst:427 msgid "Implements ``TOS = TOS1 * TOS``." msgstr "" -#: ../../library/dis.rst:428 +#: ../../library/dis.rst:432 msgid "Implements ``TOS = TOS1 @ TOS``." msgstr "" -#: ../../library/dis.rst:435 +#: ../../library/dis.rst:439 msgid "Implements ``TOS = TOS1 // TOS``." msgstr "" -#: ../../library/dis.rst:440 +#: ../../library/dis.rst:444 msgid "Implements ``TOS = TOS1 / TOS``." msgstr "" -#: ../../library/dis.rst:445 +#: ../../library/dis.rst:449 msgid "Implements ``TOS = TOS1 % TOS``." msgstr "" -#: ../../library/dis.rst:450 +#: ../../library/dis.rst:454 msgid "Implements ``TOS = TOS1 + TOS``." msgstr "" -#: ../../library/dis.rst:455 +#: ../../library/dis.rst:459 msgid "Implements ``TOS = TOS1 - TOS``." msgstr "" -#: ../../library/dis.rst:460 +#: ../../library/dis.rst:464 msgid "Implements ``TOS = TOS1[TOS]``." msgstr "" -#: ../../library/dis.rst:465 +#: ../../library/dis.rst:469 msgid "Implements ``TOS = TOS1 << TOS``." msgstr "" -#: ../../library/dis.rst:470 +#: ../../library/dis.rst:474 msgid "Implements ``TOS = TOS1 >> TOS``." msgstr "" -#: ../../library/dis.rst:475 +#: ../../library/dis.rst:479 msgid "Implements ``TOS = TOS1 & TOS``." msgstr "" -#: ../../library/dis.rst:480 +#: ../../library/dis.rst:484 msgid "Implements ``TOS = TOS1 ^ TOS``." msgstr "" -#: ../../library/dis.rst:485 +#: ../../library/dis.rst:489 msgid "Implements ``TOS = TOS1 | TOS``." msgstr "" -#: ../../library/dis.rst:488 +#: ../../library/dis.rst:492 msgid "**In-place operations**" msgstr "" -#: ../../library/dis.rst:490 +#: ../../library/dis.rst:494 msgid "" "In-place operations are like binary operations, in that they remove TOS and " "TOS1, and push the result back on the stack, but the operation is done in-" @@ -523,92 +530,92 @@ msgid "" "to be) the original TOS1." msgstr "" -#: ../../library/dis.rst:497 +#: ../../library/dis.rst:501 msgid "Implements in-place ``TOS = TOS1 ** TOS``." msgstr "" -#: ../../library/dis.rst:502 +#: ../../library/dis.rst:506 msgid "Implements in-place ``TOS = TOS1 * TOS``." msgstr "" -#: ../../library/dis.rst:507 +#: ../../library/dis.rst:511 msgid "Implements in-place ``TOS = TOS1 @ TOS``." msgstr "" -#: ../../library/dis.rst:514 +#: ../../library/dis.rst:518 msgid "Implements in-place ``TOS = TOS1 // TOS``." msgstr "" -#: ../../library/dis.rst:519 +#: ../../library/dis.rst:523 msgid "Implements in-place ``TOS = TOS1 / TOS``." msgstr "" -#: ../../library/dis.rst:524 +#: ../../library/dis.rst:528 msgid "Implements in-place ``TOS = TOS1 % TOS``." msgstr "" -#: ../../library/dis.rst:529 +#: ../../library/dis.rst:533 msgid "Implements in-place ``TOS = TOS1 + TOS``." msgstr "" -#: ../../library/dis.rst:534 +#: ../../library/dis.rst:538 msgid "Implements in-place ``TOS = TOS1 - TOS``." msgstr "" -#: ../../library/dis.rst:539 +#: ../../library/dis.rst:543 msgid "Implements in-place ``TOS = TOS1 << TOS``." msgstr "" -#: ../../library/dis.rst:544 +#: ../../library/dis.rst:548 msgid "Implements in-place ``TOS = TOS1 >> TOS``." msgstr "" -#: ../../library/dis.rst:549 +#: ../../library/dis.rst:553 msgid "Implements in-place ``TOS = TOS1 & TOS``." msgstr "" -#: ../../library/dis.rst:554 +#: ../../library/dis.rst:558 msgid "Implements in-place ``TOS = TOS1 ^ TOS``." msgstr "" -#: ../../library/dis.rst:559 +#: ../../library/dis.rst:563 msgid "Implements in-place ``TOS = TOS1 | TOS``." msgstr "" -#: ../../library/dis.rst:564 +#: ../../library/dis.rst:568 msgid "Implements ``TOS1[TOS] = TOS2``." msgstr "" -#: ../../library/dis.rst:569 +#: ../../library/dis.rst:573 msgid "Implements ``del TOS1[TOS]``." msgstr "" -#: ../../library/dis.rst:572 +#: ../../library/dis.rst:576 msgid "**Coroutine opcodes**" msgstr "" -#: ../../library/dis.rst:576 +#: ../../library/dis.rst:580 msgid "" "Implements ``TOS = get_awaitable(TOS)``, where ``get_awaitable(o)`` returns " "``o`` if ``o`` is a coroutine object or a generator object with the " "CO_ITERABLE_COROUTINE flag, or resolves ``o.__await__``." msgstr "" -#: ../../library/dis.rst:586 +#: ../../library/dis.rst:590 msgid "Implements ``TOS = TOS.__aiter__()``." msgstr "" -#: ../../library/dis.rst:589 +#: ../../library/dis.rst:593 msgid "Returning awaitable objects from ``__aiter__`` is no longer supported." msgstr "" -#: ../../library/dis.rst:596 +#: ../../library/dis.rst:600 msgid "" "Pushes ``get_awaitable(TOS.__anext__())`` to the stack. See " "``GET_AWAITABLE`` for details about ``get_awaitable``." msgstr "" -#: ../../library/dis.rst:604 +#: ../../library/dis.rst:608 msgid "" "Terminates an :keyword:`async for` loop. Handles an exception raised when " "awaiting a next item. If TOS is :exc:`StopAsyncIteration` pop 7 values from " @@ -617,48 +624,48 @@ msgid "" "exception handler block is removed from the block stack." msgstr "" -#: ../../library/dis.rst:615 +#: ../../library/dis.rst:619 msgid "" "Resolves ``__aenter__`` and ``__aexit__`` from the object on top of the " "stack. Pushes ``__aexit__`` and result of ``__aenter__()`` to the stack." msgstr "" -#: ../../library/dis.rst:623 +#: ../../library/dis.rst:627 msgid "Creates a new frame object." msgstr "" -#: ../../library/dis.rst:629 +#: ../../library/dis.rst:633 msgid "**Miscellaneous opcodes**" msgstr "" -#: ../../library/dis.rst:633 +#: ../../library/dis.rst:637 msgid "" "Implements the expression statement for the interactive mode. TOS is " "removed from the stack and printed. In non-interactive mode, an expression " "statement is terminated with :opcode:`POP_TOP`." msgstr "" -#: ../../library/dis.rst:640 +#: ../../library/dis.rst:644 msgid "" "Calls ``set.add(TOS1[-i], TOS)``. Used to implement set comprehensions." msgstr "" -#: ../../library/dis.rst:645 +#: ../../library/dis.rst:649 msgid "" "Calls ``list.append(TOS1[-i], TOS)``. Used to implement list comprehensions." msgstr "" -#: ../../library/dis.rst:650 +#: ../../library/dis.rst:654 msgid "" "Calls ``dict.__setitem__(TOS1[-i], TOS1, TOS)``. Used to implement dict " "comprehensions." msgstr "" -#: ../../library/dis.rst:654 +#: ../../library/dis.rst:658 msgid "Map value is TOS and map key is TOS1. Before, those were reversed." msgstr "" -#: ../../library/dis.rst:657 +#: ../../library/dis.rst:661 msgid "" "For all of the :opcode:`SET_ADD`, :opcode:`LIST_APPEND` and :opcode:" "`MAP_ADD` instructions, while the added value or key/value pair is popped " @@ -666,19 +673,19 @@ msgid "" "further iterations of the loop." msgstr "" -#: ../../library/dis.rst:665 +#: ../../library/dis.rst:669 msgid "Returns with TOS to the caller of the function." msgstr "" -#: ../../library/dis.rst:670 +#: ../../library/dis.rst:674 msgid "Pops TOS and yields it from a :term:`generator`." msgstr "" -#: ../../library/dis.rst:675 +#: ../../library/dis.rst:679 msgid "Pops TOS and delegates to it as a subiterator from a :term:`generator`." msgstr "" -#: ../../library/dis.rst:682 +#: ../../library/dis.rst:686 msgid "" "Checks whether ``__annotations__`` is defined in ``locals()``, if not it is " "set up to an empty ``dict``. This opcode is only emitted if a class or " @@ -686,20 +693,20 @@ msgid "" "statically." msgstr "" -#: ../../library/dis.rst:692 +#: ../../library/dis.rst:696 msgid "" "Loads all symbols not starting with ``'_'`` directly from the module TOS to " "the local namespace. The module is popped after loading all names. This " "opcode implements ``from module import *``." msgstr "" -#: ../../library/dis.rst:699 +#: ../../library/dis.rst:703 msgid "" "Removes one block from the block stack. Per frame, there is a stack of " "blocks, denoting :keyword:`try` statements, and such." msgstr "" -#: ../../library/dis.rst:705 +#: ../../library/dis.rst:709 msgid "" "Removes one block from the block stack. The popped block must be an " "exception handler block, as implicitly created when entering an except " @@ -707,14 +714,14 @@ msgid "" "last three popped values are used to restore the exception state." msgstr "" -#: ../../library/dis.rst:713 +#: ../../library/dis.rst:717 msgid "" "Re-raises the exception currently on top of the stack. If oparg is non-zero, " "restores ``f_lasti`` of the current frame to its value when the exception " "was raised." msgstr "" -#: ../../library/dis.rst:721 +#: ../../library/dis.rst:725 msgid "" "Calls the function in position 7 on the stack with the top three items on " "the stack as arguments. Used to implement the call ``context_manager." @@ -722,19 +729,19 @@ msgid "" "statement." msgstr "" -#: ../../library/dis.rst:731 +#: ../../library/dis.rst:735 msgid "" "Pushes :exc:`AssertionError` onto the stack. Used by the :keyword:`assert` " "statement." msgstr "" -#: ../../library/dis.rst:739 +#: ../../library/dis.rst:743 msgid "" "Pushes :func:`builtins.__build_class__` onto the stack. It is later called " "by :opcode:`CALL_FUNCTION` to construct a class." msgstr "" -#: ../../library/dis.rst:745 +#: ../../library/dis.rst:749 msgid "" "This opcode performs several operations before a with block starts. First, " "it loads :meth:`~object.__exit__` from the context manager and pushes it " @@ -746,18 +753,18 @@ msgid "" "or :opcode:`UNPACK_SEQUENCE`)." msgstr "" -#: ../../library/dis.rst:759 +#: ../../library/dis.rst:763 msgid "" "TOS is a tuple of mapping keys, and TOS1 is the match subject. Replace TOS " "with a :class:`dict` formed from the items of TOS1, but without any of the " "keys in TOS." msgstr "" -#: ../../library/dis.rst:768 +#: ../../library/dis.rst:772 msgid "Push ``len(TOS)`` onto the stack." msgstr "" -#: ../../library/dis.rst:775 +#: ../../library/dis.rst:779 msgid "" "If TOS is an instance of :class:`collections.abc.Mapping` (or, more " "technically: if it has the :const:`Py_TPFLAGS_MAPPING` flag set in its :c:" @@ -765,7 +772,7 @@ msgid "" "push ``False``." msgstr "" -#: ../../library/dis.rst:785 +#: ../../library/dis.rst:789 msgid "" "If TOS is an instance of :class:`collections.abc.Sequence` and is *not* an " "instance of :class:`str`/:class:`bytes`/:class:`bytearray` (or, more " @@ -774,7 +781,7 @@ msgid "" "push ``False``." msgstr "" -#: ../../library/dis.rst:795 +#: ../../library/dis.rst:799 msgid "" "TOS is a tuple of mapping keys, and TOS1 is the match subject. If TOS1 " "contains all of the keys in TOS, push a :class:`tuple` containing the " @@ -782,30 +789,30 @@ msgid "" "followed by ``False``." msgstr "" -#: ../../library/dis.rst:803 +#: ../../library/dis.rst:807 msgid "All of the following opcodes use their arguments." msgstr "" -#: ../../library/dis.rst:807 +#: ../../library/dis.rst:811 msgid "" "Implements ``name = TOS``. *namei* is the index of *name* in the attribute :" "attr:`co_names` of the code object. The compiler tries to use :opcode:" "`STORE_FAST` or :opcode:`STORE_GLOBAL` if possible." msgstr "" -#: ../../library/dis.rst:814 +#: ../../library/dis.rst:818 msgid "" "Implements ``del name``, where *namei* is the index into :attr:`co_names` " "attribute of the code object." msgstr "" -#: ../../library/dis.rst:820 +#: ../../library/dis.rst:824 msgid "" "Unpacks TOS into *count* individual values, which are put onto the stack " "right-to-left." msgstr "" -#: ../../library/dis.rst:826 +#: ../../library/dis.rst:830 msgid "" "Implements assignment with a starred target: Unpacks an iterable in TOS into " "individual values, where the total number of values can be smaller than the " @@ -813,119 +820,119 @@ msgid "" "leftover items." msgstr "" -#: ../../library/dis.rst:831 +#: ../../library/dis.rst:835 msgid "" "The low byte of *counts* is the number of values before the list value, the " "high byte of *counts* the number of values after it. The resulting values " "are put onto the stack right-to-left." msgstr "" -#: ../../library/dis.rst:838 +#: ../../library/dis.rst:842 msgid "" "Implements ``TOS.name = TOS1``, where *namei* is the index of name in :attr:" "`co_names`." msgstr "" -#: ../../library/dis.rst:844 +#: ../../library/dis.rst:848 msgid "" "Implements ``del TOS.name``, using *namei* as index into :attr:`co_names`." msgstr "" -#: ../../library/dis.rst:849 +#: ../../library/dis.rst:853 msgid "Works as :opcode:`STORE_NAME`, but stores the name as a global." msgstr "" -#: ../../library/dis.rst:854 +#: ../../library/dis.rst:858 msgid "Works as :opcode:`DELETE_NAME`, but deletes a global name." msgstr "" -#: ../../library/dis.rst:859 +#: ../../library/dis.rst:863 msgid "Pushes ``co_consts[consti]`` onto the stack." msgstr "" -#: ../../library/dis.rst:864 +#: ../../library/dis.rst:868 msgid "Pushes the value associated with ``co_names[namei]`` onto the stack." msgstr "" -#: ../../library/dis.rst:869 +#: ../../library/dis.rst:873 msgid "" "Creates a tuple consuming *count* items from the stack, and pushes the " "resulting tuple onto the stack." msgstr "" -#: ../../library/dis.rst:875 +#: ../../library/dis.rst:879 msgid "Works as :opcode:`BUILD_TUPLE`, but creates a list." msgstr "" -#: ../../library/dis.rst:880 +#: ../../library/dis.rst:884 msgid "Works as :opcode:`BUILD_TUPLE`, but creates a set." msgstr "" -#: ../../library/dis.rst:885 +#: ../../library/dis.rst:889 msgid "" "Pushes a new dictionary object onto the stack. Pops ``2 * count`` items so " "that the dictionary holds *count* entries: ``{..., TOS3: TOS2, TOS1: TOS}``." msgstr "" -#: ../../library/dis.rst:889 +#: ../../library/dis.rst:893 msgid "" "The dictionary is created from stack items instead of creating an empty " "dictionary pre-sized to hold *count* items." msgstr "" -#: ../../library/dis.rst:896 +#: ../../library/dis.rst:900 msgid "" "The version of :opcode:`BUILD_MAP` specialized for constant keys. Pops the " "top element on the stack which contains a tuple of keys, then starting from " "``TOS1``, pops *count* values to form values in the built dictionary." msgstr "" -#: ../../library/dis.rst:905 +#: ../../library/dis.rst:909 msgid "" "Concatenates *count* strings from the stack and pushes the resulting string " "onto the stack." msgstr "" -#: ../../library/dis.rst:913 +#: ../../library/dis.rst:917 msgid "" "Pops a list from the stack and pushes a tuple containing the same values." msgstr "" -#: ../../library/dis.rst:920 +#: ../../library/dis.rst:924 msgid "Calls ``list.extend(TOS1[-i], TOS)``. Used to build lists." msgstr "" -#: ../../library/dis.rst:927 +#: ../../library/dis.rst:931 msgid "Calls ``set.update(TOS1[-i], TOS)``. Used to build sets." msgstr "" -#: ../../library/dis.rst:934 +#: ../../library/dis.rst:938 msgid "Calls ``dict.update(TOS1[-i], TOS)``. Used to build dicts." msgstr "" -#: ../../library/dis.rst:941 +#: ../../library/dis.rst:945 msgid "Like :opcode:`DICT_UPDATE` but raises an exception for duplicate keys." msgstr "" -#: ../../library/dis.rst:948 +#: ../../library/dis.rst:952 msgid "Replaces TOS with ``getattr(TOS, co_names[namei])``." msgstr "" -#: ../../library/dis.rst:953 +#: ../../library/dis.rst:957 msgid "" "Performs a Boolean operation. The operation name can be found in " "``cmp_op[opname]``." msgstr "" -#: ../../library/dis.rst:959 +#: ../../library/dis.rst:963 msgid "Performs ``is`` comparison, or ``is not`` if ``invert`` is 1." msgstr "" -#: ../../library/dis.rst:966 +#: ../../library/dis.rst:970 msgid "Performs ``in`` comparison, or ``not in`` if ``invert`` is 1." msgstr "" -#: ../../library/dis.rst:973 +#: ../../library/dis.rst:977 msgid "" "Imports the module ``co_names[namei]``. TOS and TOS1 are popped and provide " "the *fromlist* and *level* arguments of :func:`__import__`. The module " @@ -934,48 +941,48 @@ msgid "" "modifies the namespace." msgstr "" -#: ../../library/dis.rst:982 +#: ../../library/dis.rst:986 msgid "" "Loads the attribute ``co_names[namei]`` from the module found in TOS. The " "resulting object is pushed onto the stack, to be subsequently stored by a :" "opcode:`STORE_FAST` instruction." msgstr "" -#: ../../library/dis.rst:989 +#: ../../library/dis.rst:993 msgid "Increments bytecode counter by *delta*." msgstr "" -#: ../../library/dis.rst:994 +#: ../../library/dis.rst:998 msgid "If TOS is true, sets the bytecode counter to *target*. TOS is popped." msgstr "" -#: ../../library/dis.rst:1001 +#: ../../library/dis.rst:1005 msgid "If TOS is false, sets the bytecode counter to *target*. TOS is popped." msgstr "" -#: ../../library/dis.rst:1007 +#: ../../library/dis.rst:1011 msgid "" "Tests whether the second value on the stack is an exception matching TOS, " "and jumps if it is not. Pops two values from the stack." msgstr "" -#: ../../library/dis.rst:1015 +#: ../../library/dis.rst:1019 msgid "" "If TOS is true, sets the bytecode counter to *target* and leaves TOS on the " "stack. Otherwise (TOS is false), TOS is popped." msgstr "" -#: ../../library/dis.rst:1023 +#: ../../library/dis.rst:1027 msgid "" "If TOS is false, sets the bytecode counter to *target* and leaves TOS on the " "stack. Otherwise (TOS is true), TOS is popped." msgstr "" -#: ../../library/dis.rst:1031 +#: ../../library/dis.rst:1035 msgid "Set bytecode counter to *target*." msgstr "" -#: ../../library/dis.rst:1036 +#: ../../library/dis.rst:1040 msgid "" "TOS is an :term:`iterator`. Call its :meth:`~iterator.__next__` method. If " "this yields a new value, push it on the stack (leaving the iterator below " @@ -983,30 +990,30 @@ msgid "" "code counter is incremented by *delta*." msgstr "" -#: ../../library/dis.rst:1044 +#: ../../library/dis.rst:1048 msgid "Loads the global named ``co_names[namei]`` onto the stack." msgstr "" -#: ../../library/dis.rst:1049 +#: ../../library/dis.rst:1053 msgid "" "Pushes a try block from a try-finally or try-except clause onto the block " "stack. *delta* points to the finally block or the first except block." msgstr "" -#: ../../library/dis.rst:1055 +#: ../../library/dis.rst:1059 msgid "" "Pushes a reference to the local ``co_varnames[var_num]`` onto the stack." msgstr "" -#: ../../library/dis.rst:1060 +#: ../../library/dis.rst:1064 msgid "Stores TOS into the local ``co_varnames[var_num]``." msgstr "" -#: ../../library/dis.rst:1065 +#: ../../library/dis.rst:1069 msgid "Deletes local ``co_varnames[var_num]``." msgstr "" -#: ../../library/dis.rst:1070 +#: ../../library/dis.rst:1074 msgid "" "Pushes a reference to the cell contained in slot *i* of the cell and free " "variable storage. The name of the variable is ``co_cellvars[i]`` if *i* is " @@ -1014,52 +1021,52 @@ msgid "" "len(co_cellvars)]``." msgstr "" -#: ../../library/dis.rst:1078 +#: ../../library/dis.rst:1082 msgid "" "Loads the cell contained in slot *i* of the cell and free variable storage. " "Pushes a reference to the object the cell contains on the stack." msgstr "" -#: ../../library/dis.rst:1084 +#: ../../library/dis.rst:1088 msgid "" "Much like :opcode:`LOAD_DEREF` but first checks the locals dictionary before " "consulting the cell. This is used for loading free variables in class " "bodies." msgstr "" -#: ../../library/dis.rst:1093 +#: ../../library/dis.rst:1097 msgid "" "Stores TOS into the cell contained in slot *i* of the cell and free variable " "storage." msgstr "" -#: ../../library/dis.rst:1099 +#: ../../library/dis.rst:1103 msgid "" "Empties the cell contained in slot *i* of the cell and free variable " "storage. Used by the :keyword:`del` statement." msgstr "" -#: ../../library/dis.rst:1107 +#: ../../library/dis.rst:1111 msgid "" "Raises an exception using one of the 3 forms of the ``raise`` statement, " "depending on the value of *argc*:" msgstr "" -#: ../../library/dis.rst:1110 +#: ../../library/dis.rst:1114 msgid "0: ``raise`` (re-raise previous exception)" msgstr "" -#: ../../library/dis.rst:1111 +#: ../../library/dis.rst:1115 msgid "1: ``raise TOS`` (raise exception instance or type at ``TOS``)" msgstr "" -#: ../../library/dis.rst:1112 +#: ../../library/dis.rst:1116 msgid "" "2: ``raise TOS1 from TOS`` (raise exception instance or type at ``TOS1`` " "with ``__cause__`` set to ``TOS``)" msgstr "" -#: ../../library/dis.rst:1118 +#: ../../library/dis.rst:1122 msgid "" "Calls a callable object with positional arguments. *argc* indicates the " "number of positional arguments. The top of the stack contains positional " @@ -1069,11 +1076,11 @@ msgid "" "arguments, and pushes the return value returned by the callable object." msgstr "" -#: ../../library/dis.rst:1126 +#: ../../library/dis.rst:1130 msgid "This opcode is used only for calls with positional arguments." msgstr "" -#: ../../library/dis.rst:1132 +#: ../../library/dis.rst:1136 msgid "" "Calls a callable object with positional (if any) and keyword arguments. " "*argc* indicates the total number of positional and keyword arguments. The " @@ -1087,13 +1094,13 @@ msgid "" "object." msgstr "" -#: ../../library/dis.rst:1144 +#: ../../library/dis.rst:1148 msgid "" "Keyword arguments are packed in a tuple instead of a dictionary, *argc* " "indicates the total number of arguments." msgstr "" -#: ../../library/dis.rst:1151 +#: ../../library/dis.rst:1155 msgid "" "Calls a callable object with variable set of positional and keyword " "arguments. If the lowest bit of *flags* is set, the top of the stack " @@ -1105,7 +1112,7 @@ msgid "" "arguments, and pushes the return value returned by the callable object." msgstr "" -#: ../../library/dis.rst:1166 +#: ../../library/dis.rst:1170 msgid "" "Loads a method named ``co_names[namei]`` from the TOS object. TOS is popped. " "This bytecode distinguishes two cases: if TOS has a method with the correct " @@ -1115,7 +1122,7 @@ msgid "" "lookup are pushed." msgstr "" -#: ../../library/dis.rst:1178 +#: ../../library/dis.rst:1182 msgid "" "Calls a method. *argc* is the number of positional arguments. Keyword " "arguments are not supported. This opcode is designed to be used with :" @@ -1125,50 +1132,50 @@ msgid "" "callable). All of them are popped and the return value is pushed." msgstr "" -#: ../../library/dis.rst:1190 +#: ../../library/dis.rst:1194 msgid "" "Pushes a new function object on the stack. From bottom to top, the consumed " "stack must consist of values if the argument carries a specified flag value" msgstr "" -#: ../../library/dis.rst:1193 +#: ../../library/dis.rst:1197 msgid "" "``0x01`` a tuple of default values for positional-only and positional-or-" "keyword parameters in positional order" msgstr "" -#: ../../library/dis.rst:1195 +#: ../../library/dis.rst:1199 msgid "``0x02`` a dictionary of keyword-only parameters' default values" msgstr "" -#: ../../library/dis.rst:1196 +#: ../../library/dis.rst:1200 msgid "``0x04`` a tuple of strings containing parameters' annotations" msgstr "" -#: ../../library/dis.rst:1197 +#: ../../library/dis.rst:1201 msgid "``0x08`` a tuple containing cells for free variables, making a closure" msgstr "" -#: ../../library/dis.rst:1198 +#: ../../library/dis.rst:1202 msgid "the code associated with the function (at TOS1)" msgstr "" -#: ../../library/dis.rst:1199 +#: ../../library/dis.rst:1203 msgid "the :term:`qualified name` of the function (at TOS)" msgstr "" -#: ../../library/dis.rst:1201 +#: ../../library/dis.rst:1205 msgid "Flag value ``0x04`` is a tuple of strings instead of dictionary" msgstr "" -#: ../../library/dis.rst:1208 +#: ../../library/dis.rst:1212 msgid "" "Pushes a slice object on the stack. *argc* must be 2 or 3. If it is 2, " "``slice(TOS1, TOS)`` is pushed; if it is 3, ``slice(TOS2, TOS1, TOS)`` is " "pushed. See the :func:`slice` built-in function for more information." msgstr "" -#: ../../library/dis.rst:1215 +#: ../../library/dis.rst:1219 msgid "" "Prefixes any opcode which has an argument too big to fit into the default " "one byte. *ext* holds an additional byte which act as higher bits in the " @@ -1176,113 +1183,113 @@ msgid "" "allowed, forming an argument from two-byte to four-byte." msgstr "" -#: ../../library/dis.rst:1223 +#: ../../library/dis.rst:1227 msgid "" "Used for implementing formatted literal strings (f-strings). Pops an " "optional *fmt_spec* from the stack, then a required *value*. *flags* is " "interpreted as follows:" msgstr "" -#: ../../library/dis.rst:1227 +#: ../../library/dis.rst:1231 msgid "``(flags & 0x03) == 0x00``: *value* is formatted as-is." msgstr "" -#: ../../library/dis.rst:1228 +#: ../../library/dis.rst:1232 msgid "" "``(flags & 0x03) == 0x01``: call :func:`str` on *value* before formatting it." msgstr "" -#: ../../library/dis.rst:1230 +#: ../../library/dis.rst:1234 msgid "" "``(flags & 0x03) == 0x02``: call :func:`repr` on *value* before formatting " "it." msgstr "" -#: ../../library/dis.rst:1232 +#: ../../library/dis.rst:1236 msgid "" "``(flags & 0x03) == 0x03``: call :func:`ascii` on *value* before formatting " "it." msgstr "" -#: ../../library/dis.rst:1234 +#: ../../library/dis.rst:1238 msgid "" "``(flags & 0x04) == 0x04``: pop *fmt_spec* from the stack and use it, else " "use an empty *fmt_spec*." msgstr "" -#: ../../library/dis.rst:1237 +#: ../../library/dis.rst:1241 msgid "" "Formatting is performed using :c:func:`PyObject_Format`. The result is " "pushed on the stack." msgstr "" -#: ../../library/dis.rst:1245 +#: ../../library/dis.rst:1249 msgid "" "TOS is a tuple of keyword attribute names, TOS1 is the class being matched " "against, and TOS2 is the match subject. *count* is the number of positional " "sub-patterns." msgstr "" -#: ../../library/dis.rst:1249 +#: ../../library/dis.rst:1253 msgid "" "Pop TOS. If TOS2 is an instance of TOS1 and has the positional and keyword " "attributes required by *count* and TOS, set TOS to ``True`` and TOS1 to a " "tuple of extracted attributes. Otherwise, set TOS to ``False``." msgstr "" -#: ../../library/dis.rst:1257 +#: ../../library/dis.rst:1261 msgid "" "Pops TOS. The ``kind`` operand corresponds to the type of generator or " "coroutine. The legal kinds are 0 for generator, 1 for coroutine, and 2 for " "async generator." msgstr "" -#: ../../library/dis.rst:1266 +#: ../../library/dis.rst:1270 msgid "" "Lift the top *count* stack items one position up, and move TOS down to " "position *count*." msgstr "" -#: ../../library/dis.rst:1274 +#: ../../library/dis.rst:1278 msgid "" "This is not really an opcode. It identifies the dividing line between " "opcodes which don't use their argument and those that do (``< " "HAVE_ARGUMENT`` and ``>= HAVE_ARGUMENT``, respectively)." msgstr "" -#: ../../library/dis.rst:1278 +#: ../../library/dis.rst:1282 msgid "" "Now every instruction has an argument, but opcodes ``< HAVE_ARGUMENT`` " "ignore it. Before, only opcodes ``>= HAVE_ARGUMENT`` had an argument." msgstr "" -#: ../../library/dis.rst:1286 +#: ../../library/dis.rst:1290 msgid "Opcode collections" msgstr "" -#: ../../library/dis.rst:1288 +#: ../../library/dis.rst:1292 msgid "" "These collections are provided for automatic introspection of bytecode " "instructions:" msgstr "" -#: ../../library/dis.rst:1293 +#: ../../library/dis.rst:1297 msgid "Sequence of operation names, indexable using the bytecode." msgstr "" -#: ../../library/dis.rst:1298 +#: ../../library/dis.rst:1302 msgid "Dictionary mapping operation names to bytecodes." msgstr "" -#: ../../library/dis.rst:1303 +#: ../../library/dis.rst:1307 msgid "Sequence of all compare operation names." msgstr "" -#: ../../library/dis.rst:1308 +#: ../../library/dis.rst:1312 msgid "Sequence of bytecodes that access a constant." msgstr "" -#: ../../library/dis.rst:1313 +#: ../../library/dis.rst:1317 msgid "" "Sequence of bytecodes that access a free variable (note that 'free' in this " "context refers to names in the current scope that are referenced by inner " @@ -1290,22 +1297,22 @@ msgid "" "does *not* include references to global or builtin scopes)." msgstr "" -#: ../../library/dis.rst:1321 +#: ../../library/dis.rst:1325 msgid "Sequence of bytecodes that access an attribute by name." msgstr "" -#: ../../library/dis.rst:1326 +#: ../../library/dis.rst:1330 msgid "Sequence of bytecodes that have a relative jump target." msgstr "" -#: ../../library/dis.rst:1331 +#: ../../library/dis.rst:1335 msgid "Sequence of bytecodes that have an absolute jump target." msgstr "" -#: ../../library/dis.rst:1336 +#: ../../library/dis.rst:1340 msgid "Sequence of bytecodes that access a local variable." msgstr "" -#: ../../library/dis.rst:1341 +#: ../../library/dis.rst:1345 msgid "Sequence of bytecodes of Boolean operations." msgstr "" diff --git a/library/functions.po b/library/functions.po index 584a43da16..976e1a8c3d 100644 --- a/library/functions.po +++ b/library/functions.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-03 00:22+0000\n" +"POT-Creation-Date: 2022-10-08 00:21+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-" @@ -2118,9 +2118,9 @@ msgstr "" #: ../../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:" +"*newline* determines how to parse newline characters from the stream. It can " +"be ``None``, ``''``, ``'\\n'``, ``'\\r'``, and ``'\\r\\n'``. It works as " +"follows:" msgstr "" #: ../../library/functions.rst:1251 diff --git a/library/urllib.parse.po b/library/urllib.parse.po index f59971843c..d2782010c3 100644 --- a/library/urllib.parse.po +++ b/library/urllib.parse.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-12-03 00:09+0000\n" +"POT-Creation-Date: 2022-10-08 00:21+0000\n" "PO-Revision-Date: 2018-05-23 16:14+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -101,73 +101,74 @@ msgid "" "accessed by index or as named attributes, which are:" msgstr "" -#: ../../library/urllib.parse.rst:108 ../../library/urllib.parse.rst:292 -#: ../../library/urllib.parse.rst:396 +#: ../../library/urllib.parse.rst:108 ../../library/urllib.parse.rst:293 +#: ../../library/urllib.parse.rst:397 msgid "Attribute" msgstr "屬性" -#: ../../library/urllib.parse.rst:108 ../../library/urllib.parse.rst:292 -#: ../../library/urllib.parse.rst:396 +#: ../../library/urllib.parse.rst:108 ../../library/urllib.parse.rst:293 +#: ../../library/urllib.parse.rst:397 msgid "Index" msgstr "" -#: ../../library/urllib.parse.rst:108 ../../library/urllib.parse.rst:292 -#: ../../library/urllib.parse.rst:396 +#: ../../library/urllib.parse.rst:108 ../../library/urllib.parse.rst:293 +#: ../../library/urllib.parse.rst:397 msgid "Value" msgstr "" -#: ../../library/urllib.parse.rst:108 ../../library/urllib.parse.rst:292 -#: ../../library/urllib.parse.rst:396 +#: ../../library/urllib.parse.rst:108 ../../library/urllib.parse.rst:293 +#: ../../library/urllib.parse.rst:397 msgid "Value if not present" msgstr "" -#: ../../library/urllib.parse.rst:110 ../../library/urllib.parse.rst:294 +#: ../../library/urllib.parse.rst:110 ../../library/urllib.parse.rst:295 msgid ":attr:`scheme`" msgstr ":attr:`scheme`" -#: ../../library/urllib.parse.rst:110 ../../library/urllib.parse.rst:294 -#: ../../library/urllib.parse.rst:398 +#: ../../library/urllib.parse.rst:110 ../../library/urllib.parse.rst:295 +#: ../../library/urllib.parse.rst:399 msgid "0" msgstr "0" -#: ../../library/urllib.parse.rst:110 ../../library/urllib.parse.rst:294 +#: ../../library/urllib.parse.rst:110 ../../library/urllib.parse.rst:295 msgid "URL scheme specifier" msgstr "" -#: ../../library/urllib.parse.rst:110 ../../library/urllib.parse.rst:294 +#: ../../library/urllib.parse.rst:110 ../../library/urllib.parse.rst:295 msgid "*scheme* parameter" msgstr "" -#: ../../library/urllib.parse.rst:112 ../../library/urllib.parse.rst:296 +#: ../../library/urllib.parse.rst:112 ../../library/urllib.parse.rst:297 msgid ":attr:`netloc`" msgstr ":attr:`netloc`" -#: ../../library/urllib.parse.rst:112 ../../library/urllib.parse.rst:296 -#: ../../library/urllib.parse.rst:400 +#: ../../library/urllib.parse.rst:112 ../../library/urllib.parse.rst:297 +#: ../../library/urllib.parse.rst:401 msgid "1" msgstr "1" -#: ../../library/urllib.parse.rst:112 ../../library/urllib.parse.rst:296 +#: ../../library/urllib.parse.rst:112 ../../library/urllib.parse.rst:297 msgid "Network location part" msgstr "" #: ../../library/urllib.parse.rst:112 ../../library/urllib.parse.rst:114 -#: ../../library/urllib.parse.rst:118 ../../library/urllib.parse.rst:120 -#: ../../library/urllib.parse.rst:296 ../../library/urllib.parse.rst:298 -#: ../../library/urllib.parse.rst:300 ../../library/urllib.parse.rst:302 -#: ../../library/urllib.parse.rst:398 ../../library/urllib.parse.rst:400 +#: ../../library/urllib.parse.rst:116 ../../library/urllib.parse.rst:119 +#: ../../library/urllib.parse.rst:121 ../../library/urllib.parse.rst:297 +#: ../../library/urllib.parse.rst:299 ../../library/urllib.parse.rst:301 +#: ../../library/urllib.parse.rst:303 ../../library/urllib.parse.rst:399 +#: ../../library/urllib.parse.rst:401 msgid "empty string" msgstr "" -#: ../../library/urllib.parse.rst:114 ../../library/urllib.parse.rst:298 +#: ../../library/urllib.parse.rst:114 ../../library/urllib.parse.rst:299 msgid ":attr:`path`" msgstr ":attr:`path`" -#: ../../library/urllib.parse.rst:114 ../../library/urllib.parse.rst:298 +#: ../../library/urllib.parse.rst:114 ../../library/urllib.parse.rst:299 msgid "2" msgstr "2" -#: ../../library/urllib.parse.rst:114 ../../library/urllib.parse.rst:298 +#: ../../library/urllib.parse.rst:114 ../../library/urllib.parse.rst:299 msgid "Hierarchical path" msgstr "" @@ -175,97 +176,93 @@ msgstr "" msgid ":attr:`params`" msgstr ":attr:`params`" -#: ../../library/urllib.parse.rst:116 ../../library/urllib.parse.rst:300 +#: ../../library/urllib.parse.rst:116 ../../library/urllib.parse.rst:301 msgid "3" msgstr "3" #: ../../library/urllib.parse.rst:116 -msgid "No longer used" +msgid "Parameters for last path element" msgstr "" -#: ../../library/urllib.parse.rst:116 -msgid "always an empty string" -msgstr "" - -#: ../../library/urllib.parse.rst:118 ../../library/urllib.parse.rst:300 +#: ../../library/urllib.parse.rst:119 ../../library/urllib.parse.rst:301 msgid ":attr:`query`" msgstr ":attr:`query`" -#: ../../library/urllib.parse.rst:118 ../../library/urllib.parse.rst:302 +#: ../../library/urllib.parse.rst:119 ../../library/urllib.parse.rst:303 msgid "4" msgstr "4" -#: ../../library/urllib.parse.rst:118 ../../library/urllib.parse.rst:300 +#: ../../library/urllib.parse.rst:119 ../../library/urllib.parse.rst:301 msgid "Query component" msgstr "" -#: ../../library/urllib.parse.rst:120 ../../library/urllib.parse.rst:302 -#: ../../library/urllib.parse.rst:400 +#: ../../library/urllib.parse.rst:121 ../../library/urllib.parse.rst:303 +#: ../../library/urllib.parse.rst:401 msgid ":attr:`fragment`" msgstr ":attr:`fragment`" -#: ../../library/urllib.parse.rst:120 +#: ../../library/urllib.parse.rst:121 msgid "5" msgstr "5" -#: ../../library/urllib.parse.rst:120 ../../library/urllib.parse.rst:302 -#: ../../library/urllib.parse.rst:400 +#: ../../library/urllib.parse.rst:121 ../../library/urllib.parse.rst:303 +#: ../../library/urllib.parse.rst:401 msgid "Fragment identifier" msgstr "" -#: ../../library/urllib.parse.rst:122 ../../library/urllib.parse.rst:304 +#: ../../library/urllib.parse.rst:123 ../../library/urllib.parse.rst:305 msgid ":attr:`username`" msgstr ":attr:`username`" -#: ../../library/urllib.parse.rst:122 ../../library/urllib.parse.rst:304 +#: ../../library/urllib.parse.rst:123 ../../library/urllib.parse.rst:305 msgid "User name" msgstr "" -#: ../../library/urllib.parse.rst:122 ../../library/urllib.parse.rst:124 -#: ../../library/urllib.parse.rst:126 ../../library/urllib.parse.rst:128 -#: ../../library/urllib.parse.rst:304 ../../library/urllib.parse.rst:306 -#: ../../library/urllib.parse.rst:308 ../../library/urllib.parse.rst:310 +#: ../../library/urllib.parse.rst:123 ../../library/urllib.parse.rst:125 +#: ../../library/urllib.parse.rst:127 ../../library/urllib.parse.rst:129 +#: ../../library/urllib.parse.rst:305 ../../library/urllib.parse.rst:307 +#: ../../library/urllib.parse.rst:309 ../../library/urllib.parse.rst:311 msgid ":const:`None`" msgstr ":const:`None`" -#: ../../library/urllib.parse.rst:124 ../../library/urllib.parse.rst:306 +#: ../../library/urllib.parse.rst:125 ../../library/urllib.parse.rst:307 msgid ":attr:`password`" msgstr ":attr:`password`" -#: ../../library/urllib.parse.rst:124 ../../library/urllib.parse.rst:306 +#: ../../library/urllib.parse.rst:125 ../../library/urllib.parse.rst:307 msgid "Password" msgstr "" -#: ../../library/urllib.parse.rst:126 ../../library/urllib.parse.rst:308 +#: ../../library/urllib.parse.rst:127 ../../library/urllib.parse.rst:309 msgid ":attr:`hostname`" msgstr ":attr:`hostname`" -#: ../../library/urllib.parse.rst:126 ../../library/urllib.parse.rst:308 +#: ../../library/urllib.parse.rst:127 ../../library/urllib.parse.rst:309 msgid "Host name (lower case)" msgstr "" -#: ../../library/urllib.parse.rst:128 ../../library/urllib.parse.rst:310 +#: ../../library/urllib.parse.rst:129 ../../library/urllib.parse.rst:311 msgid ":attr:`port`" msgstr ":attr:`port`" -#: ../../library/urllib.parse.rst:128 ../../library/urllib.parse.rst:310 +#: ../../library/urllib.parse.rst:129 ../../library/urllib.parse.rst:311 msgid "Port number as integer, if present" msgstr "" -#: ../../library/urllib.parse.rst:132 ../../library/urllib.parse.rst:314 +#: ../../library/urllib.parse.rst:133 ../../library/urllib.parse.rst:315 msgid "" "Reading the :attr:`port` attribute will raise a :exc:`ValueError` if an " "invalid port is specified in the URL. See section :ref:`urlparse-result-" "object` for more information on the result object." msgstr "" -#: ../../library/urllib.parse.rst:136 ../../library/urllib.parse.rst:318 +#: ../../library/urllib.parse.rst:137 ../../library/urllib.parse.rst:319 msgid "" "Unmatched square brackets in the :attr:`netloc` attribute will raise a :exc:" "`ValueError`." msgstr "" -#: ../../library/urllib.parse.rst:139 ../../library/urllib.parse.rst:321 +#: ../../library/urllib.parse.rst:140 ../../library/urllib.parse.rst:322 msgid "" "Characters in the :attr:`netloc` attribute that decompose under NFKC " "normalization (as used by the IDNA encoding) into any of ``/``, ``?``, " @@ -273,7 +270,7 @@ msgid "" "decomposed before parsing, no error will be raised." msgstr "" -#: ../../library/urllib.parse.rst:144 +#: ../../library/urllib.parse.rst:145 msgid "" "As is the case with all named tuples, the subclass has a few additional " "methods and attributes that are particularly useful. One such method is :" @@ -281,30 +278,30 @@ msgid "" "object replacing specified fields with new values." msgstr "" -#: ../../library/urllib.parse.rst:162 +#: ../../library/urllib.parse.rst:163 msgid "Added IPv6 URL parsing capabilities." msgstr "" -#: ../../library/urllib.parse.rst:165 +#: ../../library/urllib.parse.rst:166 msgid "" "The fragment is now parsed for all URL schemes (unless *allow_fragment* is " "false), in accordance with :rfc:`3986`. Previously, an allowlist of schemes " "that support fragments existed." msgstr "" -#: ../../library/urllib.parse.rst:170 ../../library/urllib.parse.rst:329 +#: ../../library/urllib.parse.rst:171 ../../library/urllib.parse.rst:330 msgid "" "Out-of-range port numbers now raise :exc:`ValueError`, instead of returning :" "const:`None`." msgstr "" -#: ../../library/urllib.parse.rst:174 ../../library/urllib.parse.rst:333 +#: ../../library/urllib.parse.rst:175 ../../library/urllib.parse.rst:334 msgid "" "Characters that affect netloc parsing under NFKC normalization will now " "raise :exc:`ValueError`." msgstr "" -#: ../../library/urllib.parse.rst:181 +#: ../../library/urllib.parse.rst:182 msgid "" "Parse a query string given as a string argument (data of type :mimetype:" "`application/x-www-form-urlencoded`). Data are returned as a dictionary. " @@ -312,7 +309,7 @@ msgid "" "lists of values for each name." msgstr "" -#: ../../library/urllib.parse.rst:186 ../../library/urllib.parse.rst:231 +#: ../../library/urllib.parse.rst:187 ../../library/urllib.parse.rst:232 msgid "" "The optional argument *keep_blank_values* is a flag indicating whether blank " "values in percent-encoded queries should be treated as blank strings. A true " @@ -321,48 +318,48 @@ msgid "" "treated as if they were not included." msgstr "" -#: ../../library/urllib.parse.rst:192 ../../library/urllib.parse.rst:237 +#: ../../library/urllib.parse.rst:193 ../../library/urllib.parse.rst:238 msgid "" "The optional argument *strict_parsing* is a flag indicating what to do with " "parsing errors. If false (the default), errors are silently ignored. If " "true, errors raise a :exc:`ValueError` exception." msgstr "" -#: ../../library/urllib.parse.rst:196 ../../library/urllib.parse.rst:241 +#: ../../library/urllib.parse.rst:197 ../../library/urllib.parse.rst:242 msgid "" "The optional *encoding* and *errors* parameters specify how to decode " "percent-encoded sequences into Unicode characters, as accepted by the :meth:" "`bytes.decode` method." msgstr "" -#: ../../library/urllib.parse.rst:200 ../../library/urllib.parse.rst:245 +#: ../../library/urllib.parse.rst:201 ../../library/urllib.parse.rst:246 msgid "" "The optional argument *max_num_fields* is the maximum number of fields to " "read. If set, then throws a :exc:`ValueError` if there are more than " "*max_num_fields* fields read." msgstr "" -#: ../../library/urllib.parse.rst:204 ../../library/urllib.parse.rst:249 +#: ../../library/urllib.parse.rst:205 ../../library/urllib.parse.rst:250 msgid "" "The optional argument *separator* is the symbol to use for separating the " "query arguments. It defaults to ``&``." msgstr "" -#: ../../library/urllib.parse.rst:207 +#: ../../library/urllib.parse.rst:208 msgid "" "Use the :func:`urllib.parse.urlencode` function (with the ``doseq`` " "parameter set to ``True``) to convert such dictionaries into query strings." msgstr "" -#: ../../library/urllib.parse.rst:212 ../../library/urllib.parse.rst:255 +#: ../../library/urllib.parse.rst:213 ../../library/urllib.parse.rst:256 msgid "Add *encoding* and *errors* parameters." msgstr "" -#: ../../library/urllib.parse.rst:215 ../../library/urllib.parse.rst:258 +#: ../../library/urllib.parse.rst:216 ../../library/urllib.parse.rst:259 msgid "Added *max_num_fields* parameter." msgstr "新增 *max_num_fields* 參數。" -#: ../../library/urllib.parse.rst:218 ../../library/urllib.parse.rst:261 +#: ../../library/urllib.parse.rst:219 ../../library/urllib.parse.rst:262 msgid "" "Added *separator* parameter with the default value of ``&``. Python versions " "earlier than Python 3.10 allowed using both ``;`` and ``&`` as query " @@ -370,20 +367,20 @@ msgid "" "key, with ``&`` as the default separator." msgstr "" -#: ../../library/urllib.parse.rst:227 +#: ../../library/urllib.parse.rst:228 msgid "" "Parse a query string given as a string argument (data of type :mimetype:" "`application/x-www-form-urlencoded`). Data are returned as a list of name, " "value pairs." msgstr "" -#: ../../library/urllib.parse.rst:252 +#: ../../library/urllib.parse.rst:253 msgid "" "Use the :func:`urllib.parse.urlencode` function to convert such lists of " "pairs into query strings." msgstr "" -#: ../../library/urllib.parse.rst:270 +#: ../../library/urllib.parse.rst:271 msgid "" "Construct a URL from a tuple as returned by ``urlparse()``. The *parts* " "argument can be any six-item iterable. This may result in a slightly " @@ -392,7 +389,7 @@ msgid "" "states that these are equivalent)." msgstr "" -#: ../../library/urllib.parse.rst:279 +#: ../../library/urllib.parse.rst:280 msgid "" "This is similar to :func:`urlparse`, but does not split the params from the " "URL. This should generally be used instead of :func:`urlparse` if the more " @@ -402,23 +399,23 @@ msgid "" "returns a 5-item :term:`named tuple`::" msgstr "" -#: ../../library/urllib.parse.rst:288 ../../library/urllib.parse.rst:392 +#: ../../library/urllib.parse.rst:289 ../../library/urllib.parse.rst:393 msgid "" "The return value is a :term:`named tuple`, its items can be accessed by " "index or as named attributes:" msgstr "" -#: ../../library/urllib.parse.rst:326 +#: ../../library/urllib.parse.rst:327 msgid "" "Following the `WHATWG spec`_ that updates RFC 3986, ASCII newline ``\\n``, ``" "\\r`` and tab ``\\t`` characters are stripped from the URL." msgstr "" -#: ../../library/urllib.parse.rst:337 +#: ../../library/urllib.parse.rst:338 msgid "ASCII newline and tab characters are stripped from the URL." msgstr "" -#: ../../library/urllib.parse.rst:344 +#: ../../library/urllib.parse.rst:345 msgid "" "Combine the elements of a tuple as returned by :func:`urlsplit` into a " "complete URL as a string. The *parts* argument can be any five-item " @@ -427,7 +424,7 @@ msgid "" "a ? with an empty query; the RFC states that these are equivalent)." msgstr "" -#: ../../library/urllib.parse.rst:353 +#: ../../library/urllib.parse.rst:354 msgid "" "Construct a full (\"absolute\") URL by combining a \"base URL\" (*base*) " "with another URL (*url*). Informally, this uses components of the base URL, " @@ -435,30 +432,30 @@ msgid "" "path, to provide missing components in the relative URL. For example:" msgstr "" -#: ../../library/urllib.parse.rst:362 +#: ../../library/urllib.parse.rst:363 msgid "" "The *allow_fragments* argument has the same meaning and default as for :func:" "`urlparse`." msgstr "" -#: ../../library/urllib.parse.rst:367 +#: ../../library/urllib.parse.rst:368 msgid "" "If *url* is an absolute URL (that is, it starts with ``//`` or ``scheme://" "``), the *url*'s hostname and/or scheme will be present in the result. For " "example:" msgstr "" -#: ../../library/urllib.parse.rst:376 +#: ../../library/urllib.parse.rst:377 msgid "" "If you do not want that behavior, preprocess the *url* with :func:`urlsplit` " "and :func:`urlunsplit`, removing possible *scheme* and *netloc* parts." msgstr "" -#: ../../library/urllib.parse.rst:382 +#: ../../library/urllib.parse.rst:383 msgid "Behavior updated to match the semantics defined in :rfc:`3986`." msgstr "" -#: ../../library/urllib.parse.rst:387 +#: ../../library/urllib.parse.rst:388 msgid "" "If *url* contains a fragment identifier, return a modified version of *url* " "with no fragment identifier, and the fragment identifier as a separate " @@ -466,25 +463,25 @@ msgid "" "unmodified and an empty string." msgstr "" -#: ../../library/urllib.parse.rst:398 +#: ../../library/urllib.parse.rst:399 msgid ":attr:`url`" msgstr ":attr:`url`" -#: ../../library/urllib.parse.rst:398 +#: ../../library/urllib.parse.rst:399 msgid "URL with no fragment" msgstr "" -#: ../../library/urllib.parse.rst:403 +#: ../../library/urllib.parse.rst:404 msgid "" "See section :ref:`urlparse-result-object` for more information on the result " "object." msgstr "" -#: ../../library/urllib.parse.rst:406 +#: ../../library/urllib.parse.rst:407 msgid "Result is a structured object rather than a simple 2-tuple." msgstr "" -#: ../../library/urllib.parse.rst:411 +#: ../../library/urllib.parse.rst:412 msgid "" "Extract the url from a wrapped URL (that is, a string formatted as ````, ````, ``URL:scheme://host/path`` " @@ -492,11 +489,11 @@ msgid "" "without changes." msgstr "" -#: ../../library/urllib.parse.rst:419 +#: ../../library/urllib.parse.rst:420 msgid "Parsing ASCII Encoded Bytes" msgstr "" -#: ../../library/urllib.parse.rst:421 +#: ../../library/urllib.parse.rst:422 msgid "" "The URL parsing functions were originally designed to operate on character " "strings only. In practice, it is useful to be able to manipulate properly " @@ -505,14 +502,14 @@ msgid "" "`bytearray` objects in addition to :class:`str` objects." msgstr "" -#: ../../library/urllib.parse.rst:427 +#: ../../library/urllib.parse.rst:428 msgid "" "If :class:`str` data is passed in, the result will also contain only :class:" "`str` data. If :class:`bytes` or :class:`bytearray` data is passed in, the " "result will contain only :class:`bytes` data." msgstr "" -#: ../../library/urllib.parse.rst:431 +#: ../../library/urllib.parse.rst:432 msgid "" "Attempting to mix :class:`str` data with :class:`bytes` or :class:" "`bytearray` in a single function call will result in a :exc:`TypeError` " @@ -520,7 +517,7 @@ msgid "" "trigger :exc:`UnicodeDecodeError`." msgstr "" -#: ../../library/urllib.parse.rst:436 +#: ../../library/urllib.parse.rst:437 msgid "" "To support easier conversion of result objects between :class:`str` and :" "class:`bytes`, all return values from URL parsing functions provide either " @@ -533,14 +530,14 @@ msgid "" "`str` data (for :meth:`decode` methods)." msgstr "" -#: ../../library/urllib.parse.rst:447 +#: ../../library/urllib.parse.rst:448 msgid "" "Applications that need to operate on potentially improperly quoted URLs that " "may contain non-ASCII data will need to do their own decoding from bytes to " "characters before invoking the URL parsing methods." msgstr "" -#: ../../library/urllib.parse.rst:451 +#: ../../library/urllib.parse.rst:452 msgid "" "The behaviour described in this section applies only to the URL parsing " "functions. The URL quoting functions use their own rules when producing or " @@ -548,15 +545,15 @@ msgid "" "URL quoting functions." msgstr "" -#: ../../library/urllib.parse.rst:456 +#: ../../library/urllib.parse.rst:457 msgid "URL parsing functions now accept ASCII encoded byte sequences" msgstr "" -#: ../../library/urllib.parse.rst:463 +#: ../../library/urllib.parse.rst:464 msgid "Structured Parse Results" msgstr "" -#: ../../library/urllib.parse.rst:465 +#: ../../library/urllib.parse.rst:466 msgid "" "The result objects from the :func:`urlparse`, :func:`urlsplit` and :func:" "`urldefrag` functions are subclasses of the :class:`tuple` type. These " @@ -565,7 +562,7 @@ msgid "" "section, as well as an additional method:" msgstr "" -#: ../../library/urllib.parse.rst:473 +#: ../../library/urllib.parse.rst:474 msgid "" "Return the re-combined version of the original URL as a string. This may " "differ from the original URL in that the scheme may be normalized to lower " @@ -573,72 +570,72 @@ msgid "" "queries, and fragment identifiers will be removed." msgstr "" -#: ../../library/urllib.parse.rst:478 +#: ../../library/urllib.parse.rst:479 msgid "" "For :func:`urldefrag` results, only empty fragment identifiers will be " "removed. For :func:`urlsplit` and :func:`urlparse` results, all noted " "changes will be made to the URL returned by this method." msgstr "" -#: ../../library/urllib.parse.rst:482 +#: ../../library/urllib.parse.rst:483 msgid "" "The result of this method remains unchanged if passed back through the " "original parsing function:" msgstr "" -#: ../../library/urllib.parse.rst:495 +#: ../../library/urllib.parse.rst:496 msgid "" "The following classes provide the implementations of the structured parse " "results when operating on :class:`str` objects:" msgstr "" -#: ../../library/urllib.parse.rst:500 +#: ../../library/urllib.parse.rst:501 msgid "" "Concrete class for :func:`urldefrag` results containing :class:`str` data. " "The :meth:`encode` method returns a :class:`DefragResultBytes` instance." msgstr "" -#: ../../library/urllib.parse.rst:508 +#: ../../library/urllib.parse.rst:509 msgid "" "Concrete class for :func:`urlparse` results containing :class:`str` data. " "The :meth:`encode` method returns a :class:`ParseResultBytes` instance." msgstr "" -#: ../../library/urllib.parse.rst:514 +#: ../../library/urllib.parse.rst:515 msgid "" "Concrete class for :func:`urlsplit` results containing :class:`str` data. " "The :meth:`encode` method returns a :class:`SplitResultBytes` instance." msgstr "" -#: ../../library/urllib.parse.rst:519 +#: ../../library/urllib.parse.rst:520 msgid "" "The following classes provide the implementations of the parse results when " "operating on :class:`bytes` or :class:`bytearray` objects:" msgstr "" -#: ../../library/urllib.parse.rst:524 +#: ../../library/urllib.parse.rst:525 msgid "" "Concrete class for :func:`urldefrag` results containing :class:`bytes` data. " "The :meth:`decode` method returns a :class:`DefragResult` instance." msgstr "" -#: ../../library/urllib.parse.rst:532 +#: ../../library/urllib.parse.rst:533 msgid "" "Concrete class for :func:`urlparse` results containing :class:`bytes` data. " "The :meth:`decode` method returns a :class:`ParseResult` instance." msgstr "" -#: ../../library/urllib.parse.rst:540 +#: ../../library/urllib.parse.rst:541 msgid "" "Concrete class for :func:`urlsplit` results containing :class:`bytes` data. " "The :meth:`decode` method returns a :class:`SplitResult` instance." msgstr "" -#: ../../library/urllib.parse.rst:548 +#: ../../library/urllib.parse.rst:549 msgid "URL Quoting" msgstr "" -#: ../../library/urllib.parse.rst:550 +#: ../../library/urllib.parse.rst:551 msgid "" "The URL quoting functions focus on taking program data and making it safe " "for use as URL components by quoting special characters and appropriately " @@ -647,7 +644,7 @@ msgid "" "isn't already covered by the URL parsing functions above." msgstr "" -#: ../../library/urllib.parse.rst:558 +#: ../../library/urllib.parse.rst:559 msgid "" "Replace special characters in *string* using the ``%xx`` escape. Letters, " "digits, and the characters ``'_.-~'`` are never quoted. By default, this " @@ -656,18 +653,18 @@ msgid "" "quoted --- its default value is ``'/'``." msgstr "" -#: ../../library/urllib.parse.rst:564 ../../library/urllib.parse.rst:610 -#: ../../library/urllib.parse.rst:639 +#: ../../library/urllib.parse.rst:565 ../../library/urllib.parse.rst:611 +#: ../../library/urllib.parse.rst:640 msgid "*string* may be either a :class:`str` or a :class:`bytes` object." msgstr "" -#: ../../library/urllib.parse.rst:566 +#: ../../library/urllib.parse.rst:567 msgid "" "Moved from :rfc:`2396` to :rfc:`3986` for quoting URL strings. \"~\" is now " "included in the set of unreserved characters." msgstr "" -#: ../../library/urllib.parse.rst:570 +#: ../../library/urllib.parse.rst:571 msgid "" "The optional *encoding* and *errors* parameters specify how to deal with non-" "ASCII characters, as accepted by the :meth:`str.encode` method. *encoding* " @@ -677,17 +674,17 @@ msgid "" "`TypeError` is raised." msgstr "" -#: ../../library/urllib.parse.rst:578 +#: ../../library/urllib.parse.rst:579 msgid "" "Note that ``quote(string, safe, encoding, errors)`` is equivalent to " "``quote_from_bytes(string.encode(encoding, errors), safe)``." msgstr "" -#: ../../library/urllib.parse.rst:581 +#: ../../library/urllib.parse.rst:582 msgid "Example: ``quote('/El Niño/')`` yields ``'/El%20Ni%C3%B1o/'``." msgstr "" -#: ../../library/urllib.parse.rst:586 +#: ../../library/urllib.parse.rst:587 msgid "" "Like :func:`quote`, but also replace spaces with plus signs, as required for " "quoting HTML form values when building up a query string to go into a URL. " @@ -695,21 +692,21 @@ msgid "" "*safe*. It also does not have *safe* default to ``'/'``." msgstr "" -#: ../../library/urllib.parse.rst:591 +#: ../../library/urllib.parse.rst:592 msgid "Example: ``quote_plus('/El Niño/')`` yields ``'%2FEl+Ni%C3%B1o%2F'``." msgstr "" -#: ../../library/urllib.parse.rst:596 +#: ../../library/urllib.parse.rst:597 msgid "" "Like :func:`quote`, but accepts a :class:`bytes` object rather than a :class:" "`str`, and does not perform string-to-bytes encoding." msgstr "" -#: ../../library/urllib.parse.rst:599 +#: ../../library/urllib.parse.rst:600 msgid "Example: ``quote_from_bytes(b'a&\\xef')`` yields ``'a%26%EF'``." msgstr "" -#: ../../library/urllib.parse.rst:605 +#: ../../library/urllib.parse.rst:606 msgid "" "Replace ``%xx`` escapes with their single-character equivalent. The optional " "*encoding* and *errors* parameters specify how to decode percent-encoded " @@ -717,52 +714,52 @@ msgid "" "method." msgstr "" -#: ../../library/urllib.parse.rst:612 +#: ../../library/urllib.parse.rst:613 msgid "" "*encoding* defaults to ``'utf-8'``. *errors* defaults to ``'replace'``, " "meaning invalid sequences are replaced by a placeholder character." msgstr "" -#: ../../library/urllib.parse.rst:616 +#: ../../library/urllib.parse.rst:617 msgid "Example: ``unquote('/El%20Ni%C3%B1o/')`` yields ``'/El Niño/'``." msgstr "" -#: ../../library/urllib.parse.rst:618 +#: ../../library/urllib.parse.rst:619 msgid "" "*string* parameter supports bytes and str objects (previously only str)." msgstr "" -#: ../../library/urllib.parse.rst:626 +#: ../../library/urllib.parse.rst:627 msgid "" "Like :func:`unquote`, but also replace plus signs with spaces, as required " "for unquoting HTML form values." msgstr "" -#: ../../library/urllib.parse.rst:629 +#: ../../library/urllib.parse.rst:630 msgid "*string* must be a :class:`str`." msgstr "" -#: ../../library/urllib.parse.rst:631 +#: ../../library/urllib.parse.rst:632 msgid "Example: ``unquote_plus('/El+Ni%C3%B1o/')`` yields ``'/El Niño/'``." msgstr "" -#: ../../library/urllib.parse.rst:636 +#: ../../library/urllib.parse.rst:637 msgid "" "Replace ``%xx`` escapes with their single-octet equivalent, and return a :" "class:`bytes` object." msgstr "" -#: ../../library/urllib.parse.rst:641 +#: ../../library/urllib.parse.rst:642 msgid "" "If it is a :class:`str`, unescaped non-ASCII characters in *string* are " "encoded into UTF-8 bytes." msgstr "" -#: ../../library/urllib.parse.rst:644 +#: ../../library/urllib.parse.rst:645 msgid "Example: ``unquote_to_bytes('a%26%EF')`` yields ``b'a&\\xef'``." msgstr "" -#: ../../library/urllib.parse.rst:650 +#: ../../library/urllib.parse.rst:651 msgid "" "Convert a mapping object or a sequence of two-element tuples, which may " "contain :class:`str` or :class:`bytes` objects, to a percent-encoded ASCII " @@ -771,7 +768,7 @@ msgid "" "be encoded to bytes, otherwise it would result in a :exc:`TypeError`." msgstr "" -#: ../../library/urllib.parse.rst:657 +#: ../../library/urllib.parse.rst:658 msgid "" "The resulting string is a series of ``key=value`` pairs separated by ``'&'`` " "characters, where both *key* and *value* are quoted using the *quote_via* " @@ -784,7 +781,7 @@ msgid "" "``quote`` and specify a value for *safe*." msgstr "" -#: ../../library/urllib.parse.rst:667 +#: ../../library/urllib.parse.rst:668 msgid "" "When a sequence of two-element tuples is used as the *query* argument, the " "first element of each tuple is a key and the second is a value. The value " @@ -795,49 +792,49 @@ msgid "" "order of parameter tuples in the sequence." msgstr "" -#: ../../library/urllib.parse.rst:675 +#: ../../library/urllib.parse.rst:676 msgid "" "The *safe*, *encoding*, and *errors* parameters are passed down to " "*quote_via* (the *encoding* and *errors* parameters are only passed when a " "query element is a :class:`str`)." msgstr "" -#: ../../library/urllib.parse.rst:679 +#: ../../library/urllib.parse.rst:680 msgid "" "To reverse this encoding process, :func:`parse_qs` and :func:`parse_qsl` are " "provided in this module to parse query strings into Python data structures." msgstr "" -#: ../../library/urllib.parse.rst:682 +#: ../../library/urllib.parse.rst:683 msgid "" "Refer to :ref:`urllib examples ` to find out how the :func:" "`urllib.parse.urlencode` method can be used for generating the query string " "of a URL or data for a POST request." msgstr "" -#: ../../library/urllib.parse.rst:686 +#: ../../library/urllib.parse.rst:687 msgid "*query* supports bytes and string objects." msgstr "" -#: ../../library/urllib.parse.rst:689 +#: ../../library/urllib.parse.rst:690 msgid "*quote_via* parameter." msgstr "" -#: ../../library/urllib.parse.rst:697 +#: ../../library/urllib.parse.rst:698 msgid "`WHATWG`_ - URL Living standard" msgstr "" -#: ../../library/urllib.parse.rst:696 +#: ../../library/urllib.parse.rst:697 msgid "" "Working Group for the URL Standard that defines URLs, domains, IP addresses, " "the application/x-www-form-urlencoded format, and their API." msgstr "" -#: ../../library/urllib.parse.rst:703 +#: ../../library/urllib.parse.rst:704 msgid ":rfc:`3986` - Uniform Resource Identifiers" msgstr "" -#: ../../library/urllib.parse.rst:700 +#: ../../library/urllib.parse.rst:701 msgid "" "This is the current standard (STD66). Any changes to urllib.parse module " "should conform to this. Certain deviations could be observed, which are " @@ -845,47 +842,47 @@ msgid "" "requirements as commonly observed in major browsers." msgstr "" -#: ../../library/urllib.parse.rst:706 +#: ../../library/urllib.parse.rst:707 msgid ":rfc:`2732` - Format for Literal IPv6 Addresses in URL's." msgstr "" -#: ../../library/urllib.parse.rst:706 +#: ../../library/urllib.parse.rst:707 msgid "This specifies the parsing requirements of IPv6 URLs." msgstr "" -#: ../../library/urllib.parse.rst:710 +#: ../../library/urllib.parse.rst:711 msgid ":rfc:`2396` - Uniform Resource Identifiers (URI): Generic Syntax" msgstr "" -#: ../../library/urllib.parse.rst:709 +#: ../../library/urllib.parse.rst:710 msgid "" "Document describing the generic syntactic requirements for both Uniform " "Resource Names (URNs) and Uniform Resource Locators (URLs)." msgstr "" -#: ../../library/urllib.parse.rst:713 +#: ../../library/urllib.parse.rst:714 msgid ":rfc:`2368` - The mailto URL scheme." msgstr "" -#: ../../library/urllib.parse.rst:713 +#: ../../library/urllib.parse.rst:714 msgid "Parsing requirements for mailto URL schemes." msgstr "" -#: ../../library/urllib.parse.rst:718 +#: ../../library/urllib.parse.rst:719 msgid ":rfc:`1808` - Relative Uniform Resource Locators" msgstr "" -#: ../../library/urllib.parse.rst:716 +#: ../../library/urllib.parse.rst:717 msgid "" "This Request For Comments includes the rules for joining an absolute and a " "relative URL, including a fair number of \"Abnormal Examples\" which govern " "the treatment of border cases." msgstr "" -#: ../../library/urllib.parse.rst:720 +#: ../../library/urllib.parse.rst:721 msgid ":rfc:`1738` - Uniform Resource Locators (URL)" msgstr "" -#: ../../library/urllib.parse.rst:721 +#: ../../library/urllib.parse.rst:722 msgid "This specifies the formal syntax and semantics of absolute URLs." msgstr "" From 3bd0604e0f7f301c130aca5da710eb368af82d1c Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 9 Oct 2022 00:24:03 +0000 Subject: [PATCH 10/14] sync with cpython c86ee93d --- library/http.cookiejar.po | 287 ++++++++-------- library/http.server.po | 6 +- library/os.po | 683 +++++++++++++++++++------------------- reference/expressions.po | 146 ++++---- 4 files changed, 564 insertions(+), 558 deletions(-) diff --git a/library/http.cookiejar.po b/library/http.cookiejar.po index 21ec03aaa1..f8d93df35a 100644 --- a/library/http.cookiejar.po +++ b/library/http.cookiejar.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-04 00:24+0000\n" +"POT-Creation-Date: 2022-10-09 00:22+0000\n" "PO-Revision-Date: 2016-11-19 00:31+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -103,17 +103,22 @@ msgid "" "this class are documented in section :ref:`file-cookie-jar-classes`." msgstr "" -#: ../../library/http.cookiejar.rst:76 ../../library/http.cookiejar.rst:349 +#: ../../library/http.cookiejar.rst:74 +msgid "" +"This should not be initialized directly – use its subclasses below instead." +msgstr "" + +#: ../../library/http.cookiejar.rst:78 ../../library/http.cookiejar.rst:351 msgid "The filename parameter supports a :term:`path-like object`." msgstr "" -#: ../../library/http.cookiejar.rst:81 +#: ../../library/http.cookiejar.rst:83 msgid "" "This class is responsible for deciding whether each cookie should be " "accepted from / returned to the server." msgstr "" -#: ../../library/http.cookiejar.rst:87 +#: ../../library/http.cookiejar.rst:89 msgid "" "Constructor arguments should be passed as keyword arguments only. " "*blocked_domains* is a sequence of domain names that we never accept cookies " @@ -125,7 +130,7 @@ msgid "" "`CookiePolicy` and :class:`DefaultCookiePolicy` objects." msgstr "" -#: ../../library/http.cookiejar.rst:96 +#: ../../library/http.cookiejar.rst:98 msgid "" ":class:`DefaultCookiePolicy` implements the standard accept / reject rules " "for Netscape and :rfc:`2965` cookies. By default, :rfc:`2109` cookies (ie. " @@ -138,7 +143,7 @@ msgid "" "parameters to allow some fine-tuning of policy." msgstr "" -#: ../../library/http.cookiejar.rst:109 +#: ../../library/http.cookiejar.rst:111 msgid "" "This class represents Netscape, :rfc:`2109` and :rfc:`2965` cookies. It is " "not expected that users of :mod:`http.cookiejar` construct their own :class:" @@ -146,29 +151,29 @@ msgid "" "class:`CookieJar` instance." msgstr "" -#: ../../library/http.cookiejar.rst:118 +#: ../../library/http.cookiejar.rst:120 msgid "Module :mod:`urllib.request`" msgstr ":mod:`urllib.request` 模組" -#: ../../library/http.cookiejar.rst:118 +#: ../../library/http.cookiejar.rst:120 msgid "URL opening with automatic cookie handling." msgstr "" -#: ../../library/http.cookiejar.rst:123 +#: ../../library/http.cookiejar.rst:125 msgid "Module :mod:`http.cookies`" msgstr ":mod:`http.cookies` 模組" -#: ../../library/http.cookiejar.rst:121 +#: ../../library/http.cookiejar.rst:123 msgid "" "HTTP cookie classes, principally useful for server-side code. The :mod:" "`http.cookiejar` and :mod:`http.cookies` modules do not depend on each other." msgstr "" -#: ../../library/http.cookiejar.rst:129 +#: ../../library/http.cookiejar.rst:131 msgid "https://curl.se/rfc/cookie_spec.html" msgstr "https://curl.se/rfc/cookie_spec.html" -#: ../../library/http.cookiejar.rst:126 +#: ../../library/http.cookiejar.rst:128 msgid "" "The specification of the original Netscape cookie protocol. Though this is " "still the dominant protocol, the 'Netscape cookie protocol' implemented by " @@ -176,55 +181,55 @@ msgid "" "resemblance to the one sketched out in ``cookie_spec.html``." msgstr "" -#: ../../library/http.cookiejar.rst:132 +#: ../../library/http.cookiejar.rst:134 msgid ":rfc:`2109` - HTTP State Management Mechanism" msgstr "" -#: ../../library/http.cookiejar.rst:132 +#: ../../library/http.cookiejar.rst:134 msgid "Obsoleted by :rfc:`2965`. Uses :mailheader:`Set-Cookie` with version=1." msgstr "" -#: ../../library/http.cookiejar.rst:136 +#: ../../library/http.cookiejar.rst:138 msgid ":rfc:`2965` - HTTP State Management Mechanism" msgstr "" -#: ../../library/http.cookiejar.rst:135 +#: ../../library/http.cookiejar.rst:137 msgid "" "The Netscape protocol with the bugs fixed. Uses :mailheader:`Set-Cookie2` " "in place of :mailheader:`Set-Cookie`. Not widely used." msgstr "" -#: ../../library/http.cookiejar.rst:139 +#: ../../library/http.cookiejar.rst:141 msgid "http://kristol.org/cookie/errata.html" msgstr "http://kristol.org/cookie/errata.html" -#: ../../library/http.cookiejar.rst:139 +#: ../../library/http.cookiejar.rst:141 msgid "Unfinished errata to :rfc:`2965`." msgstr "" -#: ../../library/http.cookiejar.rst:141 +#: ../../library/http.cookiejar.rst:143 msgid ":rfc:`2964` - Use of HTTP State Management" msgstr "" -#: ../../library/http.cookiejar.rst:146 +#: ../../library/http.cookiejar.rst:148 msgid "CookieJar and FileCookieJar Objects" msgstr "CookieJar 與 FileCookieJar 物件" -#: ../../library/http.cookiejar.rst:148 +#: ../../library/http.cookiejar.rst:150 msgid "" ":class:`CookieJar` objects support the :term:`iterator` protocol for " "iterating over contained :class:`Cookie` objects." msgstr "" -#: ../../library/http.cookiejar.rst:151 +#: ../../library/http.cookiejar.rst:153 msgid ":class:`CookieJar` has the following methods:" msgstr "" -#: ../../library/http.cookiejar.rst:156 +#: ../../library/http.cookiejar.rst:158 msgid "Add correct :mailheader:`Cookie` header to *request*." msgstr "" -#: ../../library/http.cookiejar.rst:158 +#: ../../library/http.cookiejar.rst:160 msgid "" "If policy allows (ie. the :attr:`rfc2965` and :attr:`hide_cookie2` " "attributes of the :class:`CookieJar`'s :class:`CookiePolicy` instance are " @@ -232,7 +237,7 @@ msgid "" "when appropriate." msgstr "" -#: ../../library/http.cookiejar.rst:162 +#: ../../library/http.cookiejar.rst:164 msgid "" "The *request* object (usually a :class:`urllib.request.Request` instance) " "must support the methods :meth:`get_full_url`, :meth:`has_header`, :meth:" @@ -241,19 +246,19 @@ msgid "" "`origin_req_host` as documented by :mod:`urllib.request`." msgstr "" -#: ../../library/http.cookiejar.rst:170 ../../library/http.cookiejar.rst:196 +#: ../../library/http.cookiejar.rst:172 ../../library/http.cookiejar.rst:198 msgid "" "*request* object needs :attr:`origin_req_host` attribute. Dependency on a " "deprecated method :meth:`get_origin_req_host` has been removed." msgstr "" -#: ../../library/http.cookiejar.rst:176 +#: ../../library/http.cookiejar.rst:178 msgid "" "Extract cookies from HTTP *response* and store them in the :class:" "`CookieJar`, where allowed by policy." msgstr "" -#: ../../library/http.cookiejar.rst:179 +#: ../../library/http.cookiejar.rst:181 msgid "" "The :class:`CookieJar` will look for allowable :mailheader:`Set-Cookie` and :" "mailheader:`Set-Cookie2` headers in the *response* argument, and store " @@ -261,14 +266,14 @@ msgid "" "approval)." msgstr "" -#: ../../library/http.cookiejar.rst:183 +#: ../../library/http.cookiejar.rst:185 msgid "" "The *response* object (usually the result of a call to :meth:`urllib.request." "urlopen`, or similar) should support an :meth:`info` method, which returns " "an :class:`email.message.Message` instance." msgstr "" -#: ../../library/http.cookiejar.rst:187 +#: ../../library/http.cookiejar.rst:189 msgid "" "The *request* object (usually a :class:`urllib.request.Request` instance) " "must support the method :meth:`get_full_url` and the attributes :attr:" @@ -277,36 +282,36 @@ msgid "" "attributes as well as for checking that the cookie is allowed to be set." msgstr "" -#: ../../library/http.cookiejar.rst:201 +#: ../../library/http.cookiejar.rst:203 msgid "Set the :class:`CookiePolicy` instance to be used." msgstr "" -#: ../../library/http.cookiejar.rst:206 +#: ../../library/http.cookiejar.rst:208 msgid "" "Return sequence of :class:`Cookie` objects extracted from *response* object." msgstr "" -#: ../../library/http.cookiejar.rst:208 +#: ../../library/http.cookiejar.rst:210 msgid "" "See the documentation for :meth:`extract_cookies` for the interfaces " "required of the *response* and *request* arguments." msgstr "" -#: ../../library/http.cookiejar.rst:214 +#: ../../library/http.cookiejar.rst:216 msgid "Set a :class:`Cookie` if policy says it's OK to do so." msgstr "" -#: ../../library/http.cookiejar.rst:219 +#: ../../library/http.cookiejar.rst:221 msgid "" "Set a :class:`Cookie`, without checking with policy to see whether or not it " "should be set." msgstr "" -#: ../../library/http.cookiejar.rst:225 +#: ../../library/http.cookiejar.rst:227 msgid "Clear some cookies." msgstr "" -#: ../../library/http.cookiejar.rst:227 +#: ../../library/http.cookiejar.rst:229 msgid "" "If invoked without arguments, clear all cookies. If given a single " "argument, only cookies belonging to that *domain* will be removed. If given " @@ -315,15 +320,15 @@ msgid "" "*domain*, *path* and *name* is removed." msgstr "" -#: ../../library/http.cookiejar.rst:233 +#: ../../library/http.cookiejar.rst:235 msgid "Raises :exc:`KeyError` if no matching cookie exists." msgstr "" -#: ../../library/http.cookiejar.rst:238 +#: ../../library/http.cookiejar.rst:240 msgid "Discard all session cookies." msgstr "" -#: ../../library/http.cookiejar.rst:240 +#: ../../library/http.cookiejar.rst:242 msgid "" "Discards all contained cookies that have a true :attr:`discard` attribute " "(usually because they had either no ``max-age`` or ``expires`` cookie-" @@ -332,27 +337,27 @@ msgid "" "window." msgstr "" -#: ../../library/http.cookiejar.rst:245 +#: ../../library/http.cookiejar.rst:247 msgid "" "Note that the :meth:`save` method won't save session cookies anyway, unless " "you ask otherwise by passing a true *ignore_discard* argument." msgstr "" -#: ../../library/http.cookiejar.rst:248 +#: ../../library/http.cookiejar.rst:250 msgid ":class:`FileCookieJar` implements the following additional methods:" msgstr "" -#: ../../library/http.cookiejar.rst:253 +#: ../../library/http.cookiejar.rst:255 msgid "Save cookies to a file." msgstr "" -#: ../../library/http.cookiejar.rst:255 +#: ../../library/http.cookiejar.rst:257 msgid "" "This base class raises :exc:`NotImplementedError`. Subclasses may leave " "this method unimplemented." msgstr "" -#: ../../library/http.cookiejar.rst:258 +#: ../../library/http.cookiejar.rst:260 msgid "" "*filename* is the name of file in which to save cookies. If *filename* is " "not specified, :attr:`self.filename` is used (whose default is the value " @@ -360,63 +365,63 @@ msgid "" "`None`, :exc:`ValueError` is raised." msgstr "" -#: ../../library/http.cookiejar.rst:263 +#: ../../library/http.cookiejar.rst:265 msgid "" "*ignore_discard*: save even cookies set to be discarded. *ignore_expires*: " "save even cookies that have expired" msgstr "" -#: ../../library/http.cookiejar.rst:266 +#: ../../library/http.cookiejar.rst:268 msgid "" "The file is overwritten if it already exists, thus wiping all the cookies it " "contains. Saved cookies can be restored later using the :meth:`load` or :" "meth:`revert` methods." msgstr "" -#: ../../library/http.cookiejar.rst:273 +#: ../../library/http.cookiejar.rst:275 msgid "Load cookies from a file." msgstr "" -#: ../../library/http.cookiejar.rst:275 +#: ../../library/http.cookiejar.rst:277 msgid "Old cookies are kept unless overwritten by newly loaded ones." msgstr "" -#: ../../library/http.cookiejar.rst:277 +#: ../../library/http.cookiejar.rst:279 msgid "Arguments are as for :meth:`save`." msgstr "" -#: ../../library/http.cookiejar.rst:279 +#: ../../library/http.cookiejar.rst:281 msgid "" "The named file must be in the format understood by the class, or :exc:" "`LoadError` will be raised. Also, :exc:`OSError` may be raised, for example " "if the file does not exist." msgstr "" -#: ../../library/http.cookiejar.rst:283 +#: ../../library/http.cookiejar.rst:285 msgid ":exc:`IOError` used to be raised, it is now an alias of :exc:`OSError`." msgstr "" -#: ../../library/http.cookiejar.rst:289 +#: ../../library/http.cookiejar.rst:291 msgid "Clear all cookies and reload cookies from a saved file." msgstr "" -#: ../../library/http.cookiejar.rst:291 +#: ../../library/http.cookiejar.rst:293 msgid "" ":meth:`revert` can raise the same exceptions as :meth:`load`. If there is a " "failure, the object's state will not be altered." msgstr "" -#: ../../library/http.cookiejar.rst:294 +#: ../../library/http.cookiejar.rst:296 msgid ":class:`FileCookieJar` instances have the following public attributes:" msgstr "" -#: ../../library/http.cookiejar.rst:299 +#: ../../library/http.cookiejar.rst:301 msgid "" "Filename of default file in which to keep cookies. This attribute may be " "assigned to." msgstr "" -#: ../../library/http.cookiejar.rst:305 +#: ../../library/http.cookiejar.rst:307 msgid "" "If true, load cookies lazily from disk. This attribute should not be " "assigned to. This is only a hint, since this only affects performance, not " @@ -425,43 +430,43 @@ msgid "" "in the standard library lazily loads cookies." msgstr "" -#: ../../library/http.cookiejar.rst:315 +#: ../../library/http.cookiejar.rst:317 msgid "FileCookieJar subclasses and co-operation with web browsers" msgstr "" -#: ../../library/http.cookiejar.rst:317 +#: ../../library/http.cookiejar.rst:319 msgid "" "The following :class:`CookieJar` subclasses are provided for reading and " "writing." msgstr "" -#: ../../library/http.cookiejar.rst:322 +#: ../../library/http.cookiejar.rst:324 msgid "" "A :class:`FileCookieJar` that can load from and save cookies to disk in the " "Mozilla ``cookies.txt`` file format (which is also used by curl and the Lynx " "and Netscape browsers)." msgstr "" -#: ../../library/http.cookiejar.rst:328 +#: ../../library/http.cookiejar.rst:330 msgid "" "This loses information about :rfc:`2965` cookies, and also about newer or " "non-standard cookie-attributes such as ``port``." msgstr "" -#: ../../library/http.cookiejar.rst:333 +#: ../../library/http.cookiejar.rst:335 msgid "" "Back up your cookies before saving if you have cookies whose loss / " "corruption would be inconvenient (there are some subtleties which may lead " "to slight changes in the file over a load / save round-trip)." msgstr "" -#: ../../library/http.cookiejar.rst:337 +#: ../../library/http.cookiejar.rst:339 msgid "" "Also note that cookies saved while Mozilla is running will get clobbered by " "Mozilla." msgstr "" -#: ../../library/http.cookiejar.rst:343 +#: ../../library/http.cookiejar.rst:345 msgid "" "A :class:`FileCookieJar` that can load from and save cookies to disk in " "format compatible with the libwww-perl library's ``Set-Cookie3`` file " @@ -469,47 +474,47 @@ msgid "" "file." msgstr "" -#: ../../library/http.cookiejar.rst:354 +#: ../../library/http.cookiejar.rst:356 msgid "CookiePolicy Objects" msgstr "CookiePolicy 物件" -#: ../../library/http.cookiejar.rst:356 +#: ../../library/http.cookiejar.rst:358 msgid "" "Objects implementing the :class:`CookiePolicy` interface have the following " "methods:" msgstr "" -#: ../../library/http.cookiejar.rst:362 +#: ../../library/http.cookiejar.rst:364 msgid "" "Return boolean value indicating whether cookie should be accepted from " "server." msgstr "" -#: ../../library/http.cookiejar.rst:364 +#: ../../library/http.cookiejar.rst:366 msgid "" "*cookie* is a :class:`Cookie` instance. *request* is an object implementing " "the interface defined by the documentation for :meth:`CookieJar." "extract_cookies`." msgstr "" -#: ../../library/http.cookiejar.rst:371 +#: ../../library/http.cookiejar.rst:373 msgid "" "Return boolean value indicating whether cookie should be returned to server." msgstr "" -#: ../../library/http.cookiejar.rst:373 +#: ../../library/http.cookiejar.rst:375 msgid "" "*cookie* is a :class:`Cookie` instance. *request* is an object implementing " "the interface defined by the documentation for :meth:`CookieJar." "add_cookie_header`." msgstr "" -#: ../../library/http.cookiejar.rst:380 +#: ../../library/http.cookiejar.rst:382 msgid "" "Return ``False`` if cookies should not be returned, given cookie domain." msgstr "" -#: ../../library/http.cookiejar.rst:382 +#: ../../library/http.cookiejar.rst:384 msgid "" "This method is an optimization. It removes the need for checking every " "cookie with a particular domain (which might involve reading many files). " @@ -517,7 +522,7 @@ msgid "" "leaves all the work to :meth:`return_ok`." msgstr "" -#: ../../library/http.cookiejar.rst:387 +#: ../../library/http.cookiejar.rst:389 msgid "" "If :meth:`domain_return_ok` returns true for the cookie domain, :meth:" "`path_return_ok` is called for the cookie path. Otherwise, :meth:" @@ -527,7 +532,7 @@ msgid "" "`return_ok` is never called for that cookie path." msgstr "" -#: ../../library/http.cookiejar.rst:394 +#: ../../library/http.cookiejar.rst:396 msgid "" "Note that :meth:`domain_return_ok` is called for every *cookie* domain, not " "just for the *request* domain. For example, the function might be called " @@ -535,19 +540,19 @@ msgid "" "domain is ``\"www.example.com\"``. The same goes for :meth:`path_return_ok`." msgstr "" -#: ../../library/http.cookiejar.rst:399 +#: ../../library/http.cookiejar.rst:401 msgid "The *request* argument is as documented for :meth:`return_ok`." msgstr "" -#: ../../library/http.cookiejar.rst:404 +#: ../../library/http.cookiejar.rst:406 msgid "Return ``False`` if cookies should not be returned, given cookie path." msgstr "" -#: ../../library/http.cookiejar.rst:406 +#: ../../library/http.cookiejar.rst:408 msgid "See the documentation for :meth:`domain_return_ok`." msgstr "關於 :meth:`domain_return_ok` 請見文件。" -#: ../../library/http.cookiejar.rst:408 +#: ../../library/http.cookiejar.rst:410 msgid "" "In addition to implementing the methods above, implementations of the :class:" "`CookiePolicy` interface must also supply the following attributes, " @@ -555,21 +560,21 @@ msgid "" "may be assigned to." msgstr "" -#: ../../library/http.cookiejar.rst:416 +#: ../../library/http.cookiejar.rst:418 msgid "Implement Netscape protocol." msgstr "" -#: ../../library/http.cookiejar.rst:421 +#: ../../library/http.cookiejar.rst:423 msgid "Implement :rfc:`2965` protocol." msgstr "" -#: ../../library/http.cookiejar.rst:426 +#: ../../library/http.cookiejar.rst:428 msgid "" "Don't add :mailheader:`Cookie2` header to requests (the presence of this " "header indicates to the server that we understand :rfc:`2965` cookies)." msgstr "" -#: ../../library/http.cookiejar.rst:429 +#: ../../library/http.cookiejar.rst:431 msgid "" "The most useful way to define a :class:`CookiePolicy` class is by " "subclassing from :class:`DefaultCookiePolicy` and overriding some or all of " @@ -578,28 +583,28 @@ msgid "" "to be useful)." msgstr "" -#: ../../library/http.cookiejar.rst:438 +#: ../../library/http.cookiejar.rst:440 msgid "DefaultCookiePolicy Objects" msgstr "DefaultCookiePolicy 物件" -#: ../../library/http.cookiejar.rst:440 +#: ../../library/http.cookiejar.rst:442 msgid "Implements the standard rules for accepting and returning cookies." msgstr "" -#: ../../library/http.cookiejar.rst:442 +#: ../../library/http.cookiejar.rst:444 msgid "" "Both :rfc:`2965` and Netscape cookies are covered. RFC 2965 handling is " "switched off by default." msgstr "" -#: ../../library/http.cookiejar.rst:445 +#: ../../library/http.cookiejar.rst:447 msgid "" "The easiest way to provide your own policy is to override this class and " "call its methods in your overridden implementations before adding your own " "additional checks::" msgstr "" -#: ../../library/http.cookiejar.rst:458 +#: ../../library/http.cookiejar.rst:460 msgid "" "In addition to the features required to implement the :class:`CookiePolicy` " "interface, this class allows you to block and allow domains from setting and " @@ -608,7 +613,7 @@ msgid "" "cost of blocking some benign cookies)." msgstr "" -#: ../../library/http.cookiejar.rst:464 +#: ../../library/http.cookiejar.rst:466 msgid "" "A domain blocklist and allowlist is provided (both off by default). Only " "domains not in the blocklist and present in the allowlist (if the allowlist " @@ -619,7 +624,7 @@ msgid "" "off again by setting it to :const:`None`." msgstr "" -#: ../../library/http.cookiejar.rst:472 +#: ../../library/http.cookiejar.rst:474 msgid "" "Domains in block or allow lists that do not start with a dot must equal the " "cookie domain to be matched. For example, ``\"example.com\"`` matches a " @@ -632,46 +637,46 @@ msgid "" "192.168.1.2 is blocked, but 193.168.1.2 is not." msgstr "" -#: ../../library/http.cookiejar.rst:481 +#: ../../library/http.cookiejar.rst:483 msgid "" ":class:`DefaultCookiePolicy` implements the following additional methods:" msgstr "" -#: ../../library/http.cookiejar.rst:486 +#: ../../library/http.cookiejar.rst:488 msgid "Return the sequence of blocked domains (as a tuple)." msgstr "" -#: ../../library/http.cookiejar.rst:491 +#: ../../library/http.cookiejar.rst:493 msgid "Set the sequence of blocked domains." msgstr "" -#: ../../library/http.cookiejar.rst:496 +#: ../../library/http.cookiejar.rst:498 msgid "" "Return whether *domain* is on the blocklist for setting or receiving cookies." msgstr "" -#: ../../library/http.cookiejar.rst:501 +#: ../../library/http.cookiejar.rst:503 msgid "Return :const:`None`, or the sequence of allowed domains (as a tuple)." msgstr "" -#: ../../library/http.cookiejar.rst:506 +#: ../../library/http.cookiejar.rst:508 msgid "Set the sequence of allowed domains, or :const:`None`." msgstr "" -#: ../../library/http.cookiejar.rst:511 +#: ../../library/http.cookiejar.rst:513 msgid "" "Return whether *domain* is not on the allowlist for setting or receiving " "cookies." msgstr "" -#: ../../library/http.cookiejar.rst:514 +#: ../../library/http.cookiejar.rst:516 msgid "" ":class:`DefaultCookiePolicy` instances have the following attributes, which " "are all initialised from the constructor arguments of the same name, and " "which may all be assigned to." msgstr "" -#: ../../library/http.cookiejar.rst:521 +#: ../../library/http.cookiejar.rst:523 msgid "" "If true, request that the :class:`CookieJar` instance downgrade :rfc:`2109` " "cookies (ie. cookies received in a :mailheader:`Set-Cookie` header with a " @@ -682,22 +687,22 @@ msgid "" "by default." msgstr "" -#: ../../library/http.cookiejar.rst:529 +#: ../../library/http.cookiejar.rst:531 msgid "General strictness switches:" msgstr "" -#: ../../library/http.cookiejar.rst:533 +#: ../../library/http.cookiejar.rst:535 msgid "" "Don't allow sites to set two-component domains with country-code top-level " "domains like ``.co.uk``, ``.gov.uk``, ``.co.nz``.etc. This is far from " "perfect and isn't guaranteed to work!" msgstr "" -#: ../../library/http.cookiejar.rst:538 +#: ../../library/http.cookiejar.rst:540 msgid ":rfc:`2965` protocol strictness switches:" msgstr "" -#: ../../library/http.cookiejar.rst:542 +#: ../../library/http.cookiejar.rst:544 msgid "" "Follow :rfc:`2965` rules on unverifiable transactions (usually, an " "unverifiable transaction is one resulting from a redirect or a request for " @@ -705,46 +710,46 @@ msgid "" "blocked on the basis of verifiability" msgstr "" -#: ../../library/http.cookiejar.rst:548 +#: ../../library/http.cookiejar.rst:550 msgid "Netscape protocol strictness switches:" msgstr "" -#: ../../library/http.cookiejar.rst:552 +#: ../../library/http.cookiejar.rst:554 msgid "" "Apply :rfc:`2965` rules on unverifiable transactions even to Netscape " "cookies." msgstr "" -#: ../../library/http.cookiejar.rst:557 +#: ../../library/http.cookiejar.rst:559 msgid "" "Flags indicating how strict to be with domain-matching rules for Netscape " "cookies. See below for acceptable values." msgstr "" -#: ../../library/http.cookiejar.rst:563 +#: ../../library/http.cookiejar.rst:565 msgid "" "Ignore cookies in Set-Cookie: headers that have names starting with ``'$'``." msgstr "" -#: ../../library/http.cookiejar.rst:568 +#: ../../library/http.cookiejar.rst:570 msgid "Don't allow setting cookies whose path doesn't path-match request URI." msgstr "" -#: ../../library/http.cookiejar.rst:570 +#: ../../library/http.cookiejar.rst:572 msgid "" ":attr:`strict_ns_domain` is a collection of flags. Its value is constructed " "by or-ing together (for example, ``DomainStrictNoDots|" "DomainStrictNonDomain`` means both flags are set)." msgstr "" -#: ../../library/http.cookiejar.rst:577 +#: ../../library/http.cookiejar.rst:579 msgid "" "When setting cookies, the 'host prefix' must not contain a dot (eg. ``www." "foo.bar.com`` can't set a cookie for ``.bar.com``, because ``www.foo`` " "contains a dot)." msgstr "" -#: ../../library/http.cookiejar.rst:584 +#: ../../library/http.cookiejar.rst:586 msgid "" "Cookies that did not explicitly specify a ``domain`` cookie-attribute can " "only be returned to a domain equal to the domain that set the cookie (eg. " @@ -752,31 +757,31 @@ msgid "" "no ``domain`` cookie-attribute)." msgstr "" -#: ../../library/http.cookiejar.rst:592 +#: ../../library/http.cookiejar.rst:594 msgid "When setting cookies, require a full :rfc:`2965` domain-match." msgstr "" -#: ../../library/http.cookiejar.rst:594 +#: ../../library/http.cookiejar.rst:596 msgid "" "The following attributes are provided for convenience, and are the most " "useful combinations of the above flags:" msgstr "" -#: ../../library/http.cookiejar.rst:600 +#: ../../library/http.cookiejar.rst:602 msgid "" "Equivalent to 0 (ie. all of the above Netscape domain strictness flags " "switched off)." msgstr "" -#: ../../library/http.cookiejar.rst:606 +#: ../../library/http.cookiejar.rst:608 msgid "Equivalent to ``DomainStrictNoDots|DomainStrictNonDomain``." msgstr "等價於 ``DomainStrictNoDots|DomainStrictNonDomain``\\ 。" -#: ../../library/http.cookiejar.rst:610 +#: ../../library/http.cookiejar.rst:612 msgid "Cookie Objects" msgstr "Cookie 物件" -#: ../../library/http.cookiejar.rst:612 +#: ../../library/http.cookiejar.rst:614 msgid "" ":class:`Cookie` instances have Python attributes roughly corresponding to " "the standard cookie-attributes specified in the various cookie standards. " @@ -787,14 +792,14 @@ msgid "" "(Netscape) cookies." msgstr "" -#: ../../library/http.cookiejar.rst:620 +#: ../../library/http.cookiejar.rst:622 msgid "" "Assignment to these attributes should not be necessary other than in rare " "circumstances in a :class:`CookiePolicy` method. The class does not enforce " "internal consistency, so you should know what you're doing if you do that." msgstr "" -#: ../../library/http.cookiejar.rst:627 +#: ../../library/http.cookiejar.rst:629 msgid "" "Integer or :const:`None`. Netscape cookies have :attr:`version` 0. :rfc:" "`2965` and :rfc:`2109` cookies have a ``version`` cookie-attribute of 1. " @@ -802,51 +807,51 @@ msgid "" "Netscape cookies, in which case :attr:`version` is 0." msgstr "" -#: ../../library/http.cookiejar.rst:635 +#: ../../library/http.cookiejar.rst:637 msgid "Cookie name (a string)." msgstr "" -#: ../../library/http.cookiejar.rst:640 +#: ../../library/http.cookiejar.rst:642 msgid "Cookie value (a string), or :const:`None`." msgstr "" -#: ../../library/http.cookiejar.rst:645 +#: ../../library/http.cookiejar.rst:647 msgid "" "String representing a port or a set of ports (eg. '80', or '80,8080'), or :" "const:`None`." msgstr "" -#: ../../library/http.cookiejar.rst:651 +#: ../../library/http.cookiejar.rst:653 msgid "Cookie path (a string, eg. ``'/acme/rocket_launchers'``)." msgstr "" -#: ../../library/http.cookiejar.rst:656 +#: ../../library/http.cookiejar.rst:658 msgid "``True`` if cookie should only be returned over a secure connection." msgstr "" -#: ../../library/http.cookiejar.rst:661 +#: ../../library/http.cookiejar.rst:663 msgid "" "Integer expiry date in seconds since epoch, or :const:`None`. See also the :" "meth:`is_expired` method." msgstr "" -#: ../../library/http.cookiejar.rst:667 +#: ../../library/http.cookiejar.rst:669 msgid "``True`` if this is a session cookie." msgstr "" -#: ../../library/http.cookiejar.rst:672 +#: ../../library/http.cookiejar.rst:674 msgid "" "String comment from the server explaining the function of this cookie, or :" "const:`None`." msgstr "" -#: ../../library/http.cookiejar.rst:678 +#: ../../library/http.cookiejar.rst:680 msgid "" "URL linking to a comment from the server explaining the function of this " "cookie, or :const:`None`." msgstr "" -#: ../../library/http.cookiejar.rst:684 +#: ../../library/http.cookiejar.rst:686 msgid "" "``True`` if this cookie was received as an :rfc:`2109` cookie (ie. the " "cookie arrived in a :mailheader:`Set-Cookie` header, and the value of the " @@ -855,70 +860,70 @@ msgid "" "cookies, in which case :attr:`version` is 0." msgstr "" -#: ../../library/http.cookiejar.rst:693 +#: ../../library/http.cookiejar.rst:695 msgid "" "``True`` if a port or set of ports was explicitly specified by the server " "(in the :mailheader:`Set-Cookie` / :mailheader:`Set-Cookie2` header)." msgstr "" -#: ../../library/http.cookiejar.rst:699 +#: ../../library/http.cookiejar.rst:701 msgid "``True`` if a domain was explicitly specified by the server." msgstr "" -#: ../../library/http.cookiejar.rst:704 +#: ../../library/http.cookiejar.rst:706 msgid "" "``True`` if the domain explicitly specified by the server began with a dot " "(``'.'``)." msgstr "" -#: ../../library/http.cookiejar.rst:707 +#: ../../library/http.cookiejar.rst:709 msgid "" "Cookies may have additional non-standard cookie-attributes. These may be " "accessed using the following methods:" msgstr "" -#: ../../library/http.cookiejar.rst:713 +#: ../../library/http.cookiejar.rst:715 msgid "Return ``True`` if cookie has the named cookie-attribute." msgstr "" -#: ../../library/http.cookiejar.rst:718 +#: ../../library/http.cookiejar.rst:720 msgid "" "If cookie has the named cookie-attribute, return its value. Otherwise, " "return *default*." msgstr "" -#: ../../library/http.cookiejar.rst:724 +#: ../../library/http.cookiejar.rst:726 msgid "Set the value of the named cookie-attribute." msgstr "" -#: ../../library/http.cookiejar.rst:726 +#: ../../library/http.cookiejar.rst:728 msgid "The :class:`Cookie` class also defines the following method:" msgstr "" -#: ../../library/http.cookiejar.rst:731 +#: ../../library/http.cookiejar.rst:733 msgid "" "``True`` if cookie has passed the time at which the server requested it " "should expire. If *now* is given (in seconds since the epoch), return " "whether the cookie has expired at the specified time." msgstr "" -#: ../../library/http.cookiejar.rst:737 +#: ../../library/http.cookiejar.rst:739 msgid "Examples" msgstr "範例" -#: ../../library/http.cookiejar.rst:739 +#: ../../library/http.cookiejar.rst:741 msgid "" "The first example shows the most common usage of :mod:`http.cookiejar`::" msgstr "" -#: ../../library/http.cookiejar.rst:746 +#: ../../library/http.cookiejar.rst:748 msgid "" "This example illustrates how to open a URL using your Netscape, Mozilla, or " "Lynx cookies (assumes Unix/Netscape convention for location of the cookies " "file)::" msgstr "" -#: ../../library/http.cookiejar.rst:755 +#: ../../library/http.cookiejar.rst:757 msgid "" "The next example illustrates the use of :class:`DefaultCookiePolicy`. Turn " "on :rfc:`2965` cookies, be more strict about domains when setting and " diff --git a/library/http.server.po b/library/http.server.po index ce9bb0ad5f..c08ad8177e 100644 --- a/library/http.server.po +++ b/library/http.server.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-07-02 00:16+0000\n" +"POT-Creation-Date: 2022-10-09 00:22+0000\n" "PO-Revision-Date: 2018-05-23 16:03+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -470,8 +470,8 @@ msgstr "" #: ../../library/http.server.rst:391 msgid "" -"For example usage, see the implementation of the :func:`test` function " -"invocation in the :mod:`http.server` module." +"For example usage, see the implementation of the ``test`` function in :" +"source:`Lib/http/server.py`." msgstr "" #: ../../library/http.server.rst:394 diff --git a/library/os.po b/library/os.po index 638f3740d3..33c99d4852 100644 --- a/library/os.po +++ b/library/os.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-10-09 00:22+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-" @@ -291,29 +291,29 @@ msgstr "" #: ../../library/os.rst:2138 ../../library/os.rst:2160 #: ../../library/os.rst:2204 ../../library/os.rst:2215 #: ../../library/os.rst:2892 ../../library/os.rst:3046 -#: ../../library/os.rst:3278 ../../library/os.rst:3671 -#: ../../library/os.rst:3679 ../../library/os.rst:3686 -#: ../../library/os.rst:3693 ../../library/os.rst:3700 -#: ../../library/os.rst:3707 ../../library/os.rst:3714 -#: ../../library/os.rst:3721 ../../library/os.rst:3729 -#: ../../library/os.rst:3737 ../../library/os.rst:3744 -#: ../../library/os.rst:3751 ../../library/os.rst:3760 -#: ../../library/os.rst:3768 ../../library/os.rst:3776 -#: ../../library/os.rst:3783 ../../library/os.rst:3790 -#: ../../library/os.rst:3811 ../../library/os.rst:3866 -#: ../../library/os.rst:3873 ../../library/os.rst:3894 -#: ../../library/os.rst:4010 ../../library/os.rst:4058 -#: ../../library/os.rst:4290 ../../library/os.rst:4311 -#: ../../library/os.rst:4322 ../../library/os.rst:4342 -#: ../../library/os.rst:4357 ../../library/os.rst:4412 -#: ../../library/os.rst:4426 ../../library/os.rst:4464 -#: ../../library/os.rst:4480 ../../library/os.rst:4494 -#: ../../library/os.rst:4505 ../../library/os.rst:4517 -#: ../../library/os.rst:4524 ../../library/os.rst:4533 -#: ../../library/os.rst:4542 ../../library/os.rst:4551 -#: ../../library/os.rst:4560 ../../library/os.rst:4706 -#: ../../library/os.rst:4715 ../../library/os.rst:4736 -#: ../../library/os.rst:4746 ../../library/os.rst:4755 +#: ../../library/os.rst:3279 ../../library/os.rst:3672 +#: ../../library/os.rst:3680 ../../library/os.rst:3687 +#: ../../library/os.rst:3694 ../../library/os.rst:3701 +#: ../../library/os.rst:3708 ../../library/os.rst:3715 +#: ../../library/os.rst:3722 ../../library/os.rst:3730 +#: ../../library/os.rst:3738 ../../library/os.rst:3745 +#: ../../library/os.rst:3752 ../../library/os.rst:3761 +#: ../../library/os.rst:3769 ../../library/os.rst:3777 +#: ../../library/os.rst:3784 ../../library/os.rst:3791 +#: ../../library/os.rst:3812 ../../library/os.rst:3867 +#: ../../library/os.rst:3874 ../../library/os.rst:3895 +#: ../../library/os.rst:4011 ../../library/os.rst:4059 +#: ../../library/os.rst:4291 ../../library/os.rst:4312 +#: ../../library/os.rst:4323 ../../library/os.rst:4343 +#: ../../library/os.rst:4358 ../../library/os.rst:4413 +#: ../../library/os.rst:4427 ../../library/os.rst:4465 +#: ../../library/os.rst:4481 ../../library/os.rst:4495 +#: ../../library/os.rst:4506 ../../library/os.rst:4518 +#: ../../library/os.rst:4525 ../../library/os.rst:4534 +#: ../../library/os.rst:4543 ../../library/os.rst:4552 +#: ../../library/os.rst:4561 ../../library/os.rst:4707 +#: ../../library/os.rst:4716 ../../library/os.rst:4737 +#: ../../library/os.rst:4747 ../../library/os.rst:4756 msgid ":ref:`Availability `: Unix." msgstr ":ref:`適用 `:Unix。" @@ -548,9 +548,9 @@ msgstr "" #: ../../library/os.rst:952 ../../library/os.rst:1154 ../../library/os.rst:1576 #: ../../library/os.rst:1965 ../../library/os.rst:2238 #: ../../library/os.rst:3026 ../../library/os.rst:3060 -#: ../../library/os.rst:3638 ../../library/os.rst:4143 -#: ../../library/os.rst:4154 ../../library/os.rst:4248 -#: ../../library/os.rst:4272 +#: ../../library/os.rst:3639 ../../library/os.rst:4144 +#: ../../library/os.rst:4155 ../../library/os.rst:4249 +#: ../../library/os.rst:4273 msgid ":ref:`Availability `: Unix, Windows." msgstr ":ref:`適用 `:Unix、Windows。" @@ -799,7 +799,7 @@ msgstr "" msgid ":ref:`Availability `: recent flavors of Unix." msgstr ":ref:`適用 `:近期的 Unix。" -#: ../../library/os.rst:710 ../../library/os.rst:4273 +#: ../../library/os.rst:710 ../../library/os.rst:4274 msgid "" "Return type changed from a tuple to a tuple-like object with named " "attributes." @@ -1181,7 +1181,7 @@ msgid "The *dir_fd* argument." msgstr "*dir_fd* 引數。" #: ../../library/os.rst:1053 ../../library/os.rst:1372 -#: ../../library/os.rst:1531 ../../library/os.rst:4394 +#: ../../library/os.rst:1531 ../../library/os.rst:4395 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 :" @@ -1200,9 +1200,9 @@ msgstr "" #: ../../library/os.rst:2381 ../../library/os.rst:2654 #: ../../library/os.rst:2905 ../../library/os.rst:3066 #: ../../library/os.rst:3082 ../../library/os.rst:3122 -#: ../../library/os.rst:3220 ../../library/os.rst:3281 -#: ../../library/os.rst:3464 ../../library/os.rst:3643 -#: ../../library/os.rst:4131 +#: ../../library/os.rst:3221 ../../library/os.rst:3282 +#: ../../library/os.rst:3465 ../../library/os.rst:3644 +#: ../../library/os.rst:4132 msgid "Accepts a :term:`path-like object`." msgstr "" @@ -1263,7 +1263,7 @@ msgid "" msgstr "" #: ../../library/os.rst:1142 ../../library/os.rst:1168 -#: ../../library/os.rst:3828 +#: ../../library/os.rst:3829 msgid ":ref:`Availability `: some flavors of Unix." msgstr ":ref:`適用 `:部分的 Unix。" @@ -1724,8 +1724,8 @@ msgid "Get the \"inheritable\" flag of the specified handle (a boolean)." msgstr "" #: ../../library/os.rst:1625 ../../library/os.rst:1631 -#: ../../library/os.rst:3570 ../../library/os.rst:4166 -#: ../../library/os.rst:4212 +#: ../../library/os.rst:3571 ../../library/os.rst:4167 +#: ../../library/os.rst:4213 msgid ":ref:`Availability `: Windows." msgstr ":ref:`適用 `:Windows。" @@ -2875,9 +2875,9 @@ msgid "" "``follow_symlinks=False``, or use :func:`lstat`." msgstr "" -#: ../../library/os.rst:2619 ../../library/os.rst:3443 -#: ../../library/os.rst:3459 ../../library/os.rst:3475 -#: ../../library/os.rst:3495 +#: ../../library/os.rst:2619 ../../library/os.rst:3444 +#: ../../library/os.rst:3460 ../../library/os.rst:3476 +#: ../../library/os.rst:3496 msgid "" "This function can support :ref:`specifying a file descriptor ` and :" "ref:`not following symlinks `." @@ -2897,7 +2897,7 @@ msgid "" "junction points, which will raise the usual exceptions." msgstr "" -#: ../../library/os.rst:2635 ../../library/os.rst:3363 +#: ../../library/os.rst:2635 ../../library/os.rst:3364 msgid "Example::" msgstr "" "範例:\n" @@ -3435,17 +3435,18 @@ msgstr "" #: ../../library/os.rst:3137 msgid "" "*dirpath* is a string, the path to the directory. *dirnames* is a list of " -"the names of the subdirectories in *dirpath* (excluding ``'.'`` and " -"``'..'``). *filenames* is a list of the names of the non-directory files in " -"*dirpath*. Note that the names in the lists contain no path components. To " -"get a full path (which begins with *top*) to a file or directory in " -"*dirpath*, do ``os.path.join(dirpath, name)``. Whether or not the lists are " -"sorted depends on the file system. If a file is removed from or added to " -"the *dirpath* directory during generating the lists, whether a name for that " -"file be included is unspecified." +"the names of the subdirectories in *dirpath* (including symlinks to " +"directories, and excluding ``'.'`` and ``'..'``). *filenames* is a list of " +"the names of the non-directory files in *dirpath*. Note that the names in " +"the lists contain no path components. To get a full path (which begins with " +"*top*) to a file or directory in *dirpath*, do ``os.path.join(dirpath, " +"name)``. Whether or not the lists are sorted depends on the file system. " +"If a file is removed from or added to the *dirpath* directory during " +"generating the lists, whether a name for that file be included is " +"unspecified." msgstr "" -#: ../../library/os.rst:3147 +#: ../../library/os.rst:3148 msgid "" "If optional argument *topdown* is ``True`` or not specified, the triple for " "a directory is generated before the triples for any of its subdirectories " @@ -3456,7 +3457,7 @@ msgid "" "its subdirectories are generated." msgstr "" -#: ../../library/os.rst:3155 +#: ../../library/os.rst:3156 msgid "" "When *topdown* is ``True``, the caller can modify the *dirnames* list in-" "place (perhaps using :keyword:`del` or slice assignment), and :func:`walk` " @@ -3469,7 +3470,7 @@ msgid "" "itself is generated." msgstr "" -#: ../../library/os.rst:3164 +#: ../../library/os.rst:3165 msgid "" "By default, errors from the :func:`scandir` call are ignored. If optional " "argument *onerror* is specified, it should be a function; it will be called " @@ -3479,66 +3480,66 @@ msgid "" "object." msgstr "" -#: ../../library/os.rst:3170 +#: ../../library/os.rst:3171 msgid "" "By default, :func:`walk` will not walk down into symbolic links that resolve " "to directories. Set *followlinks* to ``True`` to visit directories pointed " "to by symlinks, on systems that support them." msgstr "" -#: ../../library/os.rst:3176 +#: ../../library/os.rst:3177 msgid "" "Be aware that setting *followlinks* to ``True`` can lead to infinite " "recursion if a link points to a parent directory of itself. :func:`walk` " "does not keep track of the directories it visited already." msgstr "" -#: ../../library/os.rst:3182 +#: ../../library/os.rst:3183 msgid "" "If you pass a relative pathname, don't change the current working directory " "between resumptions of :func:`walk`. :func:`walk` never changes the current " "directory, and assumes that its caller doesn't either." msgstr "" -#: ../../library/os.rst:3186 ../../library/os.rst:3247 +#: ../../library/os.rst:3187 ../../library/os.rst:3248 msgid "" "This example displays the number of bytes taken by non-directory files in " "each directory under the starting directory, except that it doesn't look " "under any CVS subdirectory::" msgstr "" -#: ../../library/os.rst:3199 +#: ../../library/os.rst:3200 msgid "" "In the next example (simple implementation of :func:`shutil.rmtree`), " "walking the tree bottom-up is essential, :func:`rmdir` doesn't allow " "deleting a directory before the directory is empty::" msgstr "" -#: ../../library/os.rst:3214 +#: ../../library/os.rst:3215 msgid "" "Raises an :ref:`auditing event ` ``os.walk`` with arguments " "``top``, ``topdown``, ``onerror``, ``followlinks``." msgstr "" -#: ../../library/os.rst:3216 +#: ../../library/os.rst:3217 msgid "" "This function now calls :func:`os.scandir` instead of :func:`os.listdir`, " "making it faster by reducing the number of calls to :func:`os.stat`." msgstr "" -#: ../../library/os.rst:3230 +#: ../../library/os.rst:3231 msgid "" "This behaves exactly like :func:`walk`, except that it yields a 4-tuple " "``(dirpath, dirnames, filenames, dirfd)``, and it supports ``dir_fd``." msgstr "" -#: ../../library/os.rst:3233 +#: ../../library/os.rst:3234 msgid "" "*dirpath*, *dirnames* and *filenames* are identical to :func:`walk` output, " "and *dirfd* is a file descriptor referring to the directory *dirpath*." msgstr "" -#: ../../library/os.rst:3236 +#: ../../library/os.rst:3237 msgid "" "This function always supports :ref:`paths relative to directory descriptors " "` and :ref:`not following symlinks `. Note however " @@ -3546,30 +3547,30 @@ msgid "" "*follow_symlinks* is ``False``." msgstr "" -#: ../../library/os.rst:3243 +#: ../../library/os.rst:3244 msgid "" "Since :func:`fwalk` yields file descriptors, those are only valid until the " "next iteration step, so you should duplicate them (e.g. with :func:`dup`) if " "you want to keep them longer." msgstr "" -#: ../../library/os.rst:3260 +#: ../../library/os.rst:3261 msgid "" "In the next example, walking the tree bottom-up is essential: :func:`rmdir` " "doesn't allow deleting a directory before the directory is empty::" msgstr "" -#: ../../library/os.rst:3275 +#: ../../library/os.rst:3276 msgid "" "Raises an :ref:`auditing event ` ``os.fwalk`` with arguments " "``top``, ``topdown``, ``onerror``, ``follow_symlinks``, ``dir_fd``." msgstr "" -#: ../../library/os.rst:3284 +#: ../../library/os.rst:3285 msgid "Added support for :class:`bytes` paths." msgstr "" -#: ../../library/os.rst:3290 +#: ../../library/os.rst:3291 msgid "" "Create an anonymous file and return a file descriptor that refers to it. " "*flags* must be one of the ``os.MFD_*`` constants available on the system " @@ -3577,7 +3578,7 @@ msgid "" "descriptor is :ref:`non-inheritable `." msgstr "" -#: ../../library/os.rst:3295 +#: ../../library/os.rst:3296 msgid "" "The name supplied in *name* is used as a filename and will be displayed as " "the target of the corresponding symbolic link in the directory ``/proc/self/" @@ -3587,23 +3588,23 @@ msgid "" "side effects." msgstr "" -#: ../../library/os.rst:3303 +#: ../../library/os.rst:3304 msgid "" ":ref:`Availability `: Linux 3.17 or newer with glibc 2.27 or " "newer." msgstr "" -#: ../../library/os.rst:3325 +#: ../../library/os.rst:3326 msgid "These flags can be passed to :func:`memfd_create`." msgstr "" -#: ../../library/os.rst:3329 +#: ../../library/os.rst:3330 msgid "" ":ref:`Availability `: Linux 3.17 or newer with glibc 2.27 or " "newer. The ``MFD_HUGE*`` flags are only available since Linux 4.14." msgstr "" -#: ../../library/os.rst:3335 +#: ../../library/os.rst:3336 msgid "" "Create and return an event file descriptor. The file descriptors supports " "raw :func:`read` and :func:`write` with a buffer size of 8, :func:`~select." @@ -3612,7 +3613,7 @@ msgid "" "ref:`non-inheritable `." msgstr "" -#: ../../library/os.rst:3341 +#: ../../library/os.rst:3342 msgid "" "*initval* is the initial value of the event counter. The initial value must " "be an 32 bit unsigned integer. Please note that the initial value is limited " @@ -3620,91 +3621,91 @@ msgid "" "integer with a maximum value of 2\\ :sup:`64`\\ -\\ 2." msgstr "" -#: ../../library/os.rst:3346 +#: ../../library/os.rst:3347 msgid "" "*flags* can be constructed from :const:`EFD_CLOEXEC`, :const:`EFD_NONBLOCK`, " "and :const:`EFD_SEMAPHORE`." msgstr "" -#: ../../library/os.rst:3349 +#: ../../library/os.rst:3350 msgid "" "If :const:`EFD_SEMAPHORE` is specified and the event counter is non-zero, :" "func:`eventfd_read` returns 1 and decrements the counter by one." msgstr "" -#: ../../library/os.rst:3352 +#: ../../library/os.rst:3353 msgid "" "If :const:`EFD_SEMAPHORE` is not specified and the event counter is non-" "zero, :func:`eventfd_read` returns the current event counter value and " "resets the counter to zero." msgstr "" -#: ../../library/os.rst:3356 +#: ../../library/os.rst:3357 msgid "" "If the event counter is zero and :const:`EFD_NONBLOCK` is not specified, :" "func:`eventfd_read` blocks." msgstr "" -#: ../../library/os.rst:3359 +#: ../../library/os.rst:3360 msgid "" ":func:`eventfd_write` increments the event counter. Write blocks if the " "write operation would increment the counter to a value larger than 2\\ :sup:" "`64`\\ -\\ 2." msgstr "" -#: ../../library/os.rst:3381 +#: ../../library/os.rst:3382 msgid "" ":ref:`Availability `: Linux 2.6.27 or newer with glibc 2.8 or " "newer." msgstr "" -#: ../../library/os.rst:3386 +#: ../../library/os.rst:3387 msgid "" "Read value from an :func:`eventfd` file descriptor and return a 64 bit " "unsigned int. The function does not verify that *fd* is an :func:`eventfd`." msgstr "" -#: ../../library/os.rst:3390 ../../library/os.rst:3399 -#: ../../library/os.rst:3407 ../../library/os.rst:3416 +#: ../../library/os.rst:3391 ../../library/os.rst:3400 +#: ../../library/os.rst:3408 ../../library/os.rst:3417 msgid ":ref:`Availability `: See :func:`eventfd`" msgstr ":ref:`適用 `:請見 :func:`eventfd`" -#: ../../library/os.rst:3395 +#: ../../library/os.rst:3396 msgid "" "Add value to an :func:`eventfd` file descriptor. *value* must be a 64 bit " "unsigned int. The function does not verify that *fd* is an :func:`eventfd`." msgstr "" -#: ../../library/os.rst:3404 +#: ../../library/os.rst:3405 msgid "Set close-on-exec flag for new :func:`eventfd` file descriptor." msgstr "" -#: ../../library/os.rst:3412 +#: ../../library/os.rst:3413 msgid "" "Set :const:`O_NONBLOCK` status flag for new :func:`eventfd` file descriptor." msgstr "" -#: ../../library/os.rst:3421 +#: ../../library/os.rst:3422 msgid "" "Provide semaphore-like semantics for reads from a :func:`eventfd` file " "descriptor. On read the internal counter is decremented by one." msgstr "" -#: ../../library/os.rst:3425 +#: ../../library/os.rst:3426 msgid "" ":ref:`Availability `: Linux 2.6.30 or newer with glibc 2.8 or " "newer." msgstr "" -#: ../../library/os.rst:3430 +#: ../../library/os.rst:3431 msgid "Linux extended attributes" msgstr "" -#: ../../library/os.rst:3434 +#: ../../library/os.rst:3435 msgid "These functions are all available on Linux only." msgstr "" -#: ../../library/os.rst:3438 +#: ../../library/os.rst:3439 msgid "" "Return the value of the extended filesystem attribute *attribute* for " "*path*. *attribute* can be bytes or str (directly or indirectly through the :" @@ -3712,18 +3713,18 @@ msgid "" "encoding." msgstr "" -#: ../../library/os.rst:3446 +#: ../../library/os.rst:3447 msgid "" "Raises an :ref:`auditing event ` ``os.getxattr`` with arguments " "``path``, ``attribute``." msgstr "" -#: ../../library/os.rst:3448 ../../library/os.rst:3480 -#: ../../library/os.rst:3505 +#: ../../library/os.rst:3449 ../../library/os.rst:3481 +#: ../../library/os.rst:3506 msgid "Accepts a :term:`path-like object` for *path* and *attribute*." msgstr "" -#: ../../library/os.rst:3454 +#: ../../library/os.rst:3455 msgid "" "Return a list of the extended filesystem attributes on *path*. The " "attributes in the list are represented as strings decoded with the " @@ -3731,13 +3732,13 @@ msgid "" "the current directory." msgstr "" -#: ../../library/os.rst:3462 +#: ../../library/os.rst:3463 msgid "" "Raises an :ref:`auditing event ` ``os.listxattr`` with argument " "``path``." msgstr "" -#: ../../library/os.rst:3470 +#: ../../library/os.rst:3471 msgid "" "Removes the extended filesystem attribute *attribute* from *path*. " "*attribute* should be bytes or str (directly or indirectly through the :" @@ -3745,13 +3746,13 @@ msgid "" "`filesystem encoding and error handler`." msgstr "" -#: ../../library/os.rst:3478 +#: ../../library/os.rst:3479 msgid "" "Raises an :ref:`auditing event ` ``os.removexattr`` with arguments " "``path``, ``attribute``." msgstr "" -#: ../../library/os.rst:3486 +#: ../../library/os.rst:3487 msgid "" "Set the extended filesystem attribute *attribute* on *path* to *value*. " "*attribute* must be a bytes or str with no embedded NULs (directly or " @@ -3763,45 +3764,45 @@ msgid "" "will not be created and ``EEXISTS`` will be raised." msgstr "" -#: ../../library/os.rst:3500 +#: ../../library/os.rst:3501 msgid "" "A bug in Linux kernel versions less than 2.6.39 caused the flags argument to " "be ignored on some filesystems." msgstr "" -#: ../../library/os.rst:3503 +#: ../../library/os.rst:3504 msgid "" "Raises an :ref:`auditing event ` ``os.setxattr`` with arguments " "``path``, ``attribute``, ``value``, ``flags``." msgstr "" -#: ../../library/os.rst:3511 +#: ../../library/os.rst:3512 msgid "" "The maximum size the value of an extended attribute can be. Currently, this " "is 64 KiB on Linux." msgstr "" -#: ../../library/os.rst:3517 +#: ../../library/os.rst:3518 msgid "" "This is a possible value for the flags argument in :func:`setxattr`. It " "indicates the operation must create an attribute." msgstr "" -#: ../../library/os.rst:3523 +#: ../../library/os.rst:3524 msgid "" "This is a possible value for the flags argument in :func:`setxattr`. It " "indicates the operation must replace an existing attribute." msgstr "" -#: ../../library/os.rst:3530 +#: ../../library/os.rst:3531 msgid "Process Management" msgstr "" -#: ../../library/os.rst:3532 +#: ../../library/os.rst:3533 msgid "These functions may be used to create and manage processes." msgstr "" -#: ../../library/os.rst:3534 +#: ../../library/os.rst:3535 msgid "" "The various :func:`exec\\* ` functions take a list of arguments for " "the new program loaded into the process. In each case, the first of these " @@ -3812,7 +3813,7 @@ msgid "" "standard output; ``foo`` will seem to be ignored." msgstr "" -#: ../../library/os.rst:3545 +#: ../../library/os.rst:3546 msgid "" "Generate a :const:`SIGABRT` signal to the current process. On Unix, the " "default behavior is to produce a core dump; on Windows, the process " @@ -3821,37 +3822,37 @@ msgid "" "`SIGABRT` with :func:`signal.signal`." msgstr "" -#: ../../library/os.rst:3554 +#: ../../library/os.rst:3555 msgid "Add a path to the DLL search path." msgstr "" -#: ../../library/os.rst:3556 +#: ../../library/os.rst:3557 msgid "" "This search path is used when resolving dependencies for imported extension " "modules (the module itself is resolved through :data:`sys.path`), and also " "by :mod:`ctypes`." msgstr "" -#: ../../library/os.rst:3560 +#: ../../library/os.rst:3561 msgid "" "Remove the directory by calling **close()** on the returned object or using " "it in a :keyword:`with` statement." msgstr "" -#: ../../library/os.rst:3563 +#: ../../library/os.rst:3564 msgid "" "See the `Microsoft documentation `_ for more information about how " "DLLs are loaded." msgstr "" -#: ../../library/os.rst:3567 +#: ../../library/os.rst:3568 msgid "" "Raises an :ref:`auditing event ` ``os.add_dll_directory`` with " "argument ``path``." msgstr "" -#: ../../library/os.rst:3571 +#: ../../library/os.rst:3572 msgid "" "Previous versions of CPython would resolve DLLs using the default behavior " "for the current process. This led to inconsistencies, such as only sometimes " @@ -3859,14 +3860,14 @@ msgid "" "such as ``AddDllDirectory`` having no effect." msgstr "" -#: ../../library/os.rst:3578 +#: ../../library/os.rst:3579 msgid "" "In 3.8, the two primary ways DLLs are loaded now explicitly override the " "process-wide behavior to ensure consistency. See the :ref:`porting notes " "` for information on updating libraries." msgstr "" -#: ../../library/os.rst:3593 +#: ../../library/os.rst:3594 msgid "" "These functions all execute a new program, replacing the current process; " "they do not return. On Unix, the new executable is loaded into the current " @@ -3874,7 +3875,7 @@ msgid "" "reported as :exc:`OSError` exceptions." msgstr "" -#: ../../library/os.rst:3598 +#: ../../library/os.rst:3599 msgid "" "The current process is replaced immediately. Open file objects and " "descriptors are not flushed, so if there may be data buffered on these open " @@ -3882,7 +3883,7 @@ msgid "" "fsync` before calling an :func:`exec\\* ` function." msgstr "" -#: ../../library/os.rst:3604 +#: ../../library/os.rst:3605 msgid "" "The \"l\" and \"v\" variants of the :func:`exec\\* ` functions differ " "in how command-line arguments are passed. The \"l\" variants are perhaps " @@ -3895,7 +3896,7 @@ msgid "" "enforced." msgstr "" -#: ../../library/os.rst:3613 +#: ../../library/os.rst:3614 msgid "" "The variants which include a \"p\" near the end (:func:`execlp`, :func:" "`execlpe`, :func:`execvp`, and :func:`execvpe`) will use the :envvar:`PATH` " @@ -3908,7 +3909,7 @@ msgid "" "absolute or relative path." msgstr "" -#: ../../library/os.rst:3623 +#: ../../library/os.rst:3624 msgid "" "For :func:`execle`, :func:`execlpe`, :func:`execve`, and :func:`execvpe` " "(note that these all end in \"e\"), the *env* parameter must be a mapping " @@ -3918,7 +3919,7 @@ msgid "" "process to inherit the environment of the current process." msgstr "" -#: ../../library/os.rst:3630 +#: ../../library/os.rst:3631 msgid "" "For :func:`execve` on some platforms, *path* may also be specified as an " "open file descriptor. This functionality may not be supported on your " @@ -3927,31 +3928,31 @@ msgid "" "`NotImplementedError`." msgstr "" -#: ../../library/os.rst:3635 +#: ../../library/os.rst:3636 msgid "" "Raises an :ref:`auditing event ` ``os.exec`` with arguments " "``path``, ``args``, ``env``." msgstr "" -#: ../../library/os.rst:3639 +#: ../../library/os.rst:3640 msgid "" "Added support for specifying *path* as an open file descriptor for :func:" "`execve`." msgstr "" -#: ../../library/os.rst:3648 +#: ../../library/os.rst:3649 msgid "" "Exit the process with status *n*, without calling cleanup handlers, flushing " "stdio buffers, etc." msgstr "" -#: ../../library/os.rst:3653 +#: ../../library/os.rst:3654 msgid "" "The standard way to exit is ``sys.exit(n)``. :func:`_exit` should normally " "only be used in the child process after a :func:`fork`." msgstr "" -#: ../../library/os.rst:3656 +#: ../../library/os.rst:3657 msgid "" "The following exit codes are defined and can be used with :func:`_exit`, " "although they are not required. These are typically used for system " @@ -3959,123 +3960,123 @@ msgid "" "delivery program." msgstr "" -#: ../../library/os.rst:3662 +#: ../../library/os.rst:3663 msgid "" "Some of these may not be available on all Unix platforms, since there is " "some variation. These constants are defined where they are defined by the " "underlying platform." msgstr "" -#: ../../library/os.rst:3669 +#: ../../library/os.rst:3670 msgid "Exit code that means no error occurred." msgstr "" -#: ../../library/os.rst:3676 +#: ../../library/os.rst:3677 msgid "" "Exit code that means the command was used incorrectly, such as when the " "wrong number of arguments are given." msgstr "" -#: ../../library/os.rst:3684 +#: ../../library/os.rst:3685 msgid "Exit code that means the input data was incorrect." msgstr "" -#: ../../library/os.rst:3691 +#: ../../library/os.rst:3692 msgid "Exit code that means an input file did not exist or was not readable." msgstr "" -#: ../../library/os.rst:3698 +#: ../../library/os.rst:3699 msgid "Exit code that means a specified user did not exist." msgstr "" -#: ../../library/os.rst:3705 +#: ../../library/os.rst:3706 msgid "Exit code that means a specified host did not exist." msgstr "" -#: ../../library/os.rst:3712 +#: ../../library/os.rst:3713 msgid "Exit code that means that a required service is unavailable." msgstr "" -#: ../../library/os.rst:3719 +#: ../../library/os.rst:3720 msgid "Exit code that means an internal software error was detected." msgstr "" -#: ../../library/os.rst:3726 +#: ../../library/os.rst:3727 msgid "" "Exit code that means an operating system error was detected, such as the " "inability to fork or create a pipe." msgstr "" -#: ../../library/os.rst:3734 +#: ../../library/os.rst:3735 msgid "" "Exit code that means some system file did not exist, could not be opened, or " "had some other kind of error." msgstr "" -#: ../../library/os.rst:3742 +#: ../../library/os.rst:3743 msgid "Exit code that means a user specified output file could not be created." msgstr "" -#: ../../library/os.rst:3749 +#: ../../library/os.rst:3750 msgid "" "Exit code that means that an error occurred while doing I/O on some file." msgstr "" -#: ../../library/os.rst:3756 +#: ../../library/os.rst:3757 msgid "" "Exit code that means a temporary failure occurred. This indicates something " "that may not really be an error, such as a network connection that couldn't " "be made during a retryable operation." msgstr "" -#: ../../library/os.rst:3765 +#: ../../library/os.rst:3766 msgid "" "Exit code that means that a protocol exchange was illegal, invalid, or not " "understood." msgstr "" -#: ../../library/os.rst:3773 +#: ../../library/os.rst:3774 msgid "" "Exit code that means that there were insufficient permissions to perform the " "operation (but not intended for file system problems)." msgstr "" -#: ../../library/os.rst:3781 +#: ../../library/os.rst:3782 msgid "Exit code that means that some kind of configuration error occurred." msgstr "" -#: ../../library/os.rst:3788 +#: ../../library/os.rst:3789 msgid "Exit code that means something like \"an entry was not found\"." msgstr "" -#: ../../library/os.rst:3795 +#: ../../library/os.rst:3796 msgid "" "Fork a child process. Return ``0`` in the child and the child's process id " "in the parent. If an error occurs :exc:`OSError` is raised." msgstr "" -#: ../../library/os.rst:3798 +#: ../../library/os.rst:3799 msgid "" "Note that some platforms including FreeBSD <= 6.3 and Cygwin have known " "issues when using ``fork()`` from a thread." msgstr "" -#: ../../library/os.rst:3801 +#: ../../library/os.rst:3802 msgid "" "Raises an :ref:`auditing event ` ``os.fork`` with no arguments." msgstr "" -#: ../../library/os.rst:3803 +#: ../../library/os.rst:3804 msgid "" "Calling ``fork()`` in a subinterpreter is no longer supported (:exc:" "`RuntimeError` is raised)." msgstr "" -#: ../../library/os.rst:3809 +#: ../../library/os.rst:3810 msgid "See :mod:`ssl` for applications that use the SSL module with fork()." msgstr "" -#: ../../library/os.rst:3816 +#: ../../library/os.rst:3817 msgid "" "Fork a child process, using a new pseudo-terminal as the child's controlling " "terminal. Return a pair of ``(pid, fd)``, where *pid* is ``0`` in the child, " @@ -4084,24 +4085,24 @@ msgid "" "the :mod:`pty` module. If an error occurs :exc:`OSError` is raised." msgstr "" -#: ../../library/os.rst:3822 +#: ../../library/os.rst:3823 msgid "" "Raises an :ref:`auditing event ` ``os.forkpty`` with no arguments." msgstr "" -#: ../../library/os.rst:3824 +#: ../../library/os.rst:3825 msgid "" "Calling ``forkpty()`` in a subinterpreter is no longer supported (:exc:" "`RuntimeError` is raised)." msgstr "" -#: ../../library/os.rst:3837 +#: ../../library/os.rst:3838 msgid "" "Send signal *sig* to the process *pid*. Constants for the specific signals " "available on the host platform are defined in the :mod:`signal` module." msgstr "" -#: ../../library/os.rst:3840 +#: ../../library/os.rst:3841 msgid "" "Windows: The :data:`signal.CTRL_C_EVENT` and :data:`signal.CTRL_BREAK_EVENT` " "signals are special signals which can only be sent to console processes " @@ -4111,36 +4112,36 @@ msgid "" "version of :func:`kill` additionally takes process handles to be killed." msgstr "" -#: ../../library/os.rst:3848 +#: ../../library/os.rst:3849 msgid "See also :func:`signal.pthread_kill`." msgstr "另請參閱 :func:`signal.pthread_kill`\\ 。" -#: ../../library/os.rst:3850 +#: ../../library/os.rst:3851 msgid "" "Raises an :ref:`auditing event ` ``os.kill`` with arguments " "``pid``, ``sig``." msgstr "" -#: ../../library/os.rst:3852 +#: ../../library/os.rst:3853 msgid "Windows support." msgstr "" -#: ../../library/os.rst:3862 +#: ../../library/os.rst:3863 msgid "Send the signal *sig* to the process group *pgid*." msgstr "" -#: ../../library/os.rst:3864 +#: ../../library/os.rst:3865 msgid "" "Raises an :ref:`auditing event ` ``os.killpg`` with arguments " "``pgid``, ``sig``." msgstr "" -#: ../../library/os.rst:3871 +#: ../../library/os.rst:3872 msgid "" "Add *increment* to the process's \"niceness\". Return the new niceness." msgstr "" -#: ../../library/os.rst:3878 +#: ../../library/os.rst:3879 msgid "" "Return a file descriptor referring to the process *pid*. This descriptor " "can be used to perform process management without races and signals. The " @@ -4148,21 +4149,21 @@ msgid "" "currently defined." msgstr "" -#: ../../library/os.rst:3883 +#: ../../library/os.rst:3884 msgid "See the :manpage:`pidfd_open(2)` man page for more details." msgstr "更多細節請見 :manpage:`pidfd_open(2)` 手冊頁。" -#: ../../library/os.rst:3885 +#: ../../library/os.rst:3886 msgid ":ref:`Availability `: Linux 5.3+" msgstr ":ref:`適用 `:Linux 5.3+" -#: ../../library/os.rst:3891 +#: ../../library/os.rst:3892 msgid "" "Lock program segments into memory. The value of *op* (defined in ````) determines which segments are locked." msgstr "" -#: ../../library/os.rst:3899 +#: ../../library/os.rst:3900 msgid "" "Open a pipe to or from command *cmd*. The return value is an open file " "object connected to the pipe, which can be read or written depending on " @@ -4172,7 +4173,7 @@ msgid "" "bytes." msgstr "" -#: ../../library/os.rst:3906 +#: ../../library/os.rst:3907 msgid "" "The ``close`` method returns :const:`None` if the subprocess exited " "successfully, or the subprocess's return code if there was an error. On " @@ -4184,43 +4185,43 @@ msgid "" "contains the signed integer return code from the child process." msgstr "" -#: ../../library/os.rst:3916 +#: ../../library/os.rst:3917 msgid "" "On Unix, :func:`waitstatus_to_exitcode` can be used to convert the ``close`` " "method result (exit status) into an exit code if it is not ``None``. On " "Windows, the ``close`` method result is directly the exit code (or ``None``)." msgstr "" -#: ../../library/os.rst:3921 +#: ../../library/os.rst:3922 msgid "" "This is implemented using :class:`subprocess.Popen`; see that class's " "documentation for more powerful ways to manage and communicate with " "subprocesses." msgstr "" -#: ../../library/os.rst:3930 +#: ../../library/os.rst:3931 msgid "Wraps the :c:func:`posix_spawn` C library API for use from Python." msgstr "" -#: ../../library/os.rst:3932 +#: ../../library/os.rst:3933 msgid "" "Most users should use :func:`subprocess.run` instead of :func:`posix_spawn`." msgstr "" -#: ../../library/os.rst:3934 +#: ../../library/os.rst:3935 msgid "" "The positional-only arguments *path*, *args*, and *env* are similar to :func:" "`execve`." msgstr "" -#: ../../library/os.rst:3937 +#: ../../library/os.rst:3938 msgid "" "The *path* parameter is the path to the executable file. The *path* should " "contain a directory. Use :func:`posix_spawnp` to pass an executable file " "without directory." msgstr "" -#: ../../library/os.rst:3941 +#: ../../library/os.rst:3942 msgid "" "The *file_actions* argument may be a sequence of tuples describing actions " "to take on specific file descriptors in the child process between the C " @@ -4229,31 +4230,31 @@ msgid "" "describing the remaining tuple elements:" msgstr "" -#: ../../library/os.rst:3949 +#: ../../library/os.rst:3950 msgid "(``os.POSIX_SPAWN_OPEN``, *fd*, *path*, *flags*, *mode*)" msgstr "(``os.POSIX_SPAWN_OPEN``, *fd*, *path*, *flags*, *mode*)" -#: ../../library/os.rst:3951 +#: ../../library/os.rst:3952 msgid "Performs ``os.dup2(os.open(path, flags, mode), fd)``." msgstr "" -#: ../../library/os.rst:3955 +#: ../../library/os.rst:3956 msgid "(``os.POSIX_SPAWN_CLOSE``, *fd*)" msgstr "(``os.POSIX_SPAWN_CLOSE``, *fd*)" -#: ../../library/os.rst:3957 +#: ../../library/os.rst:3958 msgid "Performs ``os.close(fd)``." msgstr "" -#: ../../library/os.rst:3961 +#: ../../library/os.rst:3962 msgid "(``os.POSIX_SPAWN_DUP2``, *fd*, *new_fd*)" msgstr "(``os.POSIX_SPAWN_DUP2``, *fd*, *new_fd*)" -#: ../../library/os.rst:3963 +#: ../../library/os.rst:3964 msgid "Performs ``os.dup2(fd, new_fd)``." msgstr "" -#: ../../library/os.rst:3965 +#: ../../library/os.rst:3966 msgid "" "These tuples correspond to the C library :c:func:" "`posix_spawn_file_actions_addopen`, :c:func:" @@ -4262,7 +4263,7 @@ msgid "" "`posix_spawn` call itself." msgstr "" -#: ../../library/os.rst:3971 +#: ../../library/os.rst:3972 msgid "" "The *setpgroup* argument will set the process group of the child to the " "value specified. If the value specified is 0, the child's process group ID " @@ -4271,7 +4272,7 @@ msgid "" "corresponds to the C library :c:data:`POSIX_SPAWN_SETPGROUP` flag." msgstr "" -#: ../../library/os.rst:3977 +#: ../../library/os.rst:3978 msgid "" "If the *resetids* argument is ``True`` it will reset the effective UID and " "GID of the child to the real UID and GID of the parent process. If the " @@ -4282,7 +4283,7 @@ msgid "" "library :c:data:`POSIX_SPAWN_RESETIDS` flag." msgstr "" -#: ../../library/os.rst:3985 +#: ../../library/os.rst:3986 msgid "" "If the *setsid* argument is ``True``, it will create a new session ID for " "`posix_spawn`. *setsid* requires :c:data:`POSIX_SPAWN_SETSID` or :c:data:" @@ -4290,7 +4291,7 @@ msgid "" "raised." msgstr "" -#: ../../library/os.rst:3990 +#: ../../library/os.rst:3991 msgid "" "The *setsigmask* argument will set the signal mask to the signal set " "specified. If the parameter is not used, then the child inherits the " @@ -4298,14 +4299,14 @@ msgid "" "`POSIX_SPAWN_SETSIGMASK` flag." msgstr "" -#: ../../library/os.rst:3995 +#: ../../library/os.rst:3996 msgid "" "The *sigdef* argument will reset the disposition of all signals in the set " "specified. This argument corresponds to the C library :c:data:" "`POSIX_SPAWN_SETSIGDEF` flag." msgstr "" -#: ../../library/os.rst:3999 +#: ../../library/os.rst:4000 msgid "" "The *scheduler* argument must be a tuple containing the (optional) scheduler " "policy and an instance of :class:`sched_param` with the scheduler " @@ -4315,79 +4316,79 @@ msgid "" "`POSIX_SPAWN_SETSCHEDULER` flags." msgstr "" -#: ../../library/os.rst:4006 ../../library/os.rst:4022 +#: ../../library/os.rst:4007 ../../library/os.rst:4023 msgid "" "Raises an :ref:`auditing event ` ``os.posix_spawn`` with arguments " "``path``, ``argv``, ``env``." msgstr "" -#: ../../library/os.rst:4016 +#: ../../library/os.rst:4017 msgid "Wraps the :c:func:`posix_spawnp` C library API for use from Python." msgstr "" -#: ../../library/os.rst:4018 +#: ../../library/os.rst:4019 msgid "" "Similar to :func:`posix_spawn` except that the system searches for the " "*executable* file in the list of directories specified by the :envvar:`PATH` " "environment variable (in the same way as for ``execvp(3)``)." msgstr "" -#: ../../library/os.rst:4026 +#: ../../library/os.rst:4027 msgid "" ":ref:`Availability `: See :func:`posix_spawn` documentation." msgstr "" -#: ../../library/os.rst:4032 +#: ../../library/os.rst:4033 msgid "" "Register callables to be executed when a new child process is forked using :" "func:`os.fork` or similar process cloning APIs. The parameters are optional " "and keyword-only. Each specifies a different call point." msgstr "" -#: ../../library/os.rst:4037 +#: ../../library/os.rst:4038 msgid "*before* is a function called before forking a child process." msgstr "" -#: ../../library/os.rst:4038 +#: ../../library/os.rst:4039 msgid "" "*after_in_parent* is a function called from the parent process after forking " "a child process." msgstr "" -#: ../../library/os.rst:4040 +#: ../../library/os.rst:4041 msgid "*after_in_child* is a function called from the child process." msgstr "" -#: ../../library/os.rst:4042 +#: ../../library/os.rst:4043 msgid "" "These calls are only made if control is expected to return to the Python " "interpreter. A typical :mod:`subprocess` launch will not trigger them as " "the child is not going to re-enter the interpreter." msgstr "" -#: ../../library/os.rst:4046 +#: ../../library/os.rst:4047 msgid "" "Functions registered for execution before forking are called in reverse " "registration order. Functions registered for execution after forking " "(either in the parent or in the child) are called in registration order." msgstr "" -#: ../../library/os.rst:4051 +#: ../../library/os.rst:4052 msgid "" "Note that :c:func:`fork` calls made by third-party C code may not call those " "functions, unless it explicitly calls :c:func:`PyOS_BeforeFork`, :c:func:" "`PyOS_AfterFork_Parent` and :c:func:`PyOS_AfterFork_Child`." msgstr "" -#: ../../library/os.rst:4055 +#: ../../library/os.rst:4056 msgid "There is no way to unregister a function." msgstr "" -#: ../../library/os.rst:4071 +#: ../../library/os.rst:4072 msgid "Execute the program *path* in a new process." msgstr "" -#: ../../library/os.rst:4073 +#: ../../library/os.rst:4074 msgid "" "(Note that the :mod:`subprocess` module provides more powerful facilities " "for spawning new processes and retrieving their results; using that module " @@ -4395,7 +4396,7 @@ msgid "" "`subprocess-replacements` section.)" msgstr "" -#: ../../library/os.rst:4078 +#: ../../library/os.rst:4079 msgid "" "If *mode* is :const:`P_NOWAIT`, this function returns the process id of the " "new process; if *mode* is :const:`P_WAIT`, returns the process's exit code " @@ -4404,13 +4405,13 @@ msgid "" "handle, so can be used with the :func:`waitpid` function." msgstr "" -#: ../../library/os.rst:4084 +#: ../../library/os.rst:4085 msgid "" "Note on VxWorks, this function doesn't return ``-signal`` when the new " "process is killed. Instead it raises OSError exception." msgstr "" -#: ../../library/os.rst:4087 +#: ../../library/os.rst:4088 msgid "" "The \"l\" and \"v\" variants of the :func:`spawn\\* ` functions " "differ in how command-line arguments are passed. The \"l\" variants are " @@ -4422,7 +4423,7 @@ msgid "" "to the child process must start with the name of the command being run." msgstr "" -#: ../../library/os.rst:4096 +#: ../../library/os.rst:4097 msgid "" "The variants which include a second \"p\" near the end (:func:`spawnlp`, :" "func:`spawnlpe`, :func:`spawnvp`, and :func:`spawnvpe`) will use the :envvar:" @@ -4435,7 +4436,7 @@ msgid "" "appropriate absolute or relative path." msgstr "" -#: ../../library/os.rst:4106 +#: ../../library/os.rst:4107 msgid "" "For :func:`spawnle`, :func:`spawnlpe`, :func:`spawnve`, and :func:`spawnvpe` " "(note that these all end in \"e\"), the *env* parameter must be a mapping " @@ -4447,19 +4448,19 @@ msgid "" "values will cause the function to fail, with a return value of ``127``." msgstr "" -#: ../../library/os.rst:4115 +#: ../../library/os.rst:4116 msgid "" "As an example, the following calls to :func:`spawnlp` and :func:`spawnvpe` " "are equivalent::" msgstr "" -#: ../../library/os.rst:4124 +#: ../../library/os.rst:4125 msgid "" "Raises an :ref:`auditing event ` ``os.spawn`` with arguments " "``mode``, ``path``, ``args``, ``env``." msgstr "" -#: ../../library/os.rst:4130 +#: ../../library/os.rst:4131 msgid "" ":ref:`Availability `: Unix, Windows. :func:`spawnlp`, :func:" "`spawnlpe`, :func:`spawnvp` and :func:`spawnvpe` are not available on " @@ -4467,7 +4468,7 @@ msgid "" "Windows; we advise you to use the :mod:`subprocess` module instead." msgstr "" -#: ../../library/os.rst:4138 +#: ../../library/os.rst:4139 msgid "" "Possible values for the *mode* parameter to the :func:`spawn\\* ` " "family of functions. If either of these values is given, the :func:`spawn" @@ -4475,7 +4476,7 @@ msgid "" "the process id as the return value." msgstr "" -#: ../../library/os.rst:4148 +#: ../../library/os.rst:4149 msgid "" "Possible value for the *mode* parameter to the :func:`spawn\\* ` " "family of functions. If this is given as *mode*, the :func:`spawn\\*` " @@ -4484,7 +4485,7 @@ msgid "" "signal`` if a signal kills the process." msgstr "" -#: ../../library/os.rst:4160 +#: ../../library/os.rst:4161 msgid "" "Possible values for the *mode* parameter to the :func:`spawn\\* ` " "family of functions. These are less portable than those listed above. :" @@ -4494,11 +4495,11 @@ msgid "" "function will not return." msgstr "" -#: ../../library/os.rst:4171 +#: ../../library/os.rst:4172 msgid "Start a file with its associated application." msgstr "" -#: ../../library/os.rst:4173 +#: ../../library/os.rst:4174 msgid "" "When *operation* is not specified or ``'open'``, this acts like double-" "clicking the file in Windows Explorer, or giving the file name as an " @@ -4507,7 +4508,7 @@ msgid "" "associated." msgstr "" -#: ../../library/os.rst:4178 +#: ../../library/os.rst:4179 msgid "" "When another *operation* is given, it must be a \"command verb\" that " "specifies what should be done with the file. Common verbs documented by " @@ -4515,28 +4516,28 @@ msgid "" "``'explore'`` and ``'find'`` (to be used on directories)." msgstr "" -#: ../../library/os.rst:4183 +#: ../../library/os.rst:4184 msgid "" "When launching an application, specify *arguments* to be passed as a single " "string. This argument may have no effect when using this function to launch " "a document." msgstr "" -#: ../../library/os.rst:4187 +#: ../../library/os.rst:4188 msgid "" "The default working directory is inherited, but may be overridden by the " "*cwd* argument. This should be an absolute path. A relative *path* will be " "resolved against this argument." msgstr "" -#: ../../library/os.rst:4191 +#: ../../library/os.rst:4192 msgid "" "Use *show_cmd* to override the default window style. Whether this has any " "effect will depend on the application being launched. Values are integers as " "supported by the Win32 :c:func:`ShellExecute` function." msgstr "" -#: ../../library/os.rst:4195 +#: ../../library/os.rst:4196 msgid "" ":func:`startfile` returns as soon as the associated application is launched. " "There is no option to wait for the application to close, and no way to " @@ -4547,32 +4548,32 @@ msgid "" "encoded for Win32." msgstr "" -#: ../../library/os.rst:4203 +#: ../../library/os.rst:4204 msgid "" "To reduce interpreter startup overhead, the Win32 :c:func:`ShellExecute` " "function is not resolved until this function is first called. If the " "function cannot be resolved, :exc:`NotImplementedError` will be raised." msgstr "" -#: ../../library/os.rst:4207 +#: ../../library/os.rst:4208 msgid "" "Raises an :ref:`auditing event ` ``os.startfile`` with arguments " "``path``, ``operation``." msgstr "" -#: ../../library/os.rst:4209 +#: ../../library/os.rst:4210 msgid "" "Raises an :ref:`auditing event ` ``os.startfile/2`` with arguments " "``path``, ``operation``, ``arguments``, ``cwd``, ``show_cmd``." msgstr "" -#: ../../library/os.rst:4213 +#: ../../library/os.rst:4214 msgid "" "Added the *arguments*, *cwd* and *show_cmd* arguments, and the ``os." "startfile/2`` audit event." msgstr "" -#: ../../library/os.rst:4220 +#: ../../library/os.rst:4221 msgid "" "Execute the command (a string) in a subshell. This is implemented by " "calling the Standard C function :c:func:`system`, and has the same " @@ -4583,13 +4584,13 @@ msgid "" "value of the Python function is system-dependent." msgstr "" -#: ../../library/os.rst:4228 +#: ../../library/os.rst:4229 msgid "" "On Unix, the return value is the exit status of the process encoded in the " "format specified for :func:`wait`." msgstr "" -#: ../../library/os.rst:4231 +#: ../../library/os.rst:4232 msgid "" "On Windows, the return value is that returned by the system shell after " "running *command*. The shell is given by the Windows environment variable :" @@ -4598,7 +4599,7 @@ msgid "" "shell documentation." msgstr "" -#: ../../library/os.rst:4237 +#: ../../library/os.rst:4238 msgid "" "The :mod:`subprocess` module provides more powerful facilities for spawning " "new processes and retrieving their results; using that module is preferable " @@ -4606,53 +4607,53 @@ msgid "" "the :mod:`subprocess` documentation for some helpful recipes." msgstr "" -#: ../../library/os.rst:4242 +#: ../../library/os.rst:4243 msgid "" "On Unix, :func:`waitstatus_to_exitcode` can be used to convert the result " "(exit status) into an exit code. On Windows, the result is directly the exit " "code." msgstr "" -#: ../../library/os.rst:4246 +#: ../../library/os.rst:4247 msgid "" "Raises an :ref:`auditing event ` ``os.system`` with argument " "``command``." msgstr "" -#: ../../library/os.rst:4253 +#: ../../library/os.rst:4254 msgid "" "Returns the current global process times. The return value is an object with " "five attributes:" msgstr "" -#: ../../library/os.rst:4256 +#: ../../library/os.rst:4257 msgid ":attr:`!user` - user time" msgstr "" -#: ../../library/os.rst:4257 +#: ../../library/os.rst:4258 msgid ":attr:`!system` - system time" msgstr ":attr:`!system` - 系統時間" -#: ../../library/os.rst:4258 +#: ../../library/os.rst:4259 msgid ":attr:`!children_user` - user time of all child processes" msgstr "" -#: ../../library/os.rst:4259 +#: ../../library/os.rst:4260 msgid ":attr:`!children_system` - system time of all child processes" msgstr "" -#: ../../library/os.rst:4260 +#: ../../library/os.rst:4261 msgid ":attr:`!elapsed` - elapsed real time since a fixed point in the past" msgstr "" -#: ../../library/os.rst:4262 +#: ../../library/os.rst:4263 msgid "" "For backwards compatibility, this object also behaves like a five-tuple " "containing :attr:`!user`, :attr:`!system`, :attr:`!children_user`, :attr:`!" "children_system`, and :attr:`!elapsed` in that order." msgstr "" -#: ../../library/os.rst:4266 +#: ../../library/os.rst:4267 msgid "" "See the Unix manual page :manpage:`times(2)` and `times(3) `_ manual page on Unix or `the " @@ -4662,7 +4663,7 @@ msgid "" "attributes are zero." msgstr "" -#: ../../library/os.rst:4280 +#: ../../library/os.rst:4281 msgid "" "Wait for completion of a child process, and return a tuple containing its " "pid and exit status indication: a 16-bit number, whose low byte is the " @@ -4671,19 +4672,19 @@ msgid "" "if a core file was produced." msgstr "" -#: ../../library/os.rst:4286 ../../library/os.rst:4391 +#: ../../library/os.rst:4287 ../../library/os.rst:4392 msgid "" ":func:`waitstatus_to_exitcode` can be used to convert the exit status into " "an exit code." msgstr "" -#: ../../library/os.rst:4293 +#: ../../library/os.rst:4294 msgid "" ":func:`waitpid` can be used to wait for the completion of a specific child " "process and has more options." msgstr "" -#: ../../library/os.rst:4298 +#: ../../library/os.rst:4299 msgid "" "Wait for the completion of one or more child processes. *idtype* can be :" "data:`P_PID`, :data:`P_PGID`, :data:`P_ALL`, or :data:`P_PIDFD` on Linux. " @@ -4696,43 +4697,43 @@ msgid "" "`WNOHANG` is specified and there are no children in a waitable state." msgstr "" -#: ../../library/os.rst:4318 +#: ../../library/os.rst:4319 msgid "" "These are the possible values for *idtype* in :func:`waitid`. They affect " "how *id* is interpreted." msgstr "" -#: ../../library/os.rst:4327 +#: ../../library/os.rst:4328 msgid "" "This is a Linux-specific *idtype* that indicates that *id* is a file " "descriptor that refers to a process." msgstr "" -#: ../../library/os.rst:4331 +#: ../../library/os.rst:4332 msgid ":ref:`Availability `: Linux 5.4+" msgstr ":ref:`適用 `:Linux 5.4+" -#: ../../library/os.rst:4338 +#: ../../library/os.rst:4339 msgid "" "Flags that can be used in *options* in :func:`waitid` that specify what " "child signal to wait for." msgstr "" -#: ../../library/os.rst:4353 +#: ../../library/os.rst:4354 msgid "" "These are the possible values for :attr:`si_code` in the result returned by :" "func:`waitid`." msgstr "" -#: ../../library/os.rst:4360 +#: ../../library/os.rst:4361 msgid "Added :data:`CLD_KILLED` and :data:`CLD_STOPPED` values." msgstr "" -#: ../../library/os.rst:4366 +#: ../../library/os.rst:4367 msgid "The details of this function differ on Unix and Windows." msgstr "" -#: ../../library/os.rst:4368 +#: ../../library/os.rst:4369 msgid "" "On Unix: Wait for completion of a child process given by process id *pid*, " "and return a tuple containing its process id and exit status indication " @@ -4741,7 +4742,7 @@ msgid "" "operation." msgstr "" -#: ../../library/os.rst:4373 +#: ../../library/os.rst:4374 msgid "" "If *pid* is greater than ``0``, :func:`waitpid` requests status information " "for that specific process. If *pid* is ``0``, the request is for the status " @@ -4751,13 +4752,13 @@ msgid "" "group ``-pid`` (the absolute value of *pid*)." msgstr "" -#: ../../library/os.rst:4380 +#: ../../library/os.rst:4381 msgid "" "An :exc:`OSError` is raised with the value of errno when the syscall returns " "-1." msgstr "" -#: ../../library/os.rst:4383 +#: ../../library/os.rst:4384 msgid "" "On Windows: Wait for completion of a process given by process handle *pid*, " "and return a tuple containing *pid*, and its exit status shifted left by 8 " @@ -4769,7 +4770,7 @@ msgid "" "process handles." msgstr "" -#: ../../library/os.rst:4402 +#: ../../library/os.rst:4403 msgid "" "Similar to :func:`waitpid`, except no process id argument is given and a 3-" "element tuple containing the child's process id, exit status indication, and " @@ -4778,13 +4779,13 @@ msgid "" "argument is the same as that provided to :func:`waitpid` and :func:`wait4`." msgstr "" -#: ../../library/os.rst:4409 ../../library/os.rst:4423 +#: ../../library/os.rst:4410 ../../library/os.rst:4424 msgid "" ":func:`waitstatus_to_exitcode` can be used to convert the exit status into " "an exitcode." msgstr "" -#: ../../library/os.rst:4417 +#: ../../library/os.rst:4418 msgid "" "Similar to :func:`waitpid`, except a 3-element tuple, containing the child's " "process id, exit status indication, and resource usage information is " @@ -4793,22 +4794,22 @@ msgid "" "the same as those provided to :func:`waitpid`." msgstr "" -#: ../../library/os.rst:4431 +#: ../../library/os.rst:4432 msgid "Convert a wait status to an exit code." msgstr "" -#: ../../library/os.rst:4433 +#: ../../library/os.rst:4434 msgid "On Unix:" msgstr "" -#: ../../library/os.rst:4435 +#: ../../library/os.rst:4436 msgid "" "If the process exited normally (if ``WIFEXITED(status)`` is true), return " "the process exit status (return ``WEXITSTATUS(status)``): result greater " "than or equal to 0." msgstr "" -#: ../../library/os.rst:4438 +#: ../../library/os.rst:4439 msgid "" "If the process was terminated by a signal (if ``WIFSIGNALED(status)`` is " "true), return ``-signum`` where *signum* is the number of the signal that " @@ -4816,15 +4817,15 @@ msgid "" "than 0." msgstr "" -#: ../../library/os.rst:4442 +#: ../../library/os.rst:4443 msgid "Otherwise, raise a :exc:`ValueError`." msgstr "" -#: ../../library/os.rst:4444 +#: ../../library/os.rst:4445 msgid "On Windows, return *status* shifted right by 8 bits." msgstr "" -#: ../../library/os.rst:4446 +#: ../../library/os.rst:4447 msgid "" "On Unix, if the process is being traced or if :func:`waitpid` was called " "with :data:`WUNTRACED` option, the caller must first check if " @@ -4832,240 +4833,240 @@ msgid "" "``WIFSTOPPED(status)`` is true." msgstr "" -#: ../../library/os.rst:4453 +#: ../../library/os.rst:4454 msgid "" ":func:`WIFEXITED`, :func:`WEXITSTATUS`, :func:`WIFSIGNALED`, :func:" "`WTERMSIG`, :func:`WIFSTOPPED`, :func:`WSTOPSIG` functions." msgstr "" -#: ../../library/os.rst:4461 +#: ../../library/os.rst:4462 msgid "" "The option for :func:`waitpid` to return immediately if no child process " "status is available immediately. The function returns ``(0, 0)`` in this " "case." msgstr "" -#: ../../library/os.rst:4469 +#: ../../library/os.rst:4470 msgid "" "This option causes child processes to be reported if they have been " "continued from a job control stop since their status was last reported." msgstr "" -#: ../../library/os.rst:4472 +#: ../../library/os.rst:4473 msgid ":ref:`Availability `: some Unix systems." msgstr ":ref:`適用 `:部分 Unix 系統。" -#: ../../library/os.rst:4477 +#: ../../library/os.rst:4478 msgid "" "This option causes child processes to be reported if they have been stopped " "but their current state has not been reported since they were stopped." msgstr "" -#: ../../library/os.rst:4483 +#: ../../library/os.rst:4484 msgid "" "The following functions take a process status code as returned by :func:" "`system`, :func:`wait`, or :func:`waitpid` as a parameter. They may be used " "to determine the disposition of a process." msgstr "" -#: ../../library/os.rst:4489 +#: ../../library/os.rst:4490 msgid "" "Return ``True`` if a core dump was generated for the process, otherwise " "return ``False``." msgstr "" -#: ../../library/os.rst:4492 ../../library/os.rst:4558 +#: ../../library/os.rst:4493 ../../library/os.rst:4559 msgid "This function should be employed only if :func:`WIFSIGNALED` is true." msgstr "" -#: ../../library/os.rst:4499 +#: ../../library/os.rst:4500 msgid "" "Return ``True`` if a stopped child has been resumed by delivery of :data:" "`~signal.SIGCONT` (if the process has been continued from a job control " "stop), otherwise return ``False``." msgstr "" -#: ../../library/os.rst:4503 +#: ../../library/os.rst:4504 msgid "See :data:`WCONTINUED` option." msgstr "參閱 :data:`WCONTINUED` 選項。" -#: ../../library/os.rst:4510 +#: ../../library/os.rst:4511 msgid "" "Return ``True`` if the process was stopped by delivery of a signal, " "otherwise return ``False``." msgstr "" -#: ../../library/os.rst:4513 +#: ../../library/os.rst:4514 msgid "" ":func:`WIFSTOPPED` only returns ``True`` if the :func:`waitpid` call was " "done using :data:`WUNTRACED` option or when the process is being traced " "(see :manpage:`ptrace(2)`)." msgstr "" -#: ../../library/os.rst:4521 +#: ../../library/os.rst:4522 msgid "" "Return ``True`` if the process was terminated by a signal, otherwise return " "``False``." msgstr "" -#: ../../library/os.rst:4529 +#: ../../library/os.rst:4530 msgid "" "Return ``True`` if the process exited terminated normally, that is, by " "calling ``exit()`` or ``_exit()``, or by returning from ``main()``; " "otherwise return ``False``." msgstr "" -#: ../../library/os.rst:4538 +#: ../../library/os.rst:4539 msgid "Return the process exit status." msgstr "" -#: ../../library/os.rst:4540 +#: ../../library/os.rst:4541 msgid "This function should be employed only if :func:`WIFEXITED` is true." msgstr "" -#: ../../library/os.rst:4547 +#: ../../library/os.rst:4548 msgid "Return the signal which caused the process to stop." msgstr "" -#: ../../library/os.rst:4549 +#: ../../library/os.rst:4550 msgid "This function should be employed only if :func:`WIFSTOPPED` is true." msgstr "" -#: ../../library/os.rst:4556 +#: ../../library/os.rst:4557 msgid "Return the number of the signal that caused the process to terminate." msgstr "" -#: ../../library/os.rst:4564 +#: ../../library/os.rst:4565 msgid "Interface to the scheduler" msgstr "" -#: ../../library/os.rst:4566 +#: ../../library/os.rst:4567 msgid "" "These functions control how a process is allocated CPU time by the operating " "system. They are only available on some Unix platforms. For more detailed " "information, consult your Unix manpages." msgstr "" -#: ../../library/os.rst:4572 +#: ../../library/os.rst:4573 msgid "" "The following scheduling policies are exposed if they are supported by the " "operating system." msgstr "" -#: ../../library/os.rst:4577 +#: ../../library/os.rst:4578 msgid "The default scheduling policy." msgstr "" -#: ../../library/os.rst:4581 +#: ../../library/os.rst:4582 msgid "" "Scheduling policy for CPU-intensive processes that tries to preserve " "interactivity on the rest of the computer." msgstr "" -#: ../../library/os.rst:4586 +#: ../../library/os.rst:4587 msgid "Scheduling policy for extremely low priority background tasks." msgstr "" -#: ../../library/os.rst:4590 +#: ../../library/os.rst:4591 msgid "Scheduling policy for sporadic server programs." msgstr "" -#: ../../library/os.rst:4594 +#: ../../library/os.rst:4595 msgid "A First In First Out scheduling policy." msgstr "" -#: ../../library/os.rst:4598 +#: ../../library/os.rst:4599 msgid "A round-robin scheduling policy." msgstr "" -#: ../../library/os.rst:4602 +#: ../../library/os.rst:4603 msgid "" "This flag can be OR'ed with any other scheduling policy. When a process with " "this flag set forks, its child's scheduling policy and priority are reset to " "the default." msgstr "" -#: ../../library/os.rst:4609 +#: ../../library/os.rst:4610 msgid "" "This class represents tunable scheduling parameters used in :func:" "`sched_setparam`, :func:`sched_setscheduler`, and :func:`sched_getparam`. It " "is immutable." msgstr "" -#: ../../library/os.rst:4613 +#: ../../library/os.rst:4614 msgid "At the moment, there is only one possible parameter:" msgstr "" -#: ../../library/os.rst:4617 +#: ../../library/os.rst:4618 msgid "The scheduling priority for a scheduling policy." msgstr "" -#: ../../library/os.rst:4622 +#: ../../library/os.rst:4623 msgid "" "Get the minimum priority value for *policy*. *policy* is one of the " "scheduling policy constants above." msgstr "" -#: ../../library/os.rst:4628 +#: ../../library/os.rst:4629 msgid "" "Get the maximum priority value for *policy*. *policy* is one of the " "scheduling policy constants above." msgstr "" -#: ../../library/os.rst:4634 +#: ../../library/os.rst:4635 msgid "" "Set the scheduling policy for the process with PID *pid*. A *pid* of 0 means " "the calling process. *policy* is one of the scheduling policy constants " "above. *param* is a :class:`sched_param` instance." msgstr "" -#: ../../library/os.rst:4641 +#: ../../library/os.rst:4642 msgid "" "Return the scheduling policy for the process with PID *pid*. A *pid* of 0 " "means the calling process. The result is one of the scheduling policy " "constants above." msgstr "" -#: ../../library/os.rst:4648 +#: ../../library/os.rst:4649 msgid "" "Set the scheduling parameters for the process with PID *pid*. A *pid* of 0 " "means the calling process. *param* is a :class:`sched_param` instance." msgstr "" -#: ../../library/os.rst:4654 +#: ../../library/os.rst:4655 msgid "" "Return the scheduling parameters as a :class:`sched_param` instance for the " "process with PID *pid*. A *pid* of 0 means the calling process." msgstr "" -#: ../../library/os.rst:4660 +#: ../../library/os.rst:4661 msgid "" "Return the round-robin quantum in seconds for the process with PID *pid*. A " "*pid* of 0 means the calling process." msgstr "" -#: ../../library/os.rst:4666 +#: ../../library/os.rst:4667 msgid "Voluntarily relinquish the CPU." msgstr "" -#: ../../library/os.rst:4671 +#: ../../library/os.rst:4672 msgid "" "Restrict the process with PID *pid* (or the current process if zero) to a " "set of CPUs. *mask* is an iterable of integers representing the set of CPUs " "to which the process should be restricted." msgstr "" -#: ../../library/os.rst:4678 +#: ../../library/os.rst:4679 msgid "" "Return the set of CPUs the process with PID *pid* (or the current process if " "zero) is restricted to." msgstr "" -#: ../../library/os.rst:4685 +#: ../../library/os.rst:4686 msgid "Miscellaneous System Information" msgstr "" -#: ../../library/os.rst:4690 +#: ../../library/os.rst:4691 msgid "" "Return string-valued system configuration values. *name* specifies the " "configuration value to retrieve; it may be a string which is the name of a " @@ -5076,13 +5077,13 @@ msgid "" "included in that mapping, passing an integer for *name* is also accepted." msgstr "" -#: ../../library/os.rst:4698 +#: ../../library/os.rst:4699 msgid "" "If the configuration value specified by *name* isn't defined, ``None`` is " "returned." msgstr "" -#: ../../library/os.rst:4701 +#: ../../library/os.rst:4702 msgid "" "If *name* is a string and is not known, :exc:`ValueError` is raised. If a " "specific value for *name* is not supported by the host system, even if it is " @@ -5090,33 +5091,33 @@ msgid "" "`errno.EINVAL` for the error number." msgstr "" -#: ../../library/os.rst:4711 +#: ../../library/os.rst:4712 msgid "" "Dictionary mapping names accepted by :func:`confstr` to the integer values " "defined for those names by the host operating system. This can be used to " "determine the set of names known to the system." msgstr "" -#: ../../library/os.rst:4720 +#: ../../library/os.rst:4721 msgid "" "Return the number of CPUs in the system. Returns ``None`` if undetermined." msgstr "" -#: ../../library/os.rst:4722 +#: ../../library/os.rst:4723 msgid "" "This number is not equivalent to the number of CPUs the current process can " "use. The number of usable CPUs can be obtained with ``len(os." "sched_getaffinity(0))``" msgstr "" -#: ../../library/os.rst:4732 +#: ../../library/os.rst:4733 msgid "" "Return the number of processes in the system run queue averaged over the " "last 1, 5, and 15 minutes or raises :exc:`OSError` if the load average was " "unobtainable." msgstr "" -#: ../../library/os.rst:4741 +#: ../../library/os.rst:4742 msgid "" "Return integer-valued system configuration values. If the configuration " "value specified by *name* isn't defined, ``-1`` is returned. The comments " @@ -5125,40 +5126,40 @@ msgid "" "``sysconf_names``." msgstr "" -#: ../../library/os.rst:4751 +#: ../../library/os.rst:4752 msgid "" "Dictionary mapping names accepted by :func:`sysconf` to the integer values " "defined for those names by the host operating system. This can be used to " "determine the set of names known to the system." msgstr "" -#: ../../library/os.rst:4757 +#: ../../library/os.rst:4758 msgid "" "The following data values are used to support path manipulation operations. " "These are defined for all platforms." msgstr "" -#: ../../library/os.rst:4760 +#: ../../library/os.rst:4761 msgid "" "Higher-level operations on pathnames are defined in the :mod:`os.path` " "module." msgstr "" -#: ../../library/os.rst:4766 +#: ../../library/os.rst:4767 msgid "" "The constant string used by the operating system to refer to the current " "directory. This is ``'.'`` for Windows and POSIX. Also available via :mod:" "`os.path`." msgstr "" -#: ../../library/os.rst:4774 +#: ../../library/os.rst:4775 msgid "" "The constant string used by the operating system to refer to the parent " "directory. This is ``'..'`` for Windows and POSIX. Also available via :mod:" "`os.path`." msgstr "" -#: ../../library/os.rst:4783 +#: ../../library/os.rst:4784 msgid "" "The character used by the operating system to separate pathname components. " "This is ``'/'`` for POSIX and ``'\\\\'`` for Windows. Note that knowing " @@ -5167,7 +5168,7 @@ msgid "" "useful. Also available via :mod:`os.path`." msgstr "" -#: ../../library/os.rst:4793 +#: ../../library/os.rst:4794 msgid "" "An alternative character used by the operating system to separate pathname " "components, or ``None`` if only one separator character exists. This is set " @@ -5175,27 +5176,27 @@ msgid "" "via :mod:`os.path`." msgstr "" -#: ../../library/os.rst:4802 +#: ../../library/os.rst:4803 msgid "" "The character which separates the base filename from the extension; for " "example, the ``'.'`` in :file:`os.py`. Also available via :mod:`os.path`." msgstr "" -#: ../../library/os.rst:4810 +#: ../../library/os.rst:4811 msgid "" "The character conventionally used by the operating system to separate search " "path components (as in :envvar:`PATH`), such as ``':'`` for POSIX or ``';'`` " "for Windows. Also available via :mod:`os.path`." msgstr "" -#: ../../library/os.rst:4817 +#: ../../library/os.rst:4818 msgid "" "The default search path used by :func:`exec\\*p\\* ` and :func:`spawn" "\\*p\\* ` if the environment doesn't have a ``'PATH'`` key. Also " "available via :mod:`os.path`." msgstr "" -#: ../../library/os.rst:4824 +#: ../../library/os.rst:4825 msgid "" "The string used to separate (or, rather, terminate) lines on the current " "platform. This may be a single character, such as ``'\\n'`` for POSIX, or " @@ -5204,36 +5205,36 @@ msgid "" "default); use a single ``'\\n'`` instead, on all platforms." msgstr "" -#: ../../library/os.rst:4833 +#: ../../library/os.rst:4834 msgid "" "The file path of the null device. For example: ``'/dev/null'`` for POSIX, " "``'nul'`` for Windows. Also available via :mod:`os.path`." msgstr "" -#: ../../library/os.rst:4844 +#: ../../library/os.rst:4845 msgid "" "Flags for use with the :func:`~sys.setdlopenflags` and :func:`~sys." "getdlopenflags` functions. See the Unix manual page :manpage:`dlopen(3)` " "for what the different flags mean." msgstr "" -#: ../../library/os.rst:4852 +#: ../../library/os.rst:4853 msgid "Random numbers" msgstr "" -#: ../../library/os.rst:4857 +#: ../../library/os.rst:4858 msgid "" "Get up to *size* random bytes. The function can return less bytes than " "requested." msgstr "" -#: ../../library/os.rst:4860 +#: ../../library/os.rst:4861 msgid "" "These bytes can be used to seed user-space random number generators or for " "cryptographic purposes." msgstr "" -#: ../../library/os.rst:4863 +#: ../../library/os.rst:4864 msgid "" "``getrandom()`` relies on entropy gathered from device drivers and other " "sources of environmental noise. Unnecessarily reading large quantities of " @@ -5241,36 +5242,36 @@ msgid "" "``/dev/urandom`` devices." msgstr "" -#: ../../library/os.rst:4868 +#: ../../library/os.rst:4869 msgid "" "The flags argument is a bit mask that can contain zero or more of the " "following values ORed together: :py:data:`os.GRND_RANDOM` and :py:data:" "`GRND_NONBLOCK`." msgstr "" -#: ../../library/os.rst:4872 +#: ../../library/os.rst:4873 msgid "" "See also the `Linux getrandom() manual page `_." msgstr "" -#: ../../library/os.rst:4876 +#: ../../library/os.rst:4877 msgid ":ref:`Availability `: Linux 3.17 and newer." msgstr ":ref:`適用 `:Linux 3.17 以上。" -#: ../../library/os.rst:4881 +#: ../../library/os.rst:4882 msgid "" "Return a bytestring of *size* random bytes suitable for cryptographic use." msgstr "" -#: ../../library/os.rst:4883 +#: ../../library/os.rst:4884 msgid "" "This function returns random bytes from an OS-specific randomness source. " "The returned data should be unpredictable enough for cryptographic " "applications, though its exact quality depends on the OS implementation." msgstr "" -#: ../../library/os.rst:4887 +#: ../../library/os.rst:4888 msgid "" "On Linux, if the ``getrandom()`` syscall is available, it is used in " "blocking mode: block until the system urandom entropy pool is initialized " @@ -5280,57 +5281,57 @@ msgid "" "to poll until the system urandom entropy pool is initialized." msgstr "" -#: ../../library/os.rst:4894 +#: ../../library/os.rst:4895 msgid "" "On a Unix-like system, random bytes are read from the ``/dev/urandom`` " "device. If the ``/dev/urandom`` device is not available or not readable, " "the :exc:`NotImplementedError` exception is raised." msgstr "" -#: ../../library/os.rst:4898 +#: ../../library/os.rst:4899 msgid "On Windows, it will use ``CryptGenRandom()``." msgstr "" -#: ../../library/os.rst:4901 +#: ../../library/os.rst:4902 msgid "" "The :mod:`secrets` module provides higher level functions. For an easy-to-" "use interface to the random number generator provided by your platform, " "please see :class:`random.SystemRandom`." msgstr "" -#: ../../library/os.rst:4905 +#: ../../library/os.rst:4906 msgid "" "On Linux, ``getrandom()`` is now used in blocking mode to increase the " "security." msgstr "" -#: ../../library/os.rst:4909 +#: ../../library/os.rst:4910 msgid "" "On Linux, if the ``getrandom()`` syscall blocks (the urandom entropy pool is " "not initialized yet), fall back on reading ``/dev/urandom``." msgstr "" -#: ../../library/os.rst:4913 +#: ../../library/os.rst:4914 msgid "" "On Linux 3.17 and newer, the ``getrandom()`` syscall is now used when " "available. On OpenBSD 5.6 and newer, the C ``getentropy()`` function is now " "used. These functions avoid the usage of an internal file descriptor." msgstr "" -#: ../../library/os.rst:4921 +#: ../../library/os.rst:4922 msgid "" "By default, when reading from ``/dev/random``, :func:`getrandom` blocks if " "no random bytes are available, and when reading from ``/dev/urandom``, it " "blocks if the entropy pool has not yet been initialized." msgstr "" -#: ../../library/os.rst:4925 +#: ../../library/os.rst:4926 msgid "" "If the :py:data:`GRND_NONBLOCK` flag is set, then :func:`getrandom` does not " "block in these cases, but instead immediately raises :exc:`BlockingIOError`." msgstr "" -#: ../../library/os.rst:4932 +#: ../../library/os.rst:4933 msgid "" "If this bit is set, then random bytes are drawn from the ``/dev/" "random`` pool instead of the ``/dev/urandom`` pool." diff --git a/reference/expressions.po b/reference/expressions.po index 2668e3b72d..5d30e85485 100644 --- a/reference/expressions.po +++ b/reference/expressions.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-07 00:27+0000\n" +"POT-Creation-Date: 2022-10-09 00:22+0000\n" "PO-Revision-Date: 2018-05-23 16:17+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1162,7 +1162,7 @@ msgid "" "as if that method was called." msgstr "" -#: ../../reference/expressions.rst:1138 ../../reference/expressions.rst:1911 +#: ../../reference/expressions.rst:1138 ../../reference/expressions.rst:1917 msgid "Await expression" msgstr "" @@ -1850,11 +1850,11 @@ msgid "" "argument (for example, ``not 'foo'`` produces ``False`` rather than ``''``.)" msgstr "" -#: ../../reference/expressions.rst:1727 +#: ../../reference/expressions.rst:1733 msgid "Assignment expressions" msgstr "" -#: ../../reference/expressions.rst:1732 +#: ../../reference/expressions.rst:1738 msgid "" "An assignment expression (sometimes also called a \"named expression\" or " "\"walrus\") assigns an :token:`~python-grammar:expression` to an :token:" @@ -1862,15 +1862,15 @@ msgid "" "`~python-grammar:expression`." msgstr "" -#: ../../reference/expressions.rst:1737 +#: ../../reference/expressions.rst:1743 msgid "One common use case is when handling matched regular expressions:" msgstr "" -#: ../../reference/expressions.rst:1744 +#: ../../reference/expressions.rst:1750 msgid "Or, when processing a file stream in chunks:" msgstr "" -#: ../../reference/expressions.rst:1751 +#: ../../reference/expressions.rst:1757 msgid "" "Assignment expressions must be surrounded by parentheses when used as sub-" "expressions in slicing, conditional, lambda, keyword-argument, and " @@ -1879,36 +1879,36 @@ msgid "" "including in ``if`` and ``while`` statements." msgstr "" -#: ../../reference/expressions.rst:1758 +#: ../../reference/expressions.rst:1764 msgid "See :pep:`572` for more details about assignment expressions." msgstr "" -#: ../../reference/expressions.rst:1765 +#: ../../reference/expressions.rst:1771 msgid "Conditional expressions" msgstr "" -#: ../../reference/expressions.rst:1777 +#: ../../reference/expressions.rst:1783 msgid "" "Conditional expressions (sometimes called a \"ternary operator\") have the " "lowest priority of all Python operations." msgstr "" -#: ../../reference/expressions.rst:1780 +#: ../../reference/expressions.rst:1786 msgid "" "The expression ``x if C else y`` first evaluates the condition, *C* rather " "than *x*. If *C* is true, *x* is evaluated and its value is returned; " "otherwise, *y* is evaluated and its value is returned." msgstr "" -#: ../../reference/expressions.rst:1784 +#: ../../reference/expressions.rst:1790 msgid "See :pep:`308` for more details about conditional expressions." msgstr "" -#: ../../reference/expressions.rst:1791 +#: ../../reference/expressions.rst:1797 msgid "Lambdas" msgstr "" -#: ../../reference/expressions.rst:1802 +#: ../../reference/expressions.rst:1808 msgid "" "Lambda expressions (sometimes called lambda forms) are used to create " "anonymous functions. The expression ``lambda parameters: expression`` yields " @@ -1916,25 +1916,25 @@ msgid "" "defined with:" msgstr "" -#: ../../reference/expressions.rst:1811 +#: ../../reference/expressions.rst:1817 msgid "" "See section :ref:`function` for the syntax of parameter lists. Note that " "functions created with lambda expressions cannot contain statements or " "annotations." msgstr "" -#: ../../reference/expressions.rst:1819 +#: ../../reference/expressions.rst:1825 msgid "Expression lists" msgstr "" -#: ../../reference/expressions.rst:1833 +#: ../../reference/expressions.rst:1839 msgid "" "Except when part of a list or set display, an expression list containing at " "least one comma yields a tuple. The length of the tuple is the number of " "expressions in the list. The expressions are evaluated from left to right." msgstr "" -#: ../../reference/expressions.rst:1842 +#: ../../reference/expressions.rst:1848 msgid "" "An asterisk ``*`` denotes :dfn:`iterable unpacking`. Its operand must be " "an :term:`iterable`. The iterable is expanded into a sequence of items, " @@ -1942,12 +1942,12 @@ msgid "" "unpacking." msgstr "" -#: ../../reference/expressions.rst:1847 +#: ../../reference/expressions.rst:1853 msgid "" "Iterable unpacking in expression lists, originally proposed by :pep:`448`." msgstr "" -#: ../../reference/expressions.rst:1852 +#: ../../reference/expressions.rst:1858 msgid "" "The trailing comma is required only to create a single tuple (a.k.a. a " "*singleton*); it is optional in all other cases. A single expression " @@ -1956,28 +1956,28 @@ msgid "" "parentheses: ``()``.)" msgstr "" -#: ../../reference/expressions.rst:1862 +#: ../../reference/expressions.rst:1868 msgid "Evaluation order" msgstr "" -#: ../../reference/expressions.rst:1866 +#: ../../reference/expressions.rst:1872 msgid "" "Python evaluates expressions from left to right. Notice that while " "evaluating an assignment, the right-hand side is evaluated before the left-" "hand side." msgstr "" -#: ../../reference/expressions.rst:1869 +#: ../../reference/expressions.rst:1875 msgid "" "In the following lines, expressions will be evaluated in the arithmetic " "order of their suffixes::" msgstr "" -#: ../../reference/expressions.rst:1883 +#: ../../reference/expressions.rst:1889 msgid "Operator precedence" msgstr "" -#: ../../reference/expressions.rst:1888 +#: ../../reference/expressions.rst:1894 msgid "" "The following table summarizes the operator precedence in Python, from " "highest precedence (most binding) to lowest precedence (least binding). " @@ -1986,176 +1986,176 @@ msgid "" "left to right (except for exponentiation, which groups from right to left)." msgstr "" -#: ../../reference/expressions.rst:1894 +#: ../../reference/expressions.rst:1900 msgid "" "Note that comparisons, membership tests, and identity tests, all have the " "same precedence and have a left-to-right chaining feature as described in " "the :ref:`comparisons` section." msgstr "" -#: ../../reference/expressions.rst:1900 +#: ../../reference/expressions.rst:1906 msgid "Operator" msgstr "" -#: ../../reference/expressions.rst:1900 +#: ../../reference/expressions.rst:1906 msgid "Description" msgstr "描述" -#: ../../reference/expressions.rst:1902 +#: ../../reference/expressions.rst:1908 msgid "``(expressions...)``," msgstr "``(expressions...)``," -#: ../../reference/expressions.rst:1904 +#: ../../reference/expressions.rst:1910 msgid "``[expressions...]``, ``{key: value...}``, ``{expressions...}``" msgstr "``[expressions...]``, ``{key: value...}``, ``{expressions...}``" -#: ../../reference/expressions.rst:1902 +#: ../../reference/expressions.rst:1908 msgid "" "Binding or parenthesized expression, list display, dictionary display, set " "display" msgstr "" -#: ../../reference/expressions.rst:1908 +#: ../../reference/expressions.rst:1914 msgid "``x[index]``, ``x[index:index]``, ``x(arguments...)``, ``x.attribute``" msgstr "``x[index]``, ``x[index:index]``, ``x(arguments...)``, ``x.attribute``" -#: ../../reference/expressions.rst:1908 +#: ../../reference/expressions.rst:1914 msgid "Subscription, slicing, call, attribute reference" msgstr "" -#: ../../reference/expressions.rst:1911 +#: ../../reference/expressions.rst:1917 msgid ":keyword:`await x `" msgstr ":keyword:`await x `" -#: ../../reference/expressions.rst:1913 +#: ../../reference/expressions.rst:1919 msgid "``**``" msgstr "``**``" -#: ../../reference/expressions.rst:1913 +#: ../../reference/expressions.rst:1919 msgid "Exponentiation [#]_" msgstr "" -#: ../../reference/expressions.rst:1915 +#: ../../reference/expressions.rst:1921 msgid "``+x``, ``-x``, ``~x``" msgstr "``+x``, ``-x``, ``~x``" -#: ../../reference/expressions.rst:1915 +#: ../../reference/expressions.rst:1921 msgid "Positive, negative, bitwise NOT" msgstr "" -#: ../../reference/expressions.rst:1917 +#: ../../reference/expressions.rst:1923 msgid "``*``, ``@``, ``/``, ``//``, ``%``" msgstr "``*``, ``@``, ``/``, ``//``, ``%``" -#: ../../reference/expressions.rst:1917 +#: ../../reference/expressions.rst:1923 msgid "" "Multiplication, matrix multiplication, division, floor division, remainder " "[#]_" msgstr "" -#: ../../reference/expressions.rst:1921 +#: ../../reference/expressions.rst:1927 msgid "``+``, ``-``" msgstr "``+``, ``-``" -#: ../../reference/expressions.rst:1921 +#: ../../reference/expressions.rst:1927 msgid "Addition and subtraction" msgstr "" -#: ../../reference/expressions.rst:1923 +#: ../../reference/expressions.rst:1929 msgid "``<<``, ``>>``" msgstr "``<<``, ``>>``" -#: ../../reference/expressions.rst:1923 +#: ../../reference/expressions.rst:1929 msgid "Shifts" msgstr "" -#: ../../reference/expressions.rst:1925 +#: ../../reference/expressions.rst:1931 msgid "``&``" msgstr "``&``" -#: ../../reference/expressions.rst:1925 +#: ../../reference/expressions.rst:1931 msgid "Bitwise AND" msgstr "" -#: ../../reference/expressions.rst:1927 +#: ../../reference/expressions.rst:1933 msgid "``^``" msgstr "``^``" -#: ../../reference/expressions.rst:1927 +#: ../../reference/expressions.rst:1933 msgid "Bitwise XOR" msgstr "" -#: ../../reference/expressions.rst:1929 +#: ../../reference/expressions.rst:1935 msgid "``|``" msgstr "``|``" -#: ../../reference/expressions.rst:1929 +#: ../../reference/expressions.rst:1935 msgid "Bitwise OR" msgstr "" -#: ../../reference/expressions.rst:1931 +#: ../../reference/expressions.rst:1937 msgid "" ":keyword:`in`, :keyword:`not in`, :keyword:`is`, :keyword:`is not`, ``<``, " "``<=``, ``>``, ``>=``, ``!=``, ``==``" msgstr "" -#: ../../reference/expressions.rst:1931 +#: ../../reference/expressions.rst:1937 msgid "Comparisons, including membership tests and identity tests" msgstr "" -#: ../../reference/expressions.rst:1935 +#: ../../reference/expressions.rst:1941 msgid ":keyword:`not x `" msgstr ":keyword:`not x `" -#: ../../reference/expressions.rst:1935 +#: ../../reference/expressions.rst:1941 msgid "Boolean NOT" msgstr "" -#: ../../reference/expressions.rst:1937 +#: ../../reference/expressions.rst:1943 msgid ":keyword:`and`" msgstr ":keyword:`and`" -#: ../../reference/expressions.rst:1937 +#: ../../reference/expressions.rst:1943 msgid "Boolean AND" msgstr "" -#: ../../reference/expressions.rst:1939 +#: ../../reference/expressions.rst:1945 msgid ":keyword:`or`" msgstr ":keyword:`or`" -#: ../../reference/expressions.rst:1939 +#: ../../reference/expressions.rst:1945 msgid "Boolean OR" msgstr "" -#: ../../reference/expressions.rst:1941 +#: ../../reference/expressions.rst:1947 msgid ":keyword:`if ` -- :keyword:`!else`" msgstr ":keyword:`if ` -- :keyword:`!else`" -#: ../../reference/expressions.rst:1941 +#: ../../reference/expressions.rst:1947 msgid "Conditional expression" msgstr "" -#: ../../reference/expressions.rst:1943 +#: ../../reference/expressions.rst:1949 msgid ":keyword:`lambda`" msgstr ":keyword:`lambda`" -#: ../../reference/expressions.rst:1943 +#: ../../reference/expressions.rst:1949 msgid "Lambda expression" msgstr "" -#: ../../reference/expressions.rst:1945 +#: ../../reference/expressions.rst:1951 msgid "``:=``" msgstr "``:=``" -#: ../../reference/expressions.rst:1945 +#: ../../reference/expressions.rst:1951 msgid "Assignment expression" msgstr "" -#: ../../reference/expressions.rst:1950 +#: ../../reference/expressions.rst:1956 msgid "Footnotes" msgstr "註解" -#: ../../reference/expressions.rst:1951 +#: ../../reference/expressions.rst:1957 msgid "" "While ``abs(x%y) < abs(y)`` is true mathematically, for floats it may not be " "true numerically due to roundoff. For example, and assuming a platform on " @@ -2167,7 +2167,7 @@ msgid "" "approach is more appropriate depends on the application." msgstr "" -#: ../../reference/expressions.rst:1960 +#: ../../reference/expressions.rst:1966 msgid "" "If x is very close to an exact integer multiple of y, it's possible for ``x//" "y`` to be one larger than ``(x-x%y)//y`` due to rounding. In such cases, " @@ -2175,7 +2175,7 @@ msgid "" "* y + x % y`` be very close to ``x``." msgstr "" -#: ../../reference/expressions.rst:1965 +#: ../../reference/expressions.rst:1971 msgid "" "The Unicode standard distinguishes between :dfn:`code points` (e.g. U+0041) " "and :dfn:`abstract characters` (e.g. \"LATIN CAPITAL LETTER A\"). While most " @@ -2189,7 +2189,7 @@ msgid "" "(COMBINING CEDILLA)." msgstr "" -#: ../../reference/expressions.rst:1976 +#: ../../reference/expressions.rst:1982 msgid "" "The comparison operators on strings compare at the level of Unicode code " "points. This may be counter-intuitive to humans. For example, ``\"\\u00C7\" " @@ -2197,13 +2197,13 @@ msgid "" "same abstract character \"LATIN CAPITAL LETTER C WITH CEDILLA\"." msgstr "" -#: ../../reference/expressions.rst:1981 +#: ../../reference/expressions.rst:1987 msgid "" "To compare strings at the level of abstract characters (that is, in a way " "intuitive to humans), use :func:`unicodedata.normalize`." msgstr "" -#: ../../reference/expressions.rst:1984 +#: ../../reference/expressions.rst:1990 msgid "" "Due to automatic garbage-collection, free lists, and the dynamic nature of " "descriptors, you may notice seemingly unusual behaviour in certain uses of " @@ -2211,13 +2211,13 @@ msgid "" "instance methods, or constants. Check their documentation for more info." msgstr "" -#: ../../reference/expressions.rst:1989 +#: ../../reference/expressions.rst:1995 msgid "" "The power operator ``**`` binds less tightly than an arithmetic or bitwise " "unary operator on its right, that is, ``2**-1`` is ``0.5``." msgstr "" -#: ../../reference/expressions.rst:1992 +#: ../../reference/expressions.rst:1998 msgid "" "The ``%`` operator is also used for string formatting; the same precedence " "applies." From 76b4ac81c040f2c570d9903eed08ade94b18729a Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 10 Oct 2022 00:24:33 +0000 Subject: [PATCH 11/14] sync with cpython ccb56804 --- howto/descriptor.po | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/howto/descriptor.po b/howto/descriptor.po index 34d0244055..8e0c78c096 100644 --- a/howto/descriptor.po +++ b/howto/descriptor.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-08-20 00:15+0000\n" +"POT-Creation-Date: 2022-10-10 00:22+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-" @@ -660,9 +660,9 @@ msgstr "ORM 範例" #: ../../howto/descriptor.rst:850 msgid "" -"The following code is simplified skeleton showing how data descriptors could " -"be used to implement an `object relational mapping `_." +"The following code is a simplified skeleton showing how data descriptors " +"could be used to implement an `object relational mapping `_." msgstr "" #: ../../howto/descriptor.rst:854 @@ -1015,36 +1015,36 @@ msgid "" "managed by member descriptors:" msgstr "" -#: ../../howto/descriptor.rst:1556 +#: ../../howto/descriptor.rst:1558 msgid "" "The :meth:`type.__new__` method takes care of adding member objects to class " "variables:" msgstr "" -#: ../../howto/descriptor.rst:1572 +#: ../../howto/descriptor.rst:1574 msgid "" "The :meth:`object.__new__` method takes care of creating instances that have " "slots instead of an instance dictionary. Here is a rough simulation in pure " "Python:" msgstr "" -#: ../../howto/descriptor.rst:1607 +#: ../../howto/descriptor.rst:1609 msgid "" "To use the simulation in a real class, just inherit from :class:`Object` and " "set the :term:`metaclass` to :class:`Type`:" msgstr "" -#: ../../howto/descriptor.rst:1621 +#: ../../howto/descriptor.rst:1623 msgid "" "At this point, the metaclass has loaded member objects for *x* and *y*::" msgstr "" -#: ../../howto/descriptor.rst:1642 +#: ../../howto/descriptor.rst:1644 msgid "" "When instances are created, they have a ``slot_values`` list where the " "attributes are stored:" msgstr "" -#: ../../howto/descriptor.rst:1654 +#: ../../howto/descriptor.rst:1656 msgid "Misspelled or unassigned attributes will raise an exception:" msgstr "" From ded7fe02cd5ff6b9f078e57ca47d63ef53b6fe45 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 11 Oct 2022 00:25:20 +0000 Subject: [PATCH 12/14] sync with cpython 428bd028 --- library/copyreg.po | 26 +++++------ library/os.po | 22 ++++----- library/venv.po | 96 +++++++++++++++++++++++----------------- tutorial/introduction.po | 39 ++++++++-------- 4 files changed, 99 insertions(+), 84 deletions(-) diff --git a/library/copyreg.po b/library/copyreg.po index e32de96fda..cc6068b41a 100644 --- a/library/copyreg.po +++ b/library/copyreg.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-01-19 00:09+0000\n" +"POT-Creation-Date: 2022-10-11 00:23+0000\n" "PO-Revision-Date: 2016-11-19 00:29+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -45,30 +45,28 @@ msgstr "" msgid "" "Declares that *function* should be used as a \"reduction\" function for " "objects of type *type*. *function* should return either a string or a tuple " -"containing two or three elements." +"containing two or three elements. See the :attr:`~pickle.Pickler." +"dispatch_table` for more details on the interface of *function*." msgstr "" -#: ../../library/copyreg.rst:34 +#: ../../library/copyreg.rst:35 msgid "" -"The optional *constructor* parameter, if provided, is a callable object " -"which can be used to reconstruct the object when called with the tuple of " -"arguments returned by *function* at pickling time. A :exc:`TypeError` is " -"raised if the *constructor* is not callable." +"The *constructor_ob* parameter is a legacy feature and is now ignored, but " +"if passed it must be a callable." msgstr "" -#: ../../library/copyreg.rst:39 +#: ../../library/copyreg.rst:38 msgid "" -"See the :mod:`pickle` module for more details on the interface expected of " -"*function* and *constructor*. Note that the :attr:`~pickle.Pickler." -"dispatch_table` attribute of a pickler object or subclass of :class:`pickle." -"Pickler` can also be used for declaring reduction functions." +"Note that the :attr:`~pickle.Pickler.dispatch_table` attribute of a pickler " +"object or subclass of :class:`pickle.Pickler` can also be used for declaring " +"reduction functions." msgstr "" -#: ../../library/copyreg.rst:46 +#: ../../library/copyreg.rst:43 msgid "Example" msgstr "範例" -#: ../../library/copyreg.rst:48 +#: ../../library/copyreg.rst:45 msgid "" "The example below would like to show how to register a pickle function and " "how it will be used:" diff --git a/library/os.po b/library/os.po index 33c99d4852..5e190e4295 100644 --- a/library/os.po +++ b/library/os.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-09 00:22+0000\n" +"POT-Creation-Date: 2022-10-11 00:23+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-" @@ -447,11 +447,11 @@ msgstr "" #: ../../library/os.rst:294 msgid "" -"Return the value of the environment variable *key* if it exists, or " -"*default* if it doesn't. *key*, *default* and the result are str. Note that " -"since :func:`getenv` uses :data:`os.environ`, the mapping of :func:`getenv` " -"is similarly also captured on import, and the function may not reflect " -"future environment changes." +"Return the value of the environment variable *key* as a string if it exists, " +"or *default* if it doesn't. *key* is a string. Note that since :func:" +"`getenv` uses :data:`os.environ`, the mapping of :func:`getenv` is similarly " +"also captured on import, and the function may not reflect future environment " +"changes." msgstr "" #: ../../library/os.rst:300 @@ -467,11 +467,11 @@ msgstr ":ref:`適用 `:大部分的 Unix、Windows。" #: ../../library/os.rst:309 msgid "" -"Return the value of the environment variable *key* if it exists, or " -"*default* if it doesn't. *key*, *default* and the result are bytes. Note " -"that since :func:`getenvb` uses :data:`os.environb`, the mapping of :func:" -"`getenvb` is similarly also captured on import, and the function may not " -"reflect future environment changes." +"Return the value of the environment variable *key* as bytes if it exists, or " +"*default* if it doesn't. *key* must be bytes. Note that since :func:" +"`getenvb` uses :data:`os.environb`, the mapping of :func:`getenvb` is " +"similarly also captured on import, and the function may not reflect future " +"environment changes." msgstr "" #: ../../library/os.rst:316 diff --git a/library/venv.po b/library/venv.po index 52d4bf32ed..3d803b7f77 100644 --- a/library/venv.po +++ b/library/venv.po @@ -7,7 +7,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-10-11 00:23+0000\n" "PO-Revision-Date: 2018-05-23 16:15+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -333,11 +333,27 @@ msgid "" "environment in ``PATH``." msgstr "" -#: ../../library/venv.rst:91 +#: ../../library/venv.rst:87 +msgid "" +"Because scripts installed in environments should not expect the environment " +"to be activated, their shebang lines contain the absolute paths to their " +"environment's interpreters. Because of this, environments are inherently non-" +"portable, in the general case. You should always have a simple means of " +"recreating an environment (for example, if you have a requirements file " +"``requirements.txt``, you can invoke ``pip install -r requirements.txt`` " +"using the environment's ``pip`` to install all of the packages needed by the " +"environment). If for any reason you need to move the environment to a new " +"location, you should recreate it at the desired location and delete the one " +"at the old location. If you move an environment because you moved a parent " +"directory of it, you should recreate the environment in its new location. " +"Otherwise, software installed into the environment may not work as expected." +msgstr "" + +#: ../../library/venv.rst:104 msgid "API" msgstr "API" -#: ../../library/venv.rst:95 +#: ../../library/venv.rst:108 msgid "" "The high-level method described above makes use of a simple API which " "provides mechanisms for third-party virtual environment creators to " @@ -345,46 +361,46 @@ msgid "" "`EnvBuilder` class." msgstr "" -#: ../../library/venv.rst:103 +#: ../../library/venv.rst:116 msgid "" "The :class:`EnvBuilder` class accepts the following keyword arguments on " "instantiation:" msgstr "" -#: ../../library/venv.rst:106 +#: ../../library/venv.rst:119 msgid "" "``system_site_packages`` -- a Boolean value indicating that the system " "Python site-packages should be available to the environment (defaults to " "``False``)." msgstr "" -#: ../../library/venv.rst:109 +#: ../../library/venv.rst:122 msgid "" "``clear`` -- a Boolean value which, if true, will delete the contents of any " "existing target directory, before creating the environment." msgstr "" -#: ../../library/venv.rst:112 +#: ../../library/venv.rst:125 msgid "" "``symlinks`` -- a Boolean value indicating whether to attempt to symlink the " "Python binary rather than copying." msgstr "" -#: ../../library/venv.rst:115 +#: ../../library/venv.rst:128 msgid "" "``upgrade`` -- a Boolean value which, if true, will upgrade an existing " "environment with the running Python - for use when that Python has been " "upgraded in-place (defaults to ``False``)." msgstr "" -#: ../../library/venv.rst:119 +#: ../../library/venv.rst:132 msgid "" "``with_pip`` -- a Boolean value which, if true, ensures pip is installed in " "the virtual environment. This uses :mod:`ensurepip` with the ``--default-" "pip`` option." msgstr "" -#: ../../library/venv.rst:123 +#: ../../library/venv.rst:136 msgid "" "``prompt`` -- a String to be used after virtual environment is activated " "(defaults to ``None`` which means directory name of the environment would be " @@ -392,33 +408,33 @@ msgid "" "current directory is used as the prompt." msgstr "" -#: ../../library/venv.rst:128 +#: ../../library/venv.rst:141 msgid "``upgrade_deps`` -- Update the base venv modules to the latest on PyPI" msgstr "" -#: ../../library/venv.rst:130 ../../library/venv.rst:260 +#: ../../library/venv.rst:143 ../../library/venv.rst:273 msgid "Added the ``with_pip`` parameter" msgstr "新增 ``with_pip`` 參數" -#: ../../library/venv.rst:133 ../../library/venv.rst:263 +#: ../../library/venv.rst:146 ../../library/venv.rst:276 msgid "Added the ``prompt`` parameter" msgstr "新增 ``prompt`` 參數" -#: ../../library/venv.rst:136 ../../library/venv.rst:266 +#: ../../library/venv.rst:149 ../../library/venv.rst:279 msgid "Added the ``upgrade_deps`` parameter" msgstr "新增 ``upgrade_deps`` 參數" -#: ../../library/venv.rst:139 +#: ../../library/venv.rst:152 msgid "" "Creators of third-party virtual environment tools will be free to use the " "provided :class:`EnvBuilder` class as a base class." msgstr "" -#: ../../library/venv.rst:142 +#: ../../library/venv.rst:155 msgid "The returned env-builder is an object which has a method, ``create``:" msgstr "" -#: ../../library/venv.rst:146 +#: ../../library/venv.rst:159 msgid "" "Create a virtual environment by specifying the target directory (absolute or " "relative to the current directory) which is to contain the virtual " @@ -426,20 +442,20 @@ msgid "" "the specified directory, or raise an appropriate exception." msgstr "" -#: ../../library/venv.rst:152 +#: ../../library/venv.rst:165 msgid "" "The ``create`` method of the :class:`EnvBuilder` class illustrates the hooks " "available for subclass customization::" msgstr "" -#: ../../library/venv.rst:167 +#: ../../library/venv.rst:180 msgid "" "Each of the methods :meth:`ensure_directories`, :meth:" "`create_configuration`, :meth:`setup_python`, :meth:`setup_scripts` and :" "meth:`post_setup` can be overridden." msgstr "" -#: ../../library/venv.rst:173 +#: ../../library/venv.rst:186 msgid "" "Creates the environment directory and all necessary directories, and returns " "a context object. This is just a holder for attributes (such as paths), for " @@ -448,11 +464,11 @@ msgid "" "an existing environment directory." msgstr "" -#: ../../library/venv.rst:181 +#: ../../library/venv.rst:194 msgid "Creates the ``pyvenv.cfg`` configuration file in the environment." msgstr "" -#: ../../library/venv.rst:185 +#: ../../library/venv.rst:198 msgid "" "Creates a copy or symlink to the Python executable in the environment. On " "POSIX systems, if a specific executable ``python3.x`` was used, symlinks to " @@ -460,48 +476,48 @@ msgid "" "unless files with those names already exist." msgstr "" -#: ../../library/venv.rst:192 +#: ../../library/venv.rst:205 msgid "" "Installs activation scripts appropriate to the platform into the virtual " "environment." msgstr "" -#: ../../library/venv.rst:197 +#: ../../library/venv.rst:210 msgid "" "Upgrades the core venv dependency packages (currently ``pip`` and " "``setuptools``) in the environment. This is done by shelling out to the " "``pip`` executable in the environment." msgstr "" -#: ../../library/venv.rst:205 +#: ../../library/venv.rst:218 msgid "" "A placeholder method which can be overridden in third party implementations " "to pre-install packages in the virtual environment or perform other post-" "creation steps." msgstr "" -#: ../../library/venv.rst:209 +#: ../../library/venv.rst:222 msgid "" "Windows now uses redirector scripts for ``python[w].exe`` instead of copying " "the actual binaries. In 3.7.2 only :meth:`setup_python` does nothing unless " "running from a build in the source tree." msgstr "" -#: ../../library/venv.rst:214 +#: ../../library/venv.rst:227 msgid "" "Windows copies the redirector scripts as part of :meth:`setup_python` " "instead of :meth:`setup_scripts`. This was not the case in 3.7.2. When using " "symlinks, the original executables will be linked." msgstr "" -#: ../../library/venv.rst:219 +#: ../../library/venv.rst:232 msgid "" "In addition, :class:`EnvBuilder` provides this utility method that can be " "called from :meth:`setup_scripts` or :meth:`post_setup` in subclasses to " "assist in installing custom scripts into the virtual environment." msgstr "" -#: ../../library/venv.rst:225 +#: ../../library/venv.rst:238 msgid "" "*path* is the path to a directory that should contain subdirectories \"common" "\", \"posix\", \"nt\", each containing scripts destined for the bin " @@ -510,64 +526,64 @@ msgid "" "placeholders:" msgstr "" -#: ../../library/venv.rst:231 +#: ../../library/venv.rst:244 msgid "" "``__VENV_DIR__`` is replaced with the absolute path of the environment " "directory." msgstr "" -#: ../../library/venv.rst:234 +#: ../../library/venv.rst:247 msgid "" "``__VENV_NAME__`` is replaced with the environment name (final path segment " "of environment directory)." msgstr "" -#: ../../library/venv.rst:237 +#: ../../library/venv.rst:250 msgid "" "``__VENV_PROMPT__`` is replaced with the prompt (the environment name " "surrounded by parentheses and with a following space)" msgstr "" -#: ../../library/venv.rst:240 +#: ../../library/venv.rst:253 msgid "" "``__VENV_BIN_NAME__`` is replaced with the name of the bin directory (either " "``bin`` or ``Scripts``)." msgstr "" -#: ../../library/venv.rst:243 +#: ../../library/venv.rst:256 msgid "" "``__VENV_PYTHON__`` is replaced with the absolute path of the environment's " "executable." msgstr "" -#: ../../library/venv.rst:246 +#: ../../library/venv.rst:259 msgid "" "The directories are allowed to exist (for when an existing environment is " "being upgraded)." msgstr "" -#: ../../library/venv.rst:249 +#: ../../library/venv.rst:262 msgid "There is also a module-level convenience function:" msgstr "" -#: ../../library/venv.rst:255 +#: ../../library/venv.rst:268 msgid "" "Create an :class:`EnvBuilder` with the given keyword arguments, and call " "its :meth:`~EnvBuilder.create` method with the *env_dir* argument." msgstr "" -#: ../../library/venv.rst:270 +#: ../../library/venv.rst:283 msgid "An example of extending ``EnvBuilder``" msgstr "" -#: ../../library/venv.rst:272 +#: ../../library/venv.rst:285 msgid "" "The following script shows how to extend :class:`EnvBuilder` by implementing " "a subclass which installs setuptools and pip into a created virtual " "environment::" msgstr "" -#: ../../library/venv.rst:491 +#: ../../library/venv.rst:504 msgid "" "This script is also available for download `online `_." diff --git a/tutorial/introduction.po b/tutorial/introduction.po index 20a9b640ca..d63c1004fa 100644 --- a/tutorial/introduction.po +++ b/tutorial/introduction.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-10-21 15:40+0000\n" +"POT-Creation-Date: 2022-10-11 00:23+0000\n" "PO-Revision-Date: 2022-06-07 16:52+0800\n" "Last-Translator: Steven Hsu \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -36,9 +36,9 @@ msgid "" "type a blank line; this is used to end a multi-line command." msgstr "" "在下面的例子中,輸入與輸出的區別在於有無提示字元(prompt,\\ :term:`>>>` 和 :" -"term:`...`\\ ):如果要重做範例,你必須在提示字元出現的時候,輸入提示字元後方的所" -"有內容;那些非提示字元開始的文字行是直譯器的輸出。注意到在範例中,若出現單行只" -"有次提示字元時,代表該行你必須直接換行;這被使用在多行指令結束輸入時。" +"term:`...`\\ ):如果要重做範例,你必須在提示字元出現的時候,輸入提示字元後方" +"的所有內容;那些非提示字元開始的文字行是直譯器的輸出。注意到在範例中,若出現" +"單行只有次提示字元時,代表該行你必須直接換行;這被使用在多行指令結束輸入時。" #: ../../tutorial/introduction.rst:16 msgid "" @@ -47,9 +47,9 @@ msgid "" "output for an example, then you can easily copy and paste the input lines " "into your interpreter." msgstr "" -"在範例區域中,你可以點擊右上角的 ``>>>`` 來切換是否要顯示提示字元及輸出。若你隱" -"藏了範例中的提示字元及輸出,那麼你就能夠輕易地複製輸入的內容,並貼上到你的直譯" -"器中。" +"在範例區域中,你可以點擊右上角的 ``>>>`` 來切換是否要顯示提示字元及輸出。若你" +"隱藏了範例中的提示字元及輸出,那麼你就能夠輕易地複製輸入的內容,並貼上到你的" +"直譯器中。" #: ../../tutorial/introduction.rst:23 msgid "" @@ -83,8 +83,8 @@ msgid "" "Let's try some simple Python commands. Start the interpreter and wait for " "the primary prompt, ``>>>``. (It shouldn't take long.)" msgstr "" -"讓我們來試試一些簡單的 Python 指令。啟動直譯器並等待第一個主提示字元 ``>>>`` 出" -"現。(應該不會等太久)" +"讓我們來試試一些簡單的 Python 指令。啟動直譯器並等待第一個主提示字元 ``>>>`` " +"出現。(應該不會等太久)" #: ../../tutorial/introduction.rst:51 msgid "Numbers" @@ -115,10 +115,11 @@ msgstr "" "字相關的型態。" #: ../../tutorial/introduction.rst:72 +#, fuzzy msgid "" "Division (``/``) always returns a float. To do :term:`floor division` and " -"get an integer result (discarding any fractional result) you can use the ``//" -"`` operator; to calculate the remainder you can use ``%``::" +"get an integer result you can use the ``//`` operator; to calculate the " +"remainder you can use ``%``::" msgstr "" "除法 (``/``) 永遠回傳一個 float。如果要做 :term:`floor division` 並拿到整數的" "結果(即去除所有小數點的部份),你可以使用 ``//`` 運算子;計算餘數可以使用 ``" @@ -140,8 +141,8 @@ msgid "" "The equal sign (``=``) is used to assign a value to a variable. Afterwards, " "no result is displayed before the next interactive prompt::" msgstr "" -"等於符號 (``=``) 可以用於為變數賦值。賦值完之後,在下個指示字元前並不會顯示任何" -"結果:\n" +"等於符號 (``=``) 可以用於為變數賦值。賦值完之後,在下個指示字元前並不會顯示任" +"何結果:\n" "\n" "::" @@ -634,12 +635,12 @@ msgid "" "(since the parser cannot guess when you have typed the last line). Note " "that each line within a basic block must be indented by the same amount." msgstr "" -"迴圈的主體會\\ *縮排*\\ :縮排在 Python 中用來關連一群陳述式。在互動式提示字元" -"中,你必須在迴圈內的每一行一開始鍵入 tab 或者(數個)空白來維持縮排。實務上," -"你會先在文字編輯器中準備好比較複雜的輸入;多數編輯器都有自動縮排的功能。當一" -"個複合陳述式以互動地方式輸入,必須在結束時多加一行空行來代表結束(因為語法剖" -"析器無法判斷你何時輸入複合陳述的最後一行)。注意在一個縮排段落內的縮排方式與" -"數量必須維持一致。" +"迴圈的主體會\\ *縮排*\\ :縮排在 Python 中用來關連一群陳述式。在互動式提示字" +"元中,你必須在迴圈內的每一行一開始鍵入 tab 或者(數個)空白來維持縮排。實務" +"上,你會先在文字編輯器中準備好比較複雜的輸入;多數編輯器都有自動縮排的功能。" +"當一個複合陳述式以互動地方式輸入,必須在結束時多加一行空行來代表結束(因為語" +"法剖析器無法判斷你何時輸入複合陳述的最後一行)。注意在一個縮排段落內的縮排方" +"式與數量必須維持一致。" #: ../../tutorial/introduction.rst:522 msgid "" From 00d9271c50b03be61ce718a2439e6f1a29f1d667 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 13 Oct 2022 00:25:12 +0000 Subject: [PATCH 13/14] sync with cpython a0c11529 --- faq/general.po | 230 +++++++++------ glossary.po | 598 ++++++++++++++++++++------------------ howto/logging-cookbook.po | 464 ++++++++++++++--------------- library/asyncio-dev.po | 31 +- library/contextlib.po | 238 +++++++-------- library/typing.po | 4 +- tutorial/interpreter.po | 15 +- 7 files changed, 829 insertions(+), 751 deletions(-) diff --git a/faq/general.po b/faq/general.po index ecf4eee930..7728c714ff 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: 2022-09-28 00:27+0000\n" +"POT-Creation-Date: 2022-10-13 00:23+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-" @@ -252,20 +252,32 @@ msgid "How does the Python version numbering scheme work?" msgstr "Python 的版本編號系統是如何運作的?" #: ../../faq/general.rst:128 +msgid "Python versions are numbered \"A.B.C\" or \"A.B\":" +msgstr "" + +#: ../../faq/general.rst:130 +msgid "" +"*A* is the major version number -- it is only incremented for really major " +"changes in the language." +msgstr "" + +#: ../../faq/general.rst:132 msgid "" -"Python versions are numbered A.B.C or A.B. A is the major version number -- " -"it is only incremented for really major changes in the language. B is the " -"minor version number, incremented for less earth-shattering changes. C is " -"the micro-level -- it is incremented for each bugfix release. See :pep:`6` " -"for more information about bugfix releases." +"*B* is the minor version number -- it is incremented for less earth-" +"shattering changes." msgstr "" -"Python 各版本會被編號為 A.B.C 或 A.B。A 是主要版本編號——它只會在語言中有真正" -"重大的變更時才會增加。B 是次要版本編號,它會在沒那麼重大的變更出現時增加。C " -"是微小級別——它會在每個錯誤修正發布版本 (bugfix release) 中增加。有關錯誤修正" -"發布版本的更多資訊,請參閱 :pep:`6`。" #: ../../faq/general.rst:134 msgid "" +"*C* is the micro version number -- it is incremented for each bugfix release." +msgstr "" + +#: ../../faq/general.rst:136 +msgid "See :pep:`6` for more information about bugfix releases." +msgstr "" + +#: ../../faq/general.rst:138 +msgid "" "Not all releases are bugfix releases. In the run-up to a new major release, " "a series of development releases are made, denoted as alpha, beta, or " "release candidate. Alphas are early releases in which interfaces aren't yet " @@ -280,21 +292,31 @@ msgstr "" "不會令人意外。Beta 則更為穩定,保留了現有的介面,但可能會增加新的模組,而候選" "發布版本會被凍結,除了需要修正關鍵錯誤之外,不會再進行任何變更。" -#: ../../faq/general.rst:142 -msgid "" -"Alpha, beta and release candidate versions have an additional suffix. The " -"suffix for an alpha version is \"aN\" for some small number N, the suffix " -"for a beta version is \"bN\" for some small number N, and the suffix for a " -"release candidate version is \"rcN\" for some small number N. In other " -"words, all versions labeled 2.0aN precede the versions labeled 2.0bN, which " -"precede versions labeled 2.0rcN, and *those* precede 2.0." +#: ../../faq/general.rst:146 +msgid "Alpha, beta and release candidate versions have an additional suffix:" +msgstr "" + +#: ../../faq/general.rst:148 +msgid "The suffix for an alpha version is \"aN\" for some small number *N*." msgstr "" -"Alpha、beta 和候選發布版本都有一個額外的後綴。Alpha 版本的後綴是「aN」,beta " -"版本的後綴是「bN」,候選發布版本的後綴是「rcN」,其中 N 都是某個小的數字。換" -"句話說,所有標記為 2.0aN 的版本,順序都在標記為 2.0bN 的版本之前,而 2.0bN 版" -"本都在標記為 2.0rcN 的版本之前,而\\ *它們*\\ 都是在 2.0 版之前。" #: ../../faq/general.rst:149 +msgid "The suffix for a beta version is \"bN\" for some small number *N*." +msgstr "" + +#: ../../faq/general.rst:150 +msgid "" +"The suffix for a release candidate version is \"rcN\" for some small number " +"*N*." +msgstr "" + +#: ../../faq/general.rst:152 +msgid "" +"In other words, all versions labeled *2.0aN* precede the versions labeled " +"*2.0bN*, which precede versions labeled *2.0rcN*, and *those* precede 2.0." +msgstr "" + +#: ../../faq/general.rst:155 msgid "" "You may also find version numbers with a \"+\" suffix, e.g. \"2.2+\". These " "are unreleased versions, built directly from the CPython development " @@ -306,7 +328,7 @@ msgstr "" "從 CPython 的開發儲存庫被建置。實際上,在每一次的最終次要版本發布完成之後,版" "本編號將會被增加到下一個次要版本,並成為「a0」版,例如「2.4a0」。" -#: ../../faq/general.rst:154 +#: ../../faq/general.rst:160 msgid "" "See also the documentation for :data:`sys.version`, :data:`sys.hexversion`, " "and :data:`sys.version_info`." @@ -314,11 +336,11 @@ msgstr "" "另請參閱 :data:`sys.version`、\\ :data:`sys.hexversion` 和 :data:`sys." "version_info` 的說明文件。" -#: ../../faq/general.rst:159 +#: ../../faq/general.rst:165 msgid "How do I obtain a copy of the Python source?" msgstr "我要如何得到 Python 的原始碼複本?" -#: ../../faq/general.rst:161 +#: ../../faq/general.rst:167 msgid "" "The latest Python source distribution is always available from python.org, " "at https://www.python.org/downloads/. The latest development sources can be " @@ -328,7 +350,7 @@ msgstr "" "org/downloads/。最新的開發中原始碼可以在 https://github.com/python/cpython/ " "取得。" -#: ../../faq/general.rst:165 +#: ../../faq/general.rst:171 msgid "" "The source distribution is a gzipped tar file containing the complete C " "source, Sphinx-formatted documentation, Python library modules, example " @@ -339,7 +361,7 @@ msgstr "" "說明文件、Python 函式庫模組、範例程式,以及幾個好用的可自由發行軟體。該原始碼" "在大多數 UNIX 平台上,都是可以立即編譯及運行的。" -#: ../../faq/general.rst:170 +#: ../../faq/general.rst:176 msgid "" "Consult the `Getting Started section of the Python Developer's Guide " "`__ for more information on getting the " @@ -348,11 +370,11 @@ msgstr "" "關於取得和編譯原始碼的詳細資訊,請參閱 `Python 開發人員指南中的 \"Getting " "Started\" 段落 `__。" -#: ../../faq/general.rst:176 +#: ../../faq/general.rst:182 msgid "How do I get documentation on Python?" msgstr "我要如何取得 Python 的說明文件?" -#: ../../faq/general.rst:180 +#: ../../faq/general.rst:186 msgid "" "The standard documentation for the current stable version of Python is " "available at https://docs.python.org/3/. PDF, plain text, and downloadable " @@ -362,7 +384,7 @@ msgstr "" "純文字和可下載的 HTML 版本也可在 https://docs.python.org/3/download.html 找" "到。" -#: ../../faq/general.rst:184 +#: ../../faq/general.rst:190 msgid "" "The documentation is written in reStructuredText and processed by `the " "Sphinx documentation tool `__. The " @@ -373,17 +395,17 @@ msgstr "" "sphinx-doc.org/>`__\\ 處理。說明文件的 reStructuredText 原始碼是 Python 原始" "碼發行版的一部分。" -#: ../../faq/general.rst:190 +#: ../../faq/general.rst:196 msgid "I've never programmed before. Is there a Python tutorial?" msgstr "我從來沒有寫過程式,有沒有 Python 的教學?" -#: ../../faq/general.rst:192 +#: ../../faq/general.rst:198 msgid "" "There are numerous tutorials and books available. The standard " "documentation includes :ref:`tutorial-index`." msgstr "有許多可用的教學和書籍。標準說明文件包括 :ref:`tutorial-index`。" -#: ../../faq/general.rst:195 +#: ../../faq/general.rst:201 msgid "" "Consult `the Beginner's Guide `_ to find information for beginning Python programmers, " @@ -392,11 +414,11 @@ msgstr "" "要尋找 Python 程式設計初學者的資訊,包括教學資源列表,請參閱\\ `初學者指南 " "`_。" -#: ../../faq/general.rst:200 +#: ../../faq/general.rst:206 msgid "Is there a newsgroup or mailing list devoted to Python?" msgstr "有沒有 Python 專屬的新聞群組或郵件討論群?" -#: ../../faq/general.rst:202 +#: ../../faq/general.rst:208 msgid "" "There is a newsgroup, :newsgroup:`comp.lang.python`, and a mailing list, " "`python-list `_. The " @@ -411,7 +433,7 @@ msgstr "" "入郵件討論群。\\ :newsgroup:`comp.lang.python` 的流量很高,每天會收到數百篇文" "章,而 Usenet 的讀者通常較能夠處理這樣的文章數量。" -#: ../../faq/general.rst:209 +#: ../../faq/general.rst:215 msgid "" "Announcements of new software releases and events can be found in comp.lang." "python.announce, a low-traffic moderated list that receives about five " @@ -423,7 +445,7 @@ msgstr "" "論群 `_\\ 的頁" "面中訂閱。" -#: ../../faq/general.rst:214 +#: ../../faq/general.rst:220 msgid "" "More info about other mailing lists and newsgroups can be found at https://" "www.python.org/community/lists/." @@ -431,11 +453,11 @@ msgstr "" "關於其他郵件討論群和新聞群組的更多資訊,可以在 https://www.python.org/" "community/lists/ 中找到。" -#: ../../faq/general.rst:219 +#: ../../faq/general.rst:225 msgid "How do I get a beta test version of Python?" msgstr "如何取得 Python 的 beta 測試版本?" -#: ../../faq/general.rst:221 +#: ../../faq/general.rst:227 msgid "" "Alpha and beta releases are available from https://www.python.org/" "downloads/. All releases are announced on the comp.lang.python and comp." @@ -446,7 +468,7 @@ msgstr "" "布版本都會在 comp.lang.python 和 comp.lang.python.announce 新聞群組上宣布,也" "會在 Python 首頁 https://www.python.org/ 中宣布;RSS 新聞摘要也是可使用的。" -#: ../../faq/general.rst:226 +#: ../../faq/general.rst:232 msgid "" "You can also access the development version of Python through Git. See `The " "Python Developer's Guide `_ for details." @@ -454,11 +476,11 @@ msgstr "" "你也可以藉由 Git 來存取 Python 的開發版本。更多詳細資訊,請參閱 `Python 開發" "人員指南 `_。" -#: ../../faq/general.rst:231 +#: ../../faq/general.rst:237 msgid "How do I submit bug reports and patches for Python?" msgstr "如何提交 Python 的錯誤報告和修補程式?" -#: ../../faq/general.rst:233 +#: ../../faq/general.rst:239 msgid "" "To report a bug or submit a patch, please use the Roundup installation at " "https://bugs.python.org/" @@ -466,7 +488,7 @@ msgstr "" "要回報一個錯誤 (bug) 或提交一個修補程式 (patch),請使用 https://bugs.python." "org/ 的 Roundup 安裝。" -#: ../../faq/general.rst:236 +#: ../../faq/general.rst:242 msgid "" "You must have a Roundup account to report bugs; this makes it possible for " "us to contact you if we have follow-up questions. It will also enable " @@ -481,7 +503,7 @@ msgstr "" "過程 `_,取得你的 Roundup " "密碼。" -#: ../../faq/general.rst:242 +#: ../../faq/general.rst:248 msgid "" "For more information on how Python is developed, consult `the Python " "Developer's Guide `_." @@ -489,21 +511,21 @@ msgstr "" "關於如何開發 Python 的更多資訊,請參閱 `Python 開發人員指南 `_。" -#: ../../faq/general.rst:247 +#: ../../faq/general.rst:253 msgid "Are there any published articles about Python that I can reference?" msgstr "是否有關於 Python 的任何已出版文章可供參考?" -#: ../../faq/general.rst:249 +#: ../../faq/general.rst:255 msgid "It's probably best to cite your favorite book about Python." msgstr "也許最好是引用你最喜歡的關於 Python 的書。" -#: ../../faq/general.rst:251 +#: ../../faq/general.rst:257 msgid "" "The very first article about Python was written in 1991 and is now quite " "outdated." msgstr "最早討論 Python 的文章是在 1991 年寫的,但現在來看已經過時了。" -#: ../../faq/general.rst:254 +#: ../../faq/general.rst:260 msgid "" "Guido van Rossum and Jelke de Boer, \"Interactively Testing Remote Servers " "Using the Python Programming Language\", CWI Quarterly, Volume 4, Issue 4 " @@ -513,11 +535,11 @@ msgstr "" "服器」,CWI 季刊,第 4 卷,第 4 期(1991 年 12 月),阿姆斯特丹,第 283–303 " "頁。" -#: ../../faq/general.rst:260 +#: ../../faq/general.rst:266 msgid "Are there any books on Python?" msgstr "有沒有關於 Python 的書?" -#: ../../faq/general.rst:262 +#: ../../faq/general.rst:268 msgid "" "Yes, there are many, and more are being published. See the python.org wiki " "at https://wiki.python.org/moin/PythonBooks for a list." @@ -525,7 +547,7 @@ msgstr "" "有,很多書已經出版,也有更多正在出版中的書。請參閱 python.org 的 wiki 在 " "https://wiki.python.org/moin/PythonBooks%20%E9%A0%81%E9%9D%A2%E4%B8%AD%E7%9A%84%E6%9B%B8%E7%9B%AE%E6%B8%85%E5%96%AE%E3%80%82" -#: ../../faq/general.rst:265 +#: ../../faq/general.rst:271 msgid "" "You can also search online bookstores for \"Python\" and filter out the " "Monty Python references; or perhaps search for \"Python\" and \"language\"." @@ -533,11 +555,11 @@ msgstr "" "你也可以在網路書店搜尋關鍵字「Python」,並過濾掉 Monty Python 的結果;或者可" "以搜尋「Python」和「語言」。" -#: ../../faq/general.rst:270 +#: ../../faq/general.rst:276 msgid "Where in the world is www.python.org located?" msgstr "www.python.org 的真實位置在哪裡?" -#: ../../faq/general.rst:272 +#: ../../faq/general.rst:278 msgid "" "The Python project's infrastructure is located all over the world and is " "managed by the Python Infrastructure Team. Details `here `__。" -#: ../../faq/general.rst:277 +#: ../../faq/general.rst:283 msgid "Why is it called Python?" msgstr "為什麼要取名為 Python?" -#: ../../faq/general.rst:279 +#: ../../faq/general.rst:285 msgid "" "When he began implementing Python, Guido van Rossum was also reading the " "published scripts from `\"Monty Python's Flying Circus\" `__\\ 的出版劇本。Van Rossum 認為他需要一個簡短、獨特且略帶神秘" "的名字,因此他決定將該語言稱為 Python。" -#: ../../faq/general.rst:287 +#: ../../faq/general.rst:293 msgid "Do I have to like \"Monty Python's Flying Circus\"?" msgstr "我需要喜歡「Monty Python 的飛行馬戲團」嗎?" -#: ../../faq/general.rst:289 +#: ../../faq/general.rst:295 msgid "No, but it helps. :)" msgstr "不需要,但它有幫助。:)" -#: ../../faq/general.rst:293 +#: ../../faq/general.rst:299 msgid "Python in the real world" msgstr "在真實世界中的 Python" -#: ../../faq/general.rst:296 +#: ../../faq/general.rst:302 msgid "How stable is Python?" msgstr "Python 的穩定性如何?" -#: ../../faq/general.rst:298 +#: ../../faq/general.rst:304 msgid "" "Very stable. New, stable releases have been coming out roughly every 6 to " "18 months since 1991, and this seems likely to continue. As of version 3.9, " @@ -589,7 +611,7 @@ msgstr "" "看起來會繼續進行。從 3.9 版開始,Python 每隔 12 個月將會釋出一個主要的發行版" "本 (:pep:`602`)。" -#: ../../faq/general.rst:302 +#: ../../faq/general.rst:308 msgid "" "The developers issue \"bugfix\" releases of older versions, so the stability " "of existing releases gradually improves. Bugfix releases, indicated by a " @@ -603,7 +625,7 @@ msgstr "" "這些版本會被用於改善穩定性;在錯誤修正發布版本中,只會包含針對已知問題的修" "正,並且會保證介面在一系列的錯誤修正發布版本中維持不變。" -#: ../../faq/general.rst:309 +#: ../../faq/general.rst:315 msgid "" "The latest stable releases can always be found on the `Python download page " "`_. There are two production-ready " @@ -617,17 +639,17 @@ msgstr "" "仍然被廣泛使用,但\\ `它已不再被維護 `_。" -#: ../../faq/general.rst:316 +#: ../../faq/general.rst:322 msgid "How many people are using Python?" msgstr "有多少人在使用 Python?" -#: ../../faq/general.rst:318 +#: ../../faq/general.rst:324 msgid "" "There are probably millions of users, though it's difficult to obtain an " "exact count." msgstr "可能有幾百萬個使用者,但實際的數量是難以確定的。" -#: ../../faq/general.rst:321 +#: ../../faq/general.rst:327 msgid "" "Python is available for free download, so there are no sales figures, and " "it's available from many different sites and packaged with many Linux " @@ -636,7 +658,7 @@ msgstr "" "Python 是可以免費下載的,所以不會有銷售數據,而且它可以從許多不同的網站取得," "並與許多 Linux 發行版套裝在一起,所以下載次數的統計也無法反映完整的情況。" -#: ../../faq/general.rst:325 +#: ../../faq/general.rst:331 msgid "" "The comp.lang.python newsgroup is very active, but not all Python users post " "to the group or even read it." @@ -644,11 +666,11 @@ msgstr "" "comp.lang.python 新聞群組非常活躍,但並非所有 Python 使用者都會在該群組發表文" "章或甚至閱讀它。" -#: ../../faq/general.rst:330 +#: ../../faq/general.rst:336 msgid "Have any significant projects been done in Python?" msgstr "有沒有任何重要的專案使用 Python 完成開發?" -#: ../../faq/general.rst:332 +#: ../../faq/general.rst:338 msgid "" "See https://www.python.org/about/success for a list of projects that use " "Python. Consulting the proceedings for `past Python conferences `_\\ 可以看見來自許多不同公司和組織的貢獻。" -#: ../../faq/general.rst:337 +#: ../../faq/general.rst:343 msgid "" "High-profile Python projects include `the Mailman mailing list manager " "`_ and `the Zope application server `_." @@ -699,11 +721,11 @@ msgstr "" "新的開發會在 `python-dev 郵件討論群 `_\\ 中討論。" -#: ../../faq/general.rst:359 +#: ../../faq/general.rst:365 msgid "Is it reasonable to propose incompatible changes to Python?" msgstr "對 Python 提出不相容的變更建議是否適當?" -#: ../../faq/general.rst:361 +#: ../../faq/general.rst:367 msgid "" "In general, no. There are already millions of lines of Python code around " "the world, so any change in the language that invalidates more than a very " @@ -717,7 +739,7 @@ msgstr "" "式,仍然會有需要更新全部說明文件的問題;市面上已經有很多介紹 Python 的書,而" "我們不想一下子就把它們都變為無效。" -#: ../../faq/general.rst:368 +#: ../../faq/general.rst:374 msgid "" "Providing a gradual upgrade path is necessary if a feature has to be " "changed. :pep:`5` describes the procedure followed for introducing backward-" @@ -727,15 +749,15 @@ msgstr "" "進反向不相容 (backward-incompatible) 的變更,同時也要對使用者的擾亂最小化,所" "需遵循的程序。" -#: ../../faq/general.rst:374 +#: ../../faq/general.rst:380 msgid "Is Python a good language for beginning programmers?" msgstr "Python 對於入門的程式設計師而言是否為好的語言?" -#: ../../faq/general.rst:376 +#: ../../faq/general.rst:382 msgid "Yes." msgstr "是的。" -#: ../../faq/general.rst:378 +#: ../../faq/general.rst:384 msgid "" "It is still common to start students with a procedural and statically typed " "language such as Pascal, C, or a subset of C++ or Java. Students may be " @@ -755,7 +777,7 @@ msgstr "" "速地向學生介紹基本觀念,例如迴圈和程序。他們甚至可能在第一堂課中就學到使用者" "自訂的物件。" -#: ../../faq/general.rst:388 +#: ../../faq/general.rst:394 msgid "" "For a student who has never programmed before, using a statically typed " "language seems unnatural. It presents additional complexity that the " @@ -771,7 +793,7 @@ msgstr "" "考、分解問題、設計一致的介面,並封裝資料。雖然從長遠來看,學習使用靜態型別語" "言很重要,但在學生的第一堂程式設計課程中,它不一定是最好的課程主題。" -#: ../../faq/general.rst:396 +#: ../../faq/general.rst:402 msgid "" "Many other aspects of Python make it a good first language. Like Java, " "Python has a large standard library so that students can be assigned " @@ -790,7 +812,7 @@ msgstr "" "用程式的滿足感。使用標準函式庫還可以教導學生程式碼再使用 (code reuse) 的課" "題。像是 PyGame 等第三方模組也有助於延伸學生的學習領域。" -#: ../../faq/general.rst:405 +#: ../../faq/general.rst:411 msgid "" "Python's interactive interpreter enables students to test language features " "while they're programming. They can keep a window with the interpreter " @@ -803,21 +825,22 @@ msgstr "" "\n" "::" -#: ../../faq/general.rst:434 +#: ../../faq/general.rst:440 msgid "" "With the interpreter, documentation is never far from the student as they " "are programming." msgstr "有了直譯器,當學生正在程式設計時,說明文件永遠都不會遠離他們。" -#: ../../faq/general.rst:437 +#: ../../faq/general.rst:443 +#, fuzzy msgid "" "There are also good IDEs for Python. IDLE is a cross-platform IDE for " -"Python that is written in Python using Tkinter. PythonWin is a Windows-" -"specific IDE. Emacs users will be happy to know that there is a very good " -"Python mode for Emacs. All of these programming environments provide syntax " -"highlighting, auto-indenting, and access to the interactive interpreter " -"while coding. Consult `the Python wiki `_ for a full list of Python editing environments." +"Python that is written in Python using Tkinter. Emacs users will be happy to " +"know that there is a very good Python mode for Emacs. All of these " +"programming environments provide syntax highlighting, auto-indenting, and " +"access to the interactive interpreter while coding. Consult `the Python " +"wiki `_ for a full list of " +"Python editing environments." msgstr "" "Python 也有很好的 IDE。IDLE 是 Python 的一個跨平臺 IDE,它以 Python 編寫並使" "用 Tkinter。PythonWin 是一個 Windows 特有的 IDE。Emacs 使用者會很高興知道 " @@ -826,7 +849,7 @@ msgstr "" "Python 編輯環境的完整清單,請參閱 `Python wiki `_。" -#: ../../faq/general.rst:445 +#: ../../faq/general.rst:451 msgid "" "If you want to discuss Python's use in education, you may be interested in " "joining `the edu-sig mailing list `_。" + +#~ msgid "" +#~ "Python versions are numbered A.B.C or A.B. A is the major version number " +#~ "-- it is only incremented for really major changes in the language. B is " +#~ "the minor version number, incremented for less earth-shattering changes. " +#~ "C is the micro-level -- it is incremented for each bugfix release. See :" +#~ "pep:`6` for more information about bugfix releases." +#~ msgstr "" +#~ "Python 各版本會被編號為 A.B.C 或 A.B。A 是主要版本編號——它只會在語言中有真" +#~ "正重大的變更時才會增加。B 是次要版本編號,它會在沒那麼重大的變更出現時增" +#~ "加。C 是微小級別——它會在每個錯誤修正發布版本 (bugfix release) 中增加。有關" +#~ "錯誤修正發布版本的更多資訊,請參閱 :pep:`6`。" + +#~ msgid "" +#~ "Alpha, beta and release candidate versions have an additional suffix. " +#~ "The suffix for an alpha version is \"aN\" for some small number N, the " +#~ "suffix for a beta version is \"bN\" for some small number N, and the " +#~ "suffix for a release candidate version is \"rcN\" for some small number " +#~ "N. In other words, all versions labeled 2.0aN precede the versions " +#~ "labeled 2.0bN, which precede versions labeled 2.0rcN, and *those* precede " +#~ "2.0." +#~ msgstr "" +#~ "Alpha、beta 和候選發布版本都有一個額外的後綴。Alpha 版本的後綴是「aN」," +#~ "beta 版本的後綴是「bN」,候選發布版本的後綴是「rcN」,其中 N 都是某個小的" +#~ "數字。換句話說,所有標記為 2.0aN 的版本,順序都在標記為 2.0bN 的版本之前," +#~ "而 2.0bN 版本都在標記為 2.0rcN 的版本之前,而\\ *它們*\\ 都是在 2.0 版之" +#~ "前。" diff --git a/glossary.po b/glossary.po index 80f9402e2c..46d69b50a5 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-09-30 00:28+0000\n" +"POT-Creation-Date: 2022-10-13 00:23+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-" @@ -322,8 +322,8 @@ msgid "" "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* 被參照。" +"一個與某物件相關聯的值,該值大多能透過使用點分隔運算式 (dotted expression) 的" +"名稱被參照。例如,如果物件 *o* 有一個屬性 *a*,則該屬性能以 *o.a* 被參照。" #: ../../glossary.rst:144 msgid "" @@ -480,21 +480,39 @@ msgstr "" "位元組碼的指令列表可以在 :ref:`dis 模組 `\\ 的說明文件中找到。" #: ../../glossary.rst:212 -msgid "callback" +#, fuzzy +msgid "callable" msgstr "callback(回呼)" #: ../../glossary.rst:214 msgid "" +"A callable is an object that can be called, possibly with a set of arguments " +"(see :term:`argument`), with the following syntax::" +msgstr "" + +#: ../../glossary.rst:219 +msgid "" +"A :term:`function`, and by extension a :term:`method`, is a callable. An " +"instance of a class that implements the :meth:`~object.__call__` method is " +"also a callable." +msgstr "" + +#: ../../glossary.rst:222 +msgid "callback" +msgstr "callback(回呼)" + +#: ../../glossary.rst:224 +msgid "" "A subroutine function which is passed as an argument to be executed at some " "point in the future." msgstr "" "作為引數被傳遞的一個副程式 (subroutine) 函式,會在未來的某個時間點被執行。" -#: ../../glossary.rst:216 +#: ../../glossary.rst:226 msgid "class" msgstr "class(類別)" -#: ../../glossary.rst:218 +#: ../../glossary.rst:228 msgid "" "A template for creating user-defined objects. Class definitions normally " "contain method definitions which operate on instances of the class." @@ -502,11 +520,11 @@ msgstr "" "一個用於建立使用者定義物件的模板。Class 的定義通常會包含 method 的定義,這些 " "method 可以在 class 的實例上進行操作。" -#: ../../glossary.rst:221 +#: ../../glossary.rst:231 msgid "class variable" msgstr "class variable(類別變數)" -#: ../../glossary.rst:223 +#: ../../glossary.rst:233 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)." @@ -514,11 +532,11 @@ msgstr "" "一個在 class 中被定義,且應該只能在 class 層次(意即不是在 class 的實例中)被" "修改的變數。" -#: ../../glossary.rst:225 +#: ../../glossary.rst:235 msgid "coercion" msgstr "coercion(強制轉型)" -#: ../../glossary.rst:227 +#: ../../glossary.rst:237 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, " @@ -536,11 +554,11 @@ msgstr "" "\\ 。如果沒有強制轉型,即使所有的引數型別皆相容,它們都必須要由程式設計師正規" "化 (normalize) 為相同的值,例如,要用 ``float(3)+4.5`` 而不能只是 ``3+4.5``。" -#: ../../glossary.rst:235 +#: ../../glossary.rst:245 msgid "complex number" msgstr "complex number(複數)" -#: ../../glossary.rst:237 +#: ../../glossary.rst:247 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 " @@ -560,11 +578,11 @@ msgstr "" "相當進階的數學功能。如果你沒有察覺到對它們的需求,那麼幾乎能確定你可以安全地" "忽略它們。" -#: ../../glossary.rst:247 +#: ../../glossary.rst:257 msgid "context manager" msgstr "context manager(情境管理器)" -#: ../../glossary.rst:249 +#: ../../glossary.rst:259 msgid "" "An object which controls the environment seen in a :keyword:`with` statement " "by defining :meth:`__enter__` and :meth:`__exit__` methods. See :pep:`343`." @@ -572,11 +590,11 @@ msgstr "" "一個可以控制 :keyword:`with` 陳述式中所見環境的物件,而它是透過定義 :meth:" "`__enter__` 和 :meth:`__exit__` method 來控制的。請參閱 :pep:`343`\\ 。" -#: ../../glossary.rst:252 +#: ../../glossary.rst:262 msgid "context variable" msgstr "context variable(情境變數)" -#: ../../glossary.rst:254 +#: ../../glossary.rst:264 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 " @@ -591,11 +609,11 @@ msgstr "" "任務 (concurrent asynchronous task) 中,對於變數狀態的追蹤。請參閱 :mod:" "`contextvars`\\ 。" -#: ../../glossary.rst:261 +#: ../../glossary.rst:271 msgid "contiguous" msgstr "contiguous(連續的)" -#: ../../glossary.rst:265 +#: ../../glossary.rst:275 msgid "" "A buffer is considered contiguous exactly if it is either *C-contiguous* or " "*Fortran contiguous*. Zero-dimensional buffers are C and Fortran " @@ -612,11 +630,11 @@ msgstr "" "的順序訪問各個項目時,最後一個索引的變化最快。然而,在 Fortran contiguous 陣" "列中,第一個索引的變化最快。" -#: ../../glossary.rst:273 +#: ../../glossary.rst:283 msgid "coroutine" msgstr "coroutine(協程)" -#: ../../glossary.rst:275 +#: ../../glossary.rst:285 msgid "" "Coroutines are a more generalized form of subroutines. Subroutines are " "entered at one point and exited at another point. Coroutines can be " @@ -627,11 +645,11 @@ msgstr "" "在另一個時間點被退出。協程可以在許多不同的時間點被進入、退出和回復。它們能夠" "以 :keyword:`async def` 陳述式被實作。另請參閱 :pep:`492`\\ 。" -#: ../../glossary.rst:280 +#: ../../glossary.rst:290 msgid "coroutine function" msgstr "coroutine function(協程函式)" -#: ../../glossary.rst:282 +#: ../../glossary.rst:292 msgid "" "A function which returns a :term:`coroutine` object. A coroutine function " "may be defined with the :keyword:`async def` statement, and may contain :" @@ -642,11 +660,11 @@ msgstr "" "`async def` 陳述式被定義,並可能會包含 :keyword:`await`\\ 、\\ :keyword:" "`async for` 和 :keyword:`async with` 關鍵字。這些關鍵字由 :pep:`492` 引入。" -#: ../../glossary.rst:287 +#: ../../glossary.rst:297 msgid "CPython" msgstr "CPython" -#: ../../glossary.rst:289 +#: ../../glossary.rst:299 msgid "" "The canonical implementation of the Python programming language, as " "distributed on `python.org `_. The term \"CPython\" " @@ -657,11 +675,11 @@ msgstr "" "`_ 上。「CPython」這個術語在必要時被使用,以區分此實" "作與其它語言的實作,例如 Jython 或 IronPython。" -#: ../../glossary.rst:293 +#: ../../glossary.rst:303 msgid "decorator" msgstr "decorator(裝飾器)" -#: ../../glossary.rst:295 +#: ../../glossary.rst:305 msgid "" "A function returning another function, usually applied as a function " "transformation using the ``@wrapper`` syntax. Common examples for " @@ -671,7 +689,7 @@ msgstr "" "式的變換 (function transformation)。裝飾器的常見範例是 :func:`classmethod` " "和 :func:`staticmethod`\\ 。" -#: ../../glossary.rst:299 +#: ../../glossary.rst:309 msgid "" "The decorator syntax is merely syntactic sugar, the following two function " "definitions are semantically equivalent::" @@ -680,7 +698,7 @@ msgstr "" "\n" "::" -#: ../../glossary.rst:310 +#: ../../glossary.rst:320 msgid "" "The same concept exists for classes, but is less commonly used there. See " "the documentation for :ref:`function definitions ` and :ref:`class " @@ -689,11 +707,11 @@ msgstr "" "Class 也存在相同的概念,但在那裡比較不常用。關於裝飾器的更多內容,請參閱\\ :" "ref:`函式定義 `\\ 和 :ref:`class 定義 `\\ 的說明文件。" -#: ../../glossary.rst:313 +#: ../../glossary.rst:323 msgid "descriptor" msgstr "descriptor(描述器)" -#: ../../glossary.rst:315 +#: ../../glossary.rst:325 msgid "" "Any object which defines the methods :meth:`__get__`, :meth:`__set__`, or :" "meth:`__delete__`. When a class attribute is a descriptor, its special " @@ -713,7 +731,7 @@ msgstr "" "這些功能包括函式、method、屬性 (property)、class method、靜態 method,以及對 " "super class(父類別)的參照。" -#: ../../glossary.rst:325 +#: ../../glossary.rst:335 msgid "" "For more information about descriptors' methods, see :ref:`descriptors` or " "the :ref:`Descriptor How To Guide `." @@ -721,11 +739,11 @@ msgstr "" "關於描述器 method 的更多資訊,請參閱\\ :ref:`descriptors`\\ 或\\ :ref:`描述器" "使用指南 `\\ 。" -#: ../../glossary.rst:327 +#: ../../glossary.rst:337 msgid "dictionary" msgstr "dictionary(字典)" -#: ../../glossary.rst:329 +#: ../../glossary.rst:339 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 " @@ -735,11 +753,11 @@ msgstr "" "有 :meth:`__hash__` 和 :meth:`__eq__` method 的物件。在 Perl 中被稱為雜湊 " "(hash)。" -#: ../../glossary.rst:332 +#: ../../glossary.rst:342 msgid "dictionary comprehension" msgstr "dictionary comprehension(字典綜合運算)" -#: ../../glossary.rst:334 +#: ../../glossary.rst:344 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 " @@ -750,11 +768,11 @@ msgstr "" "字典回傳。``results = {n: n ** 2 for n in range(10)}`` 會產生一個字典,它包含" "了鍵 ``n`` 映射到值 ``n ** 2``。請參閱\\ :ref:`comprehensions`\\ 。" -#: ../../glossary.rst:338 +#: ../../glossary.rst:348 msgid "dictionary view" msgstr "dictionary view(字典檢視)" -#: ../../glossary.rst:340 +#: ../../glossary.rst:350 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 " @@ -767,11 +785,11 @@ msgstr "" "檢視會反映這些變動。若要強制將字典檢視轉為完整的 list(串列),須使用 " "``list(dictview)``。請參閱\\ :ref:`dict-views`\\ 。" -#: ../../glossary.rst:346 +#: ../../glossary.rst:356 msgid "docstring" msgstr "docstring(說明字串)" -#: ../../glossary.rst:348 +#: ../../glossary.rst:358 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 " @@ -784,11 +802,11 @@ msgstr "" "`__doc__` 屬性中。由於說明字串可以透過內省 (introspection) 來瀏覽,因此它是物" "件的說明文件存放的標準位置。" -#: ../../glossary.rst:354 +#: ../../glossary.rst:364 msgid "duck-typing" msgstr "duck-typing(鴨子型別)" -#: ../../glossary.rst:356 +#: ../../glossary.rst:366 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 " @@ -809,11 +827,11 @@ msgstr "" "來補充。)然而,它通常會採用 :func:`hasattr` 測試,或是 :term:`EAFP` 程式設計" "風格。" -#: ../../glossary.rst:365 +#: ../../glossary.rst:375 msgid "EAFP" msgstr "EAFP" -#: ../../glossary.rst:367 +#: ../../glossary.rst:377 msgid "" "Easier to ask for forgiveness than permission. This common Python coding " "style assumes the existence of valid keys or attributes and catches " @@ -828,11 +846,11 @@ msgstr "" "keyword:`except` 陳述式。該技術與許多其他語言(例如 C)常見的 :term:`LBYL` 風" "格形成了對比。" -#: ../../glossary.rst:373 +#: ../../glossary.rst:383 msgid "expression" msgstr "expression(運算式)" -#: ../../glossary.rst:375 +#: ../../glossary.rst:385 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, " @@ -848,11 +866,11 @@ msgstr "" "(陳述式)不能被用作運算式,例如 :keyword:`while`\\ 。賦值 (assignment) 也是" "陳述式,而不是運算式。" -#: ../../glossary.rst:382 +#: ../../glossary.rst:392 msgid "extension module" msgstr "extension module(擴充模組)" -#: ../../glossary.rst:384 +#: ../../glossary.rst:394 msgid "" "A module written in C or C++, using Python's C API to interact with the core " "and with user code." @@ -860,11 +878,11 @@ msgstr "" "一個以 C 或 C++ 編寫的模組,它使用 Python 的 C API 來與核心及使用者程式碼進行" "互動。" -#: ../../glossary.rst:386 +#: ../../glossary.rst:396 msgid "f-string" msgstr "f-string(f 字串)" -#: ../../glossary.rst:388 +#: ../../glossary.rst:398 msgid "" "String literals prefixed with ``'f'`` or ``'F'`` are commonly called \"f-" "strings\" which is short for :ref:`formatted string literals `. " @@ -873,11 +891,11 @@ msgstr "" "以 ``'f'`` 或 ``'F'`` 為前綴的字串文本通常被稱為「f 字串」,它是\\ :ref:`格式" "化的字串文本 `\\ 的縮寫。另請參閱 :pep:`498`\\ 。" -#: ../../glossary.rst:391 +#: ../../glossary.rst:401 msgid "file object" msgstr "file object(檔案物件)" -#: ../../glossary.rst:393 +#: ../../glossary.rst:403 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 " @@ -892,7 +910,7 @@ msgstr "" "緩衝區、socket(插座)、管線 (pipe) 等)的存取。檔案物件也被稱為\\ :dfn:`類檔" "案物件 (file-like object)` 或\\ :dfn:`串流 (stream)`\\ 。" -#: ../../glossary.rst:401 +#: ../../glossary.rst:411 msgid "" "There are actually three categories of file objects: raw :term:`binary files " "`, buffered :term:`binary files ` and :term:`text " @@ -905,19 +923,19 @@ msgstr "" "它們的介面在 :mod:`io` 模組中被定義。建立檔案物件的標準方法是使用 :func:" "`open` 函式。" -#: ../../glossary.rst:406 +#: ../../glossary.rst:416 msgid "file-like object" msgstr "file-like object(類檔案物件)" -#: ../../glossary.rst:408 +#: ../../glossary.rst:418 msgid "A synonym for :term:`file object`." msgstr ":term:`file object`\\ (檔案物件)的同義字。" -#: ../../glossary.rst:409 +#: ../../glossary.rst:419 msgid "filesystem encoding and error handler" msgstr "filesystem encoding and error handler(檔案系統編碼和錯誤處理函式)" -#: ../../glossary.rst:411 +#: ../../glossary.rst:421 msgid "" "Encoding and error handler used by Python to decode bytes from the operating " "system and encode Unicode to the operating system." @@ -925,7 +943,7 @@ msgstr "" "Python 所使用的一種編碼和錯誤處理函式,用來解碼來自作業系統的位元組,以及將 " "Unicode 編碼到作業系統。" -#: ../../glossary.rst:414 +#: ../../glossary.rst:424 msgid "" "The filesystem encoding must guarantee to successfully decode all bytes " "below 128. If the file system encoding fails to provide this guarantee, API " @@ -934,7 +952,7 @@ msgstr "" "檔案系統編碼必須保證能成功解碼所有小於 128 的位元組。如果檔案系統編碼無法提供" "此保證,則 API 函式會引發 :exc:`UnicodeError`\\ 。" -#: ../../glossary.rst:418 +#: ../../glossary.rst:428 msgid "" "The :func:`sys.getfilesystemencoding` and :func:`sys." "getfilesystemencodeerrors` functions can be used to get the filesystem " @@ -943,7 +961,7 @@ msgstr "" ":func:`sys.getfilesystemencoding` 和 :func:`sys.getfilesystemencodeerrors` 函" "式可用於取得檔案系統編碼和錯誤處理函式。" -#: ../../glossary.rst:422 +#: ../../glossary.rst:432 msgid "" "The :term:`filesystem encoding and error handler` are configured at Python " "startup by the :c:func:`PyConfig_Read` function: see :c:member:`~PyConfig." @@ -955,22 +973,22 @@ msgstr "" "member:`~PyConfig.filesystem_encoding`\\ ,以及 :c:type:`PyConfig` 的成員 :c:" "member:`~PyConfig.filesystem_errors`\\ 。" -#: ../../glossary.rst:427 +#: ../../glossary.rst:437 msgid "See also the :term:`locale encoding`." msgstr "另請參閱 :term:`locale encoding`\\ (區域編碼)。" -#: ../../glossary.rst:428 +#: ../../glossary.rst:438 msgid "finder" msgstr "finder(尋檢器)" -#: ../../glossary.rst:430 +#: ../../glossary.rst:440 msgid "" "An object that tries to find the :term:`loader` for a module that is being " "imported." msgstr "" "一個物件,它會嘗試為正在被 import 的模組尋找 :term:`loader`\\ (載入器)。" -#: ../../glossary.rst:433 +#: ../../glossary.rst:443 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 " @@ -981,15 +999,15 @@ msgstr "" "項目尋檢器 (path entry finder) ` 會使用 :data:`sys." "path_hooks`\\ 。" -#: ../../glossary.rst:437 +#: ../../glossary.rst:447 msgid "See :pep:`302`, :pep:`420` and :pep:`451` for much more detail." msgstr "請參閱 :pep:`302`\\ 、\\ :pep:`420` 和 :pep:`451` 以了解更多細節。" -#: ../../glossary.rst:438 +#: ../../glossary.rst:448 msgid "floor division" msgstr "floor division(向下取整除法)" -#: ../../glossary.rst:440 +#: ../../glossary.rst:450 msgid "" "Mathematical division that rounds down to nearest integer. The floor " "division operator is ``//``. For example, the expression ``11 // 4`` " @@ -1002,11 +1020,11 @@ msgstr "" "``2.75`` 不同。請注意,``(-11) // 4`` 的結果是 ``-3``,因為是 ``-2.75`` 被\\ " "*向下*\\ 無條件捨去。請參閱 :pep:`238`\\ 。" -#: ../../glossary.rst:445 +#: ../../glossary.rst:455 msgid "function" msgstr "function(函式)" -#: ../../glossary.rst:447 +#: ../../glossary.rst:457 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 " @@ -1018,15 +1036,15 @@ msgstr "" "`parameter`\\ (參數)、\\ :term:`method`\\ (方法),以及\\ :ref:`function`" "\\ 章節。" -#: ../../glossary.rst:451 +#: ../../glossary.rst:461 msgid "function annotation" msgstr "function annotation(函式註釋)" -#: ../../glossary.rst:453 +#: ../../glossary.rst:463 msgid "An :term:`annotation` of a function parameter or return value." msgstr "函式參數或回傳值的一個 :term:`annotation`\\ (註釋)。" -#: ../../glossary.rst:455 +#: ../../glossary.rst:465 msgid "" "Function annotations are usually used for :term:`type hints `: " "for example, this function is expected to take two :class:`int` arguments " @@ -1037,11 +1055,11 @@ msgstr "" "\n" "::" -#: ../../glossary.rst:463 +#: ../../glossary.rst:473 msgid "Function annotation syntax is explained in section :ref:`function`." msgstr "函式註釋的語法在\\ :ref:`function`\\ 章節有詳細解釋。" -#: ../../glossary.rst:465 +#: ../../glossary.rst:475 msgid "" "See :term:`variable annotation` and :pep:`484`, which describe this " "functionality. Also see :ref:`annotations-howto` for best practices on " @@ -1050,11 +1068,11 @@ msgstr "" "請參閱 :term:`variable annotation` 和 :pep:`484`\\ ,皆有此功能的描述。關於註" "釋的最佳實踐方法,另請參閱 :ref:`annotations-howto`\\ 。" -#: ../../glossary.rst:469 +#: ../../glossary.rst:479 msgid "__future__" msgstr "__future__" -#: ../../glossary.rst:471 +#: ../../glossary.rst:481 msgid "" "A :ref:`future statement `, ``from __future__ import ``, " "directs the compiler to compile the current module using syntax or semantics " @@ -1072,11 +1090,11 @@ msgstr "" "\n" "::" -#: ../../glossary.rst:482 +#: ../../glossary.rst:492 msgid "garbage collection" msgstr "garbage collection(垃圾回收)" -#: ../../glossary.rst:484 +#: ../../glossary.rst:494 msgid "" "The process of freeing memory when it is not used anymore. Python performs " "garbage collection via reference counting and a cyclic garbage collector " @@ -1088,11 +1106,11 @@ msgstr "" "垃圾回收器 (cyclic garbage collector) 來完成。垃圾回收器可以使用 :mod:`gc` 模" "組對其進行控制。" -#: ../../glossary.rst:490 +#: ../../glossary.rst:500 msgid "generator" msgstr "generator(產生器)" -#: ../../glossary.rst:492 +#: ../../glossary.rst:502 msgid "" "A function which returns a :term:`generator iterator`. It looks like a " "normal function except that it contains :keyword:`yield` expressions for " @@ -1103,7 +1121,7 @@ msgstr "" "個正常的函式,但不同的是它包含了 :keyword:`yield` 運算式,能產生一系列的值," "這些值可用於 for 迴圈,或是以 :func:`next` 函式,每次檢索其中的一個值。" -#: ../../glossary.rst:497 +#: ../../glossary.rst:507 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 " @@ -1112,15 +1130,15 @@ msgstr "" "這個術語通常用來表示一個產生器函式,但在某些情境中,也可能是表示\\ *產生器疊" "代器*\\ 。萬一想表達的意思不夠清楚,那就使用完整的術語,以避免歧義。" -#: ../../glossary.rst:500 +#: ../../glossary.rst:510 msgid "generator iterator" msgstr "generator iterator(產生器疊代器)" -#: ../../glossary.rst:502 +#: ../../glossary.rst:512 msgid "An object created by a :term:`generator` function." msgstr "一個由 :term:`generator`\\ (產生器)函式所建立的物件。" -#: ../../glossary.rst:504 +#: ../../glossary.rst:514 msgid "" "Each :keyword:`yield` temporarily suspends processing, remembering the " "location execution state (including local variables and pending try-" @@ -1131,11 +1149,11 @@ msgstr "" "中的 try 陳述式)。當\\ *產生器疊代器*\\ 回復時,它會從停止的地方繼續執行(與" "那些每次調用時都要重新開始的函式有所不同)。" -#: ../../glossary.rst:511 +#: ../../glossary.rst:521 msgid "generator expression" msgstr "generator expression(產生器運算式)" -#: ../../glossary.rst:513 +#: ../../glossary.rst:523 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 " @@ -1148,11 +1166,11 @@ msgstr "" "\n" "::" -#: ../../glossary.rst:520 +#: ../../glossary.rst:530 msgid "generic function" msgstr "generic function(泛型函式)" -#: ../../glossary.rst:522 +#: ../../glossary.rst:532 msgid "" "A function composed of multiple functions implementing the same operation " "for different types. Which implementation should be used during a call is " @@ -1161,7 +1179,7 @@ msgstr "" "一個由多個函式組成的函式,該函式會對不同的型別實作相同的運算。呼叫期間應該使" "用哪種實作,是由調度演算法 (dispatch algorithm) 來決定。" -#: ../../glossary.rst:526 +#: ../../glossary.rst:536 msgid "" "See also the :term:`single dispatch` glossary entry, the :func:`functools." "singledispatch` decorator, and :pep:`443`." @@ -1169,11 +1187,11 @@ msgstr "" "另請參閱 :term:`single dispatch`\\ (單一調度)術語表條目、\\ :func:" "`functools.singledispatch` 裝飾器和 :pep:`443`\\ 。" -#: ../../glossary.rst:528 +#: ../../glossary.rst:538 msgid "generic type" msgstr "generic type(泛型型別)" -#: ../../glossary.rst:530 +#: ../../glossary.rst:540 msgid "" "A :term:`type` that can be parameterized; typically a :ref:`container " "class` such as :class:`list` or :class:`dict`. Used for :" @@ -1183,7 +1201,7 @@ msgstr "" "`容器型別 `\\ ,像是 :class:`list` 和 :class:`dict`。它被用於" "\\ :term:`型別提示 `\\ 和\\ :term:`註釋 `\\ 。" -#: ../../glossary.rst:535 +#: ../../glossary.rst:545 msgid "" "For more details, see :ref:`generic alias types`, :pep:" "`483`, :pep:`484`, :pep:`585`, and the :mod:`typing` module." @@ -1191,19 +1209,19 @@ msgstr "" "詳情請參閱\\ :ref:`泛型別名型別 `\\ 、\\ :pep:`483`" "\\ 、\\ :pep:`484`\\ 、\\ :pep:`585` 和 :mod:`typing` 模組。" -#: ../../glossary.rst:537 +#: ../../glossary.rst:547 msgid "GIL" msgstr "GIL" -#: ../../glossary.rst:539 +#: ../../glossary.rst:549 msgid "See :term:`global interpreter lock`." msgstr "請參閱 :term:`global interpreter lock`\\ (全域直譯器鎖)。" -#: ../../glossary.rst:540 +#: ../../glossary.rst:550 msgid "global interpreter lock" msgstr "global interpreter lock(全域直譯器鎖)" -#: ../../glossary.rst:542 +#: ../../glossary.rst:552 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 " @@ -1220,7 +1238,7 @@ msgstr "" "(multi-threaded),但代價是會犧牲掉多處理器的機器能夠提供的一大部分平行性 " "(parallelism)。" -#: ../../glossary.rst:551 +#: ../../glossary.rst:561 msgid "" "However, some extension modules, either standard or third-party, are " "designed so as to release the GIL when doing computationally intensive tasks " @@ -1231,7 +1249,7 @@ msgstr "" "計算密集 (computationally intensive) 的任務時,可以解除 GIL。另外,在執行 I/" "O 時,GIL 總是會被解除。" -#: ../../glossary.rst:556 +#: ../../glossary.rst:566 msgid "" "Past efforts to create a \"free-threaded\" interpreter (one which locks " "shared data at a much finer granularity) have not been successful because " @@ -1243,11 +1261,11 @@ msgstr "" "力並未成功,因為在一般的單一處理器情況下,效能會有所損失。一般認為,若要克服" "這個效能問題,會使實作變得複雜許多,進而付出更高的維護成本。" -#: ../../glossary.rst:562 +#: ../../glossary.rst:572 msgid "hash-based pyc" msgstr "hash-based pyc(雜湊架構的 pyc)" -#: ../../glossary.rst:564 +#: ../../glossary.rst:574 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-" @@ -1256,11 +1274,11 @@ msgstr "" "一個位元組碼 (bytecode) 暫存檔,它使用雜湊值而不是對應原始檔案的最後修改時" "間,來確定其有效性。請參閱\\ :ref:`pyc-invalidation`\\ 。" -#: ../../glossary.rst:567 +#: ../../glossary.rst:577 msgid "hashable" msgstr "hashable(可雜湊的)" -#: ../../glossary.rst:569 +#: ../../glossary.rst:579 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 " @@ -1272,7 +1290,7 @@ msgstr "" "method),那麼它就是一個\\ *可雜湊*\\ 物件。比較結果為相等的多個可雜湊物件," "它們必須擁有相同的雜湊值。" -#: ../../glossary.rst:574 +#: ../../glossary.rst:584 msgid "" "Hashability makes an object usable as a dictionary key and a set member, " "because these data structures use the hash value internally." @@ -1280,7 +1298,7 @@ msgstr "" "可雜湊性 (hashability) 使一個物件可用作 dictionary(字典)的鍵和 set(集合)" "的成員,因為這些資料結構都在其內部使用了雜湊值。" -#: ../../glossary.rst:577 +#: ../../glossary.rst:587 msgid "" "Most of Python's immutable built-in objects are hashable; mutable containers " "(such as lists or dictionaries) are not; immutable containers (such as " @@ -1295,11 +1313,11 @@ msgstr "" "則這些物件會被預設為可雜湊的。它們在互相比較時都是不相等的(除非它們與自己比" "較),而它們的雜湊值則是衍生自它們的 :func:`id`\\ 。" -#: ../../glossary.rst:584 +#: ../../glossary.rst:594 msgid "IDLE" msgstr "IDLE" -#: ../../glossary.rst:586 +#: ../../glossary.rst:596 msgid "" "An Integrated Development and Learning Environment for Python. :ref:`idle` " "is a basic editor and interpreter environment which ships with the standard " @@ -1309,11 +1327,11 @@ msgstr "" "境)。:ref:`idle` 是一個基本的編輯器和直譯器環境,它和 Python 的標準發行版本" "一起被提供。" -#: ../../glossary.rst:589 +#: ../../glossary.rst:599 msgid "immutable" msgstr "immutable(不可變物件)" -#: ../../glossary.rst:591 +#: ../../glossary.rst:601 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 " @@ -1325,11 +1343,11 @@ msgstr "" "能被改變的。如果一個不同的值必須被儲存,則必須建立一個新的物件。它們在需要恆" "定雜湊值的地方,扮演重要的角色,例如 dictionary(字典)中的一個鍵。" -#: ../../glossary.rst:596 +#: ../../glossary.rst:606 msgid "import path" msgstr "import path(匯入路徑)" -#: ../../glossary.rst:598 +#: ../../glossary.rst:608 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 " @@ -1341,11 +1359,11 @@ msgstr "" "的位置。在 import 期間,此位置列表通常是來自 :data:`sys.path`\\ ,但對於子套" "件 (subpackage) 而言,它也可能是來自父套件的 ``__path__`` 屬性。" -#: ../../glossary.rst:603 +#: ../../glossary.rst:613 msgid "importing" msgstr "importing(匯入)" -#: ../../glossary.rst:605 +#: ../../glossary.rst:615 msgid "" "The process by which Python code in one module is made available to Python " "code in another module." @@ -1353,11 +1371,11 @@ msgstr "" "一個過程。一個模組中的 Python 程式碼可以透過此過程,被另一個模組中的 Python " "程式碼使用。" -#: ../../glossary.rst:607 +#: ../../glossary.rst:617 msgid "importer" msgstr "importer(匯入器)" -#: ../../glossary.rst:609 +#: ../../glossary.rst:619 msgid "" "An object that both finds and loads a module; both a :term:`finder` and :" "term:`loader` object." @@ -1365,11 +1383,11 @@ msgstr "" "一個能夠尋找及載入模組的物件;它既是 :term:`finder`\\ (尋檢器)也是 :term:" "`loader`\\ (載入器)物件。" -#: ../../glossary.rst:611 +#: ../../glossary.rst:621 msgid "interactive" msgstr "interactive(互動的)" -#: ../../glossary.rst:613 +#: ../../glossary.rst:623 msgid "" "Python has an interactive interpreter which means you can enter statements " "and expressions at the interpreter prompt, immediately execute them and see " @@ -1382,11 +1400,11 @@ msgstr "" "從你的電腦的主選單選擇它)。這是測試新想法或檢查模塊和包的非常強大的方法(請" "記住help(x))。" -#: ../../glossary.rst:619 +#: ../../glossary.rst:629 msgid "interpreted" msgstr "interpreted(直譯的)" -#: ../../glossary.rst:621 +#: ../../glossary.rst:631 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. " @@ -1400,11 +1418,11 @@ msgstr "" "一個執行檔,然後再執行它。直譯語言通常比編譯語言有更短的開發/除錯週期,不過" "它們的程式通常也運行得較慢。另請參閱 :term:`interactive`\\ (互動的)。" -#: ../../glossary.rst:628 +#: ../../glossary.rst:638 msgid "interpreter shutdown" msgstr "interpreter shutdown(直譯器關閉)" -#: ../../glossary.rst:630 +#: ../../glossary.rst:640 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 " @@ -1422,18 +1440,18 @@ msgstr "" "段被執行的程式碼會遇到各種例外,因為它所依賴的資源可能不再有作用了(常見的例" "子是函式庫模組或是警告機制)。" -#: ../../glossary.rst:639 +#: ../../glossary.rst:649 msgid "" "The main reason for interpreter shutdown is that the ``__main__`` module or " "the script being run has finished executing." msgstr "" "直譯器關閉的主要原因,是 ``__main__`` 模組或正被運行的腳本已經執行完成。" -#: ../../glossary.rst:641 +#: ../../glossary.rst:651 msgid "iterable" msgstr "iterable(可疊代物件)" -#: ../../glossary.rst:643 +#: ../../glossary.rst:653 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`, " @@ -1449,7 +1467,7 @@ msgstr "" "`Sequence `\\ (序列)語意的 :meth:`__getitem__` method,該物件就是" "可疊代物件。" -#: ../../glossary.rst:650 +#: ../../glossary.rst:660 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 " @@ -1469,11 +1487,11 @@ msgstr "" "於在迴圈期間保有該疊代器。另請參閱 :term:`iterator`\\ (疊代器)、\\ :term:" "`sequence`\\ (序列)和 :term:`generator`\\ (產生器)。" -#: ../../glossary.rst:660 +#: ../../glossary.rst:670 msgid "iterator" msgstr "iterator(疊代器)" -#: ../../glossary.rst:662 +#: ../../glossary.rst:672 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 :" @@ -1502,11 +1520,11 @@ msgstr "" "事(多遍疊代)時,只會回傳在前一遍疊代中被用過的、同一個已被用盡的疊代器物" "件,使其看起來就像一個空的容器。" -#: ../../glossary.rst:677 +#: ../../glossary.rst:687 msgid "More information can be found in :ref:`typeiter`." msgstr "在\\ :ref:`typeiter`\\ 文中可以找到更多資訊。" -#: ../../glossary.rst:681 +#: ../../glossary.rst:691 msgid "" "CPython does not consistently apply the requirement that an iterator define :" "meth:`__iter__`." @@ -1514,11 +1532,11 @@ msgstr "" "CPython 並不是始終如一地都會檢查「疊代器有定義 :meth:`__iter__`\\ 」這個規" "定。" -#: ../../glossary.rst:683 +#: ../../glossary.rst:693 msgid "key function" msgstr "key function(鍵函式)" -#: ../../glossary.rst:685 +#: ../../glossary.rst:695 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 " @@ -1528,7 +1546,7 @@ msgstr "" "一個用於排序 (sorting) 或定序 (ordering) 的值。例如,\\ :func:`locale." "strxfrm` 被用來產生一個了解區域特定排序慣例的排序鍵。" -#: ../../glossary.rst:690 +#: ../../glossary.rst:700 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`, :" @@ -1540,7 +1558,7 @@ msgstr "" "\\ 、\\ :func:`heapq.merge`\\ 、\\ :func:`heapq.nsmallest`\\ 、\\ :func:" "`heapq.nlargest` 和 :func:`itertools.groupby`\\ 。" -#: ../../glossary.rst:696 +#: ../../glossary.rst:706 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. " @@ -1558,19 +1576,19 @@ msgstr "" "`~operator.itemgetter` 和 :func:`~operator.methodcaller`\\ 。關於如何建立和使" "用鍵函式的範例,請參閱\\ :ref:`如何排序 `\\ 。" -#: ../../glossary.rst:704 +#: ../../glossary.rst:714 msgid "keyword argument" msgstr "keyword argument(關鍵字引數)" -#: ../../glossary.rst:706 ../../glossary.rst:995 +#: ../../glossary.rst:716 ../../glossary.rst:1005 msgid "See :term:`argument`." msgstr "請參閱 :term:`argument`\\ (引數)。" -#: ../../glossary.rst:707 +#: ../../glossary.rst:717 msgid "lambda" msgstr "lambda" -#: ../../glossary.rst:709 +#: ../../glossary.rst:719 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 " @@ -1580,11 +1598,11 @@ msgstr "" "function),於該函式被呼叫時求值。建立 lambda 函式的語法是 ``lambda " "[parameters]: expression``" -#: ../../glossary.rst:712 +#: ../../glossary.rst:722 msgid "LBYL" msgstr "LBYL" -#: ../../glossary.rst:714 +#: ../../glossary.rst:724 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` " @@ -1595,7 +1613,7 @@ msgstr "" "地測試先決條件。這種風格與 :term:`EAFP` 方式形成對比,且它的特色是會有許多 :" "keyword:`if` 陳述式的存在。" -#: ../../glossary.rst:719 +#: ../../glossary.rst:729 msgid "" "In a multi-threaded environment, the LBYL approach can risk introducing a " "race condition between \"the looking\" and \"the leaping\". For example, " @@ -1609,11 +1627,11 @@ msgstr "" "了 *key*,則該程式碼就會失效。這個問題可以用鎖 (lock) 或使用 EAFP 編碼方式來" "解決。" -#: ../../glossary.rst:724 +#: ../../glossary.rst:734 msgid "locale encoding" msgstr "locale encoding(區域編碼)" -#: ../../glossary.rst:726 +#: ../../glossary.rst:736 msgid "" "On Unix, it is the encoding of the LC_CTYPE locale. It can be set with " "``locale.setlocale(locale.LC_CTYPE, new_locale)``." @@ -1621,17 +1639,17 @@ msgstr "" "在 Unix 上,它是 LC_CTYPE 區域設定的編碼。它可以用 ``locale.setlocale(locale." "LC_CTYPE, new_locale)`` 來設定。" -#: ../../glossary.rst:729 +#: ../../glossary.rst:739 msgid "On Windows, it is the ANSI code page (ex: ``cp1252``)." msgstr "在 Windows 上,它是 ANSI 代碼頁(code page,例如 ``cp1252``\\ )。" -#: ../../glossary.rst:731 +#: ../../glossary.rst:741 msgid "" "``locale.getpreferredencoding(False)`` can be used to get the locale " "encoding." msgstr "``locale.getpreferredencoding(False)`` 可以用來取得區域編碼。" -#: ../../glossary.rst:734 +#: ../../glossary.rst:744 msgid "" "Python uses the :term:`filesystem encoding and error handler` to convert " "between Unicode filenames and bytes filenames." @@ -1639,11 +1657,11 @@ msgstr "" "Python 使用 :term:`filesystem encoding and error handler`\\ (檔案系統編碼和" "錯誤處理函式)在 Unicode 檔案名稱和位元組檔案名稱之間進行轉換。" -#: ../../glossary.rst:736 +#: ../../glossary.rst:746 msgid "list" msgstr "list(串列)" -#: ../../glossary.rst:738 +#: ../../glossary.rst:748 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 " @@ -1653,11 +1671,11 @@ msgstr "" "似其他語言中的一個陣列 (array) 而較不像一個鏈結串列 (linked list),因為存取元" "素的時間複雜度是 O(1)。" -#: ../../glossary.rst:741 +#: ../../glossary.rst:751 msgid "list comprehension" msgstr "list comprehension(串列綜合運算)" -#: ../../glossary.rst:743 +#: ../../glossary.rst:753 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 " @@ -1671,11 +1689,11 @@ msgstr "" "keyword:`if` 子句是選擇性的。如果省略它,則 ``range(256)`` 中的所有元素都會被" "處理。" -#: ../../glossary.rst:749 +#: ../../glossary.rst:759 msgid "loader" msgstr "loader(載入器)" -#: ../../glossary.rst:751 +#: ../../glossary.rst:761 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:" @@ -1687,19 +1705,19 @@ msgstr "" "`302`,關於 :term:`abstract base class`\\ (抽象基底類別),請參閱 :class:" "`importlib.abc.Loader`\\ 。" -#: ../../glossary.rst:755 +#: ../../glossary.rst:765 msgid "magic method" msgstr "magic method(魔術方法)" -#: ../../glossary.rst:759 +#: ../../glossary.rst:769 msgid "An informal synonym for :term:`special method`." msgstr ":term:`special method`\\ (特殊方法)的一個非正式同義詞。" -#: ../../glossary.rst:760 +#: ../../glossary.rst:770 msgid "mapping" msgstr "mapping(對映)" -#: ../../glossary.rst:762 +#: ../../glossary.rst:772 msgid "" "A container object that supports arbitrary key lookups and implements the " "methods specified in the :class:`~collections.abc.Mapping` or :class:" @@ -1714,11 +1732,11 @@ msgstr "" "的 method。範例包括 :class:`dict`\\ 、\\ :class:`collections.defaultdict`" "\\ 、\\ :class:`collections.OrderedDict` 和 :class:`collections.Counter`\\ 。" -#: ../../glossary.rst:768 +#: ../../glossary.rst:778 msgid "meta path finder" msgstr "meta path finder(元路徑尋檢器)" -#: ../../glossary.rst:770 +#: ../../glossary.rst:780 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:774 +#: ../../glossary.rst:784 msgid "" "See :class:`importlib.abc.MetaPathFinder` for the methods that meta path " "finders implement." @@ -1736,11 +1754,11 @@ msgstr "" "關於元路徑尋檢器實作的 method,請參閱 :class:`importlib.abc.MetaPathFinder`" "\\ 。" -#: ../../glossary.rst:776 +#: ../../glossary.rst:786 msgid "metaclass" msgstr "metaclass(元類別)" -#: ../../glossary.rst:778 +#: ../../glossary.rst:788 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 " @@ -1760,15 +1778,15 @@ msgstr "" "性存取、增加執行緒安全性、追蹤物件建立、實作單例模式 (singleton),以及許多其" "他的任務。" -#: ../../glossary.rst:788 +#: ../../glossary.rst:798 msgid "More information can be found in :ref:`metaclasses`." msgstr "更多資訊可以在\\ :ref:`metaclasses`\\ 章節中找到。" -#: ../../glossary.rst:789 +#: ../../glossary.rst:799 msgid "method" msgstr "method(方法)" -#: ../../glossary.rst:791 +#: ../../glossary.rst:801 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 " @@ -1780,11 +1798,11 @@ msgstr "" "通常被稱為 ``self``)。請參閱 :term:`function`\\ (函式)和 :term:`nested " "scope`\\ (巢狀作用域)。" -#: ../../glossary.rst:795 +#: ../../glossary.rst:805 msgid "method resolution order" msgstr "method resolution order(方法解析順序)" -#: ../../glossary.rst:797 +#: ../../glossary.rst:807 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:801 +#: ../../glossary.rst:811 msgid "module" msgstr "module(模組)" -#: ../../glossary.rst:803 +#: ../../glossary.rst:813 msgid "" "An object that serves as an organizational unit of Python code. Modules " "have a namespace containing arbitrary Python objects. Modules are loaded " @@ -1809,15 +1827,15 @@ msgstr "" "空間,它包含任意的 Python 物件。模組是藉由 :term:`importing` 的過程,被載入" "至 Python。" -#: ../../glossary.rst:807 +#: ../../glossary.rst:817 msgid "See also :term:`package`." msgstr "另請參閱 :term:`package`\\ (套件)。" -#: ../../glossary.rst:808 +#: ../../glossary.rst:818 msgid "module spec" msgstr "module spec(模組規格)" -#: ../../glossary.rst:810 +#: ../../glossary.rst:820 msgid "" "A namespace containing the import-related information used to load a module. " "An instance of :class:`importlib.machinery.ModuleSpec`." @@ -1825,19 +1843,19 @@ msgstr "" "一個命名空間,它包含用於載入模組的 import 相關資訊。它是 :class:`importlib." "machinery.ModuleSpec` 的一個實例。" -#: ../../glossary.rst:812 +#: ../../glossary.rst:822 msgid "MRO" msgstr "MRO" -#: ../../glossary.rst:814 +#: ../../glossary.rst:824 msgid "See :term:`method resolution order`." msgstr "請參閱 :term:`method resolution order`\\ (方法解析順序)。" -#: ../../glossary.rst:815 +#: ../../glossary.rst:825 msgid "mutable" msgstr "mutable(可變物件)" -#: ../../glossary.rst:817 +#: ../../glossary.rst:827 msgid "" "Mutable objects can change their value but keep their :func:`id`. See also :" "term:`immutable`." @@ -1845,11 +1863,11 @@ msgstr "" "可變物件可以改變它們的值,但維持它們的 :func:`id`\\ 。另請參閱 :term:" "`immutable`\\ (不可變物件)。" -#: ../../glossary.rst:819 +#: ../../glossary.rst:829 msgid "named tuple" msgstr "named tuple(附名元組)" -#: ../../glossary.rst:821 +#: ../../glossary.rst:831 msgid "" "The term \"named tuple\" applies to any type or class that inherits from " "tuple and whose indexable elements are also accessible using named " @@ -1859,7 +1877,7 @@ msgstr "" "索引 (indexable) 元素也可以用附名屬性來存取。這些型別或 class 也可以具有其他" "的特性。" -#: ../../glossary.rst:825 +#: ../../glossary.rst:835 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." @@ -1870,7 +1888,7 @@ msgstr "" "\n" "::" -#: ../../glossary.rst:836 +#: ../../glossary.rst:846 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 " @@ -1886,11 +1904,11 @@ msgstr "" "些額外的 method,這些 method 可能是在手寫或內建的 named tuple 中,無法找到" "的。" -#: ../../glossary.rst:843 +#: ../../glossary.rst:853 msgid "namespace" msgstr "namespace(命名空間)" -#: ../../glossary.rst:845 +#: ../../glossary.rst:855 msgid "" "The place where a variable is stored. Namespaces are implemented as " "dictionaries. There are the local, global and built-in namespaces as well " @@ -1910,11 +1928,11 @@ msgstr "" "func:`itertools.islice` 明確地表示,這些函式分別是由 :mod:`random` 和 :mod:" "`itertools` 模組在實作。" -#: ../../glossary.rst:855 +#: ../../glossary.rst:865 msgid "namespace package" msgstr "namespace package(命名空間套件)" -#: ../../glossary.rst:857 +#: ../../glossary.rst:867 msgid "" "A :pep:`420` :term:`package` which serves only as a container for " "subpackages. Namespace packages may have no physical representation, and " @@ -1925,15 +1943,15 @@ msgstr "" "一個容器。命名空間套件可能沒有實體的表示法,而且具體來說它們不像是一個 :term:" "`regular package`\\ (正規套件),因為它們並沒有 ``__init__.py`` 這個檔案。" -#: ../../glossary.rst:862 +#: ../../glossary.rst:872 msgid "See also :term:`module`." msgstr "另請參閱 :term:`module`\\ (模組)。" -#: ../../glossary.rst:863 +#: ../../glossary.rst:873 msgid "nested scope" msgstr "nested scope(巢狀作用域)" -#: ../../glossary.rst:865 +#: ../../glossary.rst:875 msgid "" "The ability to refer to a variable in an enclosing definition. For " "instance, a function defined inside another function can refer to variables " @@ -1948,11 +1966,11 @@ msgstr "" "寫入。同樣地,全域變數是在全域命名空間中讀取及寫入。\\ :keyword:`nonlocal` 容" "許對外層作用域進行寫入。" -#: ../../glossary.rst:872 +#: ../../glossary.rst:882 msgid "new-style class" msgstr "new-style class(新式類別)" -#: ../../glossary.rst:874 +#: ../../glossary.rst:884 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, " @@ -1964,11 +1982,11 @@ msgstr "" "__slots__`\\ 、描述器 (descriptor)、屬性 (property)、\\ :meth:" "`__getattribute__`\\ 、class method(類別方法)和 static method(靜態方法)。" -#: ../../glossary.rst:878 +#: ../../glossary.rst:888 msgid "object" msgstr "object(物件)" -#: ../../glossary.rst:880 +#: ../../glossary.rst:890 msgid "" "Any data with state (attributes or value) and defined behavior (methods). " "Also the ultimate base class of any :term:`new-style class`." @@ -1976,11 +1994,11 @@ msgstr "" "具有狀態(屬性或值)及被定義的行為(method)的任何資料。它也是任何 :term:" "`new-style class`\\ (新式類別)的最終 base class(基底類別)。" -#: ../../glossary.rst:883 +#: ../../glossary.rst:893 msgid "package" msgstr "package(套件)" -#: ../../glossary.rst:885 +#: ../../glossary.rst:895 msgid "" "A Python :term:`module` which can contain submodules or recursively, " "subpackages. Technically, a package is a Python module with an ``__path__`` " @@ -1990,17 +2008,17 @@ msgstr "" "迴的子套件 (subpackage)。技術上而言,套件就是具有 ``__path__`` 屬性的一個 " "Python 模組。" -#: ../../glossary.rst:889 +#: ../../glossary.rst:899 msgid "See also :term:`regular package` and :term:`namespace package`." msgstr "" "另請參閱 :term:`regular package`\\ (正規套件)和 :term:`namespace package`" "\\ (命名空間套件)。" -#: ../../glossary.rst:890 +#: ../../glossary.rst:900 msgid "parameter" msgstr "parameter(參數)" -#: ../../glossary.rst:892 +#: ../../glossary.rst:902 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 " @@ -2010,7 +2028,7 @@ msgstr "" "它指明該函式能夠接受的一個 :term:`argument`\\ (引數),或在某些情況下指示多" "個引數。共有有五種不同的參數類型:" -#: ../../glossary.rst:896 +#: ../../glossary.rst:906 msgid "" ":dfn:`positional-or-keyword`: specifies an argument that can be passed " "either :term:`positionally ` or as a :term:`keyword argument " @@ -2023,7 +2041,7 @@ msgstr "" "\n" "::" -#: ../../glossary.rst:905 +#: ../../glossary.rst:915 msgid "" ":dfn:`positional-only`: specifies an argument that can be supplied only by " "position. Positional-only parameters can be defined by including a ``/`` " @@ -2036,7 +2054,7 @@ msgstr "" "\n" "::" -#: ../../glossary.rst:914 +#: ../../glossary.rst:924 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-" @@ -2051,7 +2069,7 @@ msgstr "" "\n" "::" -#: ../../glossary.rst:922 +#: ../../glossary.rst:932 msgid "" ":dfn:`var-positional`: specifies that an arbitrary sequence of positional " "arguments can be provided (in addition to any positional arguments already " @@ -2065,7 +2083,7 @@ msgstr "" "\n" "::" -#: ../../glossary.rst:930 +#: ../../glossary.rst:940 msgid "" ":dfn:`var-keyword`: specifies that arbitrarily many keyword arguments can be " "provided (in addition to any keyword arguments already accepted by other " @@ -2076,14 +2094,14 @@ msgstr "" "已被其他參數接受的任何關鍵字引數之外)。這類參數是透過在其參數名稱字首加上 " "``**`` 來定義的,例如上面範例中的 *kwargs*。" -#: ../../glossary.rst:936 +#: ../../glossary.rst:946 msgid "" "Parameters can specify both optional and required arguments, as well as " "default values for some optional arguments." msgstr "" "參數可以指明引數是選擇性的或必需的,也可以為一些選擇性的引數指定預設值。" -#: ../../glossary.rst:939 +#: ../../glossary.rst:949 msgid "" "See also the :term:`argument` glossary entry, the FAQ question on :ref:`the " "difference between arguments and parameters `, " @@ -2094,11 +2112,11 @@ msgstr "" "參數之間的差異 `\\ 、\\ :class:`inspect." "Parameter` class、\\ :ref:`function`\\ 章節,以及 :pep:`362`\\ 。" -#: ../../glossary.rst:943 +#: ../../glossary.rst:953 msgid "path entry" msgstr "path entry(路徑項目)" -#: ../../glossary.rst:945 +#: ../../glossary.rst:955 msgid "" "A single location on the :term:`import path` which the :term:`path based " "finder` consults to find modules for importing." @@ -2106,11 +2124,11 @@ msgstr "" "在 :term:`import path`\\ (匯入路徑)中的一個位置,而 :term:`path based " "finder` (基於路徑的尋檢器)會參考該位置來尋找要 import 的模組。" -#: ../../glossary.rst:947 +#: ../../glossary.rst:957 msgid "path entry finder" msgstr "path entry finder(路徑項目尋檢器)" -#: ../../glossary.rst:949 +#: ../../glossary.rst:959 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:" @@ -2120,7 +2138,7 @@ msgstr "" "`path entry hook`\\ )所回傳的一種 :term:`finder`\\ ,它知道如何以一個 :term:" "`path entry`\\ 定位模組。" -#: ../../glossary.rst:953 +#: ../../glossary.rst:963 msgid "" "See :class:`importlib.abc.PathEntryFinder` for the methods that path entry " "finders implement." @@ -2128,11 +2146,11 @@ msgstr "" "關於路徑項目尋檢器實作的 method,請參閱 :class:`importlib.abc." "PathEntryFinder`\\ 。" -#: ../../glossary.rst:955 +#: ../../glossary.rst:965 msgid "path entry hook" msgstr "path entry hook(路徑項目鉤)" -#: ../../glossary.rst:957 +#: ../../glossary.rst:967 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 " @@ -2142,11 +2160,11 @@ msgstr "" "個特定的 :term:`path entry` 中尋找模組,則會回傳一個 :term:`path entry " "finder`\\ (路徑項目尋檢器)。" -#: ../../glossary.rst:960 +#: ../../glossary.rst:970 msgid "path based finder" msgstr "path based finder(基於路徑的尋檢器)" -#: ../../glossary.rst:962 +#: ../../glossary.rst:972 msgid "" "One of the default :term:`meta path finders ` which " "searches an :term:`import path` for modules." @@ -2154,11 +2172,11 @@ msgstr "" "預設的\\ :term:`元路徑尋檢器 (meta path finder) ` 之一,它" "會在一個 :term:`import path` 中搜尋模組。" -#: ../../glossary.rst:964 +#: ../../glossary.rst:974 msgid "path-like object" msgstr "path-like object(類路徑物件)" -#: ../../glossary.rst:966 +#: ../../glossary.rst:976 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 " @@ -2176,11 +2194,11 @@ msgstr "" "`os.fsencode` 則分別可用於確保 :class:`str` 及 :class:`bytes` 的結果。由 :" "pep:`519` 引入。" -#: ../../glossary.rst:974 +#: ../../glossary.rst:984 msgid "PEP" msgstr "PEP" -#: ../../glossary.rst:976 +#: ../../glossary.rst:986 msgid "" "Python Enhancement Proposal. A PEP is a design document providing " "information to the Python community, or describing a new feature for Python " @@ -2191,7 +2209,7 @@ msgstr "" "為 Python 社群提供資訊,或是描述 Python 的一個新功能或該功能的程序和環境。" "PEP 應該要提供簡潔的技術規範以及被提案功能的運作原理。" -#: ../../glossary.rst:982 +#: ../../glossary.rst:992 msgid "" "PEPs are intended to be the primary mechanisms for proposing major new " "features, for collecting community input on an issue, and for documenting " @@ -2203,15 +2221,15 @@ msgstr "" "已納入 Python 的設計決策的記錄,這些過程的主要機制。PEP 的作者要負責在社群內" "建立共識並記錄反對意見。" -#: ../../glossary.rst:988 +#: ../../glossary.rst:998 msgid "See :pep:`1`." msgstr "請參閱 :pep:`1`\\ 。" -#: ../../glossary.rst:989 +#: ../../glossary.rst:999 msgid "portion" msgstr "portion(部分)" -#: ../../glossary.rst:991 +#: ../../glossary.rst:1001 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`." @@ -2219,15 +2237,15 @@ msgstr "" "在單一目錄中的一組檔案(也可能儲存在一個 zip 檔中),這些檔案能對一個命名空間" "套件 (namespace package) 有所貢獻,如同 :pep:`420` 中的定義。" -#: ../../glossary.rst:993 +#: ../../glossary.rst:1003 msgid "positional argument" msgstr "positional argument(位置引數)" -#: ../../glossary.rst:996 +#: ../../glossary.rst:1006 msgid "provisional API" msgstr "provisional API(暫行 API)" -#: ../../glossary.rst:998 +#: ../../glossary.rst:1008 msgid "" "A provisional API is one which has been deliberately excluded from the " "standard library's backwards compatibility guarantees. While major changes " @@ -2243,7 +2261,7 @@ msgstr "" "該介面)。這種變更並不會無端地產生——只有 API 被納入之前未察覺的嚴重基本缺陷被" "揭露時,它們才會發生。" -#: ../../glossary.rst:1007 +#: ../../glossary.rst:1017 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 " @@ -2252,7 +2270,7 @@ msgstr "" "即使對於暫行 API,向後不相容的變更也會被視為「最後的解決方案」——對於任何被發" "現的問題,仍然會盡可能找出一個向後相容的解決方案。" -#: ../../glossary.rst:1011 +#: ../../glossary.rst:1021 msgid "" "This process allows the standard library to continue to evolve over time, " "without locking in problematic design errors for extended periods of time. " @@ -2261,19 +2279,19 @@ msgstr "" "這個過程使得標準函式庫能隨著時間不斷進化,而避免耗費過長的時間去鎖定有問題的" "設計錯誤。請參閱 :pep:`411` 了解更多細節。" -#: ../../glossary.rst:1014 +#: ../../glossary.rst:1024 msgid "provisional package" msgstr "provisional package(暫行套件)" -#: ../../glossary.rst:1016 +#: ../../glossary.rst:1026 msgid "See :term:`provisional API`." msgstr "請參閱 :term:`provisional API`\\ (暫行 API)。" -#: ../../glossary.rst:1017 +#: ../../glossary.rst:1027 msgid "Python 3000" msgstr "Python 3000" -#: ../../glossary.rst:1019 +#: ../../glossary.rst:1029 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 " @@ -2282,11 +2300,11 @@ msgstr "" "Python 3.x 系列版本的暱稱(很久以前創造的,當時第 3 版的發布是在遙遠的未" "來。)也可以縮寫為「Py3k」。" -#: ../../glossary.rst:1022 +#: ../../glossary.rst:1032 msgid "Pythonic" msgstr "Pythonic(Python 風格的)" -#: ../../glossary.rst:1024 +#: ../../glossary.rst:1034 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 " @@ -2302,18 +2320,18 @@ msgstr "" "\n" "::" -#: ../../glossary.rst:1034 +#: ../../glossary.rst:1044 msgid "As opposed to the cleaner, Pythonic method::" msgstr "" "相較之下,以下方法更簡潔、更具有 Python 風格:\n" "\n" "::" -#: ../../glossary.rst:1038 +#: ../../glossary.rst:1048 msgid "qualified name" msgstr "qualified name(限定名稱)" -#: ../../glossary.rst:1040 +#: ../../glossary.rst:1050 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 " @@ -2326,7 +2344,7 @@ msgstr "" "\n" "::" -#: ../../glossary.rst:1057 +#: ../../glossary.rst:1067 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." @@ -2337,11 +2355,11 @@ msgstr "" "\n" "::" -#: ../../glossary.rst:1064 +#: ../../glossary.rst:1074 msgid "reference count" msgstr "reference count(參照計數)" -#: ../../glossary.rst:1066 +#: ../../glossary.rst:1076 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 " @@ -2355,11 +2373,11 @@ msgstr "" "`CPython` 實作的一個關鍵元素。\\ :mod:`sys` 模組定義了一個 :func:`~sys." "getrefcount` 函式,程序設計師可以呼叫該函式來回傳一個特定物件的參照計數。" -#: ../../glossary.rst:1072 +#: ../../glossary.rst:1082 msgid "regular package" msgstr "regular package(正規套件)" -#: ../../glossary.rst:1074 +#: ../../glossary.rst:1084 msgid "" "A traditional :term:`package`, such as a directory containing an ``__init__." "py`` file." @@ -2367,15 +2385,15 @@ msgstr "" "一個傳統的 :term:`package`\\ (套件),例如一個包含 ``__init__.py`` 檔案的目" "錄。" -#: ../../glossary.rst:1077 +#: ../../glossary.rst:1087 msgid "See also :term:`namespace package`." msgstr "另請參閱 :term:`namespace package`\\ (命名空間套件)。" -#: ../../glossary.rst:1078 +#: ../../glossary.rst:1088 msgid "__slots__" msgstr "__slots__" -#: ../../glossary.rst:1080 +#: ../../glossary.rst:1090 msgid "" "A declaration inside a class that saves memory by pre-declaring space for " "instance attributes and eliminating instance dictionaries. Though popular, " @@ -2388,11 +2406,11 @@ msgstr "" "最好保留給那種在一個記憶體關鍵 (memory-critical) 的應用程式中存在大量實例的罕" "見情況。" -#: ../../glossary.rst:1085 +#: ../../glossary.rst:1095 msgid "sequence" msgstr "sequence(序列)" -#: ../../glossary.rst:1087 +#: ../../glossary.rst:1097 msgid "" "An :term:`iterable` which supports efficient element access using integer " "indices via the :meth:`__getitem__` special method and defines a :meth:" @@ -2410,7 +2428,7 @@ msgstr "" "對映 (mapping) 而不是序列,因為其查找方式是使用任意的 :term:`immutable` 鍵," "而不是整數。" -#: ../../glossary.rst:1096 +#: ../../glossary.rst:1106 msgid "" "The :class:`collections.abc.Sequence` abstract base class defines a much " "richer interface that goes beyond just :meth:`__getitem__` and :meth:" @@ -2424,11 +2442,11 @@ msgstr "" "`__reversed__`\\ 。實作此擴充介面的型別,可以使用 :func:`~abc.ABCMeta." "register` 被明確地註冊。" -#: ../../glossary.rst:1103 +#: ../../glossary.rst:1113 msgid "set comprehension" msgstr "set comprehension(集合綜合運算)" -#: ../../glossary.rst:1105 +#: ../../glossary.rst:1115 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 " @@ -2439,11 +2457,11 @@ msgstr "" "set 回傳。``results = {c for c in 'abracadabra' if c not in 'abc'}`` 會產生一" "個字串 set:``{'r', 'd'}``。請參閱\\ :ref:`comprehensions`\\ 。" -#: ../../glossary.rst:1109 +#: ../../glossary.rst:1119 msgid "single dispatch" msgstr "single dispatch(單一調度)" -#: ../../glossary.rst:1111 +#: ../../glossary.rst:1121 msgid "" "A form of :term:`generic function` dispatch where the implementation is " "chosen based on the type of a single argument." @@ -2451,11 +2469,11 @@ msgstr "" ":term:`generic function`\\ (泛型函式)調度的一種形式,在此,實作的選擇是基於" "單一引數的型別。" -#: ../../glossary.rst:1113 +#: ../../glossary.rst:1123 msgid "slice" msgstr "slice(切片)" -#: ../../glossary.rst:1115 +#: ../../glossary.rst:1125 msgid "" "An object usually containing a portion of a :term:`sequence`. A slice is " "created using the subscript notation, ``[]`` with colons between numbers " @@ -2467,11 +2485,11 @@ msgstr "" "字之間使用冒號,例如 ``variable_name[1:3:5]``。在括號(下標)符號的內部,會使" "用 :class:`slice` 物件。" -#: ../../glossary.rst:1119 +#: ../../glossary.rst:1129 msgid "special method" msgstr "special method(特殊方法)" -#: ../../glossary.rst:1123 +#: ../../glossary.rst:1133 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 " @@ -2482,11 +2500,11 @@ msgstr "" "種 method 的名稱會在開頭和結尾有兩個下底線。Special method 在\\ :ref:" "`specialnames`\\ 中有詳細說明。" -#: ../../glossary.rst:1127 +#: ../../glossary.rst:1137 msgid "statement" msgstr "statement(陳述式)" -#: ../../glossary.rst:1129 +#: ../../glossary.rst:1139 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 :" @@ -2496,11 +2514,11 @@ msgstr "" "term:`expression`\\ (運算式),或是含有關鍵字(例如 :keyword:`if`\\ 、\\ :" "keyword:`while` 或 :keyword:`for`\\ )的多種結構之一。" -#: ../../glossary.rst:1132 +#: ../../glossary.rst:1142 msgid "strong reference" msgstr "strong reference(強參照)" -#: ../../glossary.rst:1134 +#: ../../glossary.rst:1144 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 " @@ -2509,7 +2527,7 @@ msgstr "" "在 Python 的 C API 中,強參照是一個對物件的參照,在它被建立時會增加該物件的參" "照計數 (reference count),在它被刪除時則會減少該物件的參照計數。" -#: ../../glossary.rst:1138 +#: ../../glossary.rst:1148 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 " @@ -2519,15 +2537,15 @@ msgstr "" ":c:func:`Py_NewRef` 函式可用於建立一個對物件的強參照。通常,在退出強參照的作" "用域之前,必須在該強參照上呼叫 :c:func:`Py_DECREF` 函式,以避免洩漏一個參照。" -#: ../../glossary.rst:1143 +#: ../../glossary.rst:1153 msgid "See also :term:`borrowed reference`." msgstr "另請參閱 :term:`borrowed reference`\\ (借用參照)。" -#: ../../glossary.rst:1144 +#: ../../glossary.rst:1154 msgid "text encoding" msgstr "text encoding(文字編碼)" -#: ../../glossary.rst:1146 +#: ../../glossary.rst:1156 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 " @@ -2536,7 +2554,7 @@ msgstr "" "Python 中的字串是一個 Unicode 碼點 (code point) 的序列(範圍在 ``U+0000`` -- " "``U+10FFFF`` 之間)。若要儲存或傳送一個字串,它必須被序列化為一個位元組序列。" -#: ../../glossary.rst:1150 +#: ../../glossary.rst:1160 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\"." @@ -2544,7 +2562,7 @@ msgstr "" "將一個字串序列化為位元組序列,稱為「編碼」,而從位元組序列重新建立該字串則稱" "為「解碼 (decoding)」。" -#: ../../glossary.rst:1153 +#: ../../glossary.rst:1163 msgid "" "There are a variety of different text serialization :ref:`codecs `, which are collectively referred to as \"text encodings\"." @@ -2552,11 +2570,11 @@ msgstr "" "有多種不同的文字序列化編解碼器 (:ref:`codecs `),它們被統" "稱為「文字編碼」。" -#: ../../glossary.rst:1156 +#: ../../glossary.rst:1166 msgid "text file" msgstr "text file(文字檔案)" -#: ../../glossary.rst:1158 +#: ../../glossary.rst:1168 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:" @@ -2570,7 +2588,7 @@ msgstr "" "有:以文字模式(``'r'`` 或 ``'w'``)開啟的檔案、\\ :data:`sys.stdin`\\ 、\\ :" "data:`sys.stdout` 以及 :class:`io.StringIO` 的實例。" -#: ../../glossary.rst:1165 +#: ../../glossary.rst:1175 msgid "" "See also :term:`binary file` for a file object able to read and write :term:" "`bytes-like objects `." @@ -2578,11 +2596,11 @@ msgstr "" "另請參閱 :term:`binary file`\\ (二進制檔案),它是一個能夠讀取和寫入\\ :" "term:`類位元組串物件 (bytes-like object) ` 的檔案物件。" -#: ../../glossary.rst:1167 +#: ../../glossary.rst:1177 msgid "triple-quoted string" msgstr "triple-quoted string(三引號內字串)" -#: ../../glossary.rst:1169 +#: ../../glossary.rst:1179 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 " @@ -2597,11 +2615,11 @@ msgstr "" "中包含未跳脫 (unescaped) 的單引號和雙引號,而且它們不需使用連續字元 " "(continuation character) 就可以跨越多行,這使得它們在編寫說明字串時特別有用。" -#: ../../glossary.rst:1176 +#: ../../glossary.rst:1186 msgid "type" msgstr "type(型別)" -#: ../../glossary.rst:1178 +#: ../../glossary.rst:1188 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." @@ -2611,15 +2629,15 @@ msgstr "" "件的型別可以用它的 :attr:`~instance.__class__` 屬性來存取,或以 " "``type(obj)`` 來檢索。" -#: ../../glossary.rst:1182 +#: ../../glossary.rst:1192 msgid "type alias" msgstr "type alias(型別別名)" -#: ../../glossary.rst:1184 +#: ../../glossary.rst:1194 msgid "A synonym for a type, created by assigning the type to an identifier." msgstr "一個型別的同義詞,透過將型別指定給一個識別符 (identifier) 來建立。" -#: ../../glossary.rst:1186 +#: ../../glossary.rst:1196 msgid "" "Type aliases are useful for simplifying :term:`type hints `. For " "example::" @@ -2628,22 +2646,22 @@ msgstr "" "\n" "::" -#: ../../glossary.rst:1193 +#: ../../glossary.rst:1203 msgid "could be made more readable like this::" msgstr "" "可以寫成這樣,更具有可讀性:\n" "\n" "::" -#: ../../glossary.rst:1200 ../../glossary.rst:1214 +#: ../../glossary.rst:1210 ../../glossary.rst:1224 msgid "See :mod:`typing` and :pep:`484`, which describe this functionality." msgstr "請參閱 :mod:`typing` 和 :pep:`484`\\ ,有此功能的描述。" -#: ../../glossary.rst:1201 +#: ../../glossary.rst:1211 msgid "type hint" msgstr "type hint(型別提示)" -#: ../../glossary.rst:1203 +#: ../../glossary.rst:1213 msgid "" "An :term:`annotation` that specifies the expected type for a variable, a " "class attribute, or a function parameter or return value." @@ -2651,7 +2669,7 @@ msgstr "" "一種 :term:`annotation`\\ (註釋),它指定一個變數、一個 class 屬性或一個函式" "的參數或回傳值的預期型別。" -#: ../../glossary.rst:1206 +#: ../../glossary.rst:1216 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 " @@ -2660,7 +2678,7 @@ msgstr "" "型別提示是選擇性的,而不是被 Python 強制的,但它們對靜態型別分析工具很有用," "並能協助 IDE 完成程式碼的補全 (completion) 和重構 (refactoring)。" -#: ../../glossary.rst:1210 +#: ../../glossary.rst:1220 msgid "" "Type hints of global variables, class attributes, and functions, but not " "local variables, can be accessed using :func:`typing.get_type_hints`." @@ -2668,11 +2686,11 @@ msgstr "" "全域變數、class 屬性和函式(不含區域變數)的型別提示,都可以使用 :func:" "`typing.get_type_hints` 來存取。" -#: ../../glossary.rst:1215 +#: ../../glossary.rst:1225 msgid "universal newlines" msgstr "universal newlines(通用換行字元)" -#: ../../glossary.rst:1217 +#: ../../glossary.rst:1227 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 " @@ -2685,15 +2703,15 @@ msgstr "" "``'\\r'``。請參閱 :pep:`278` 和 :pep:`3116`\\ ,以及用於 :func:`bytes." "splitlines` 的附加用途。" -#: ../../glossary.rst:1222 +#: ../../glossary.rst:1232 msgid "variable annotation" msgstr "variable annotation(變數註釋)" -#: ../../glossary.rst:1224 +#: ../../glossary.rst:1234 msgid "An :term:`annotation` of a variable or a class attribute." msgstr "一個變數或 class 屬性的 :term:`annotation`\\ (註釋)。" -#: ../../glossary.rst:1226 +#: ../../glossary.rst:1236 msgid "" "When annotating a variable or a class attribute, assignment is optional::" msgstr "" @@ -2701,7 +2719,7 @@ msgstr "" "\n" "::" -#: ../../glossary.rst:1231 +#: ../../glossary.rst:1241 msgid "" "Variable annotations are usually used for :term:`type hints `: " "for example this variable is expected to take :class:`int` values::" @@ -2711,11 +2729,11 @@ msgstr "" "\n" "::" -#: ../../glossary.rst:1237 +#: ../../glossary.rst:1247 msgid "Variable annotation syntax is explained in section :ref:`annassign`." msgstr "變數註釋的語法在\\ :ref:`annassign`\\ 章節有詳細的解釋。" -#: ../../glossary.rst:1239 +#: ../../glossary.rst:1249 msgid "" "See :term:`function annotation`, :pep:`484` and :pep:`526`, which describe " "this functionality. Also see :ref:`annotations-howto` for best practices on " @@ -2725,11 +2743,11 @@ msgstr "" "`526`\\ ,皆有此功能的描述。關於註釋的最佳實踐方法,另請參閱 :ref:" "`annotations-howto`\\ 。" -#: ../../glossary.rst:1243 +#: ../../glossary.rst:1253 msgid "virtual environment" msgstr "virtual environment(虛擬環境)" -#: ../../glossary.rst:1245 +#: ../../glossary.rst:1255 msgid "" "A cooperatively isolated runtime environment that allows Python users and " "applications to install and upgrade Python distribution packages without " @@ -2740,15 +2758,15 @@ msgstr "" "程式得以安裝和升級 Python 發佈套件,而不會對同一個系統上運行的其他 Python 應" "用程式的行為產生干擾。" -#: ../../glossary.rst:1250 +#: ../../glossary.rst:1260 msgid "See also :mod:`venv`." msgstr "另請參閱 :mod:`venv`\\ 。" -#: ../../glossary.rst:1251 +#: ../../glossary.rst:1261 msgid "virtual machine" msgstr "virtual machine(虛擬機器)" -#: ../../glossary.rst:1253 +#: ../../glossary.rst:1263 msgid "" "A computer defined entirely in software. Python's virtual machine executes " "the :term:`bytecode` emitted by the bytecode compiler." @@ -2756,11 +2774,11 @@ msgstr "" "一部完全由軟體所定義的電腦 (computer)。Python 的虛擬機器會執行由 :term:" "`bytecode`\\ (位元組碼)編譯器所發出的位元組碼。" -#: ../../glossary.rst:1255 +#: ../../glossary.rst:1265 msgid "Zen of Python" msgstr "Zen of Python(Python 之禪)" -#: ../../glossary.rst:1257 +#: ../../glossary.rst:1267 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 b9a437e225..76d730ddb7 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-09-29 00:25+0000\n" +"POT-Creation-Date: 2022-10-13 00:23+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-" @@ -173,18 +173,18 @@ msgid "" "configuration::" msgstr "" -#: ../../howto/logging-cookbook.rst:336 +#: ../../howto/logging-cookbook.rst:338 msgid "Dealing with handlers that block" msgstr "" -#: ../../howto/logging-cookbook.rst:340 +#: ../../howto/logging-cookbook.rst:342 msgid "" "Sometimes you have to get your logging handlers to do their work without " "blocking the thread you're logging from. This is common in web applications, " "though of course it also occurs in other scenarios." msgstr "" -#: ../../howto/logging-cookbook.rst:344 +#: ../../howto/logging-cookbook.rst:346 msgid "" "A common culprit which demonstrates sluggish behaviour is the :class:" "`SMTPHandler`: sending emails can take a long time, for a number of reasons " @@ -195,7 +195,7 @@ msgid "" "below the Python layer, and outside your control)." msgstr "" -#: ../../howto/logging-cookbook.rst:352 +#: ../../howto/logging-cookbook.rst:354 msgid "" "One solution is to use a two-part approach. For the first part, attach only " "a :class:`QueueHandler` to those loggers which are accessed from performance-" @@ -209,7 +209,7 @@ msgid "" "developers who will use your code." msgstr "" -#: ../../howto/logging-cookbook.rst:363 +#: ../../howto/logging-cookbook.rst:365 msgid "" "The second part of the solution is :class:`QueueListener`, which has been " "designed as the counterpart to :class:`QueueHandler`. A :class:" @@ -220,7 +220,7 @@ msgid "" "handlers for processing." msgstr "" -#: ../../howto/logging-cookbook.rst:371 +#: ../../howto/logging-cookbook.rst:373 msgid "" "The advantage of having a separate :class:`QueueListener` class is that you " "can use the same instance to service multiple ``QueueHandlers``. This is " @@ -229,15 +229,15 @@ msgid "" "benefit." msgstr "" -#: ../../howto/logging-cookbook.rst:376 +#: ../../howto/logging-cookbook.rst:378 msgid "An example of using these two classes follows (imports omitted)::" msgstr "" -#: ../../howto/logging-cookbook.rst:394 +#: ../../howto/logging-cookbook.rst:396 msgid "which, when run, will produce:" msgstr "" -#: ../../howto/logging-cookbook.rst:400 +#: ../../howto/logging-cookbook.rst:402 msgid "" "Although the earlier discussion wasn't specifically talking about async " "code, but rather about slow logging handlers, it should be noted that when " @@ -248,7 +248,7 @@ msgid "" "code runs only in the ``QueueListener`` thread." msgstr "" -#: ../../howto/logging-cookbook.rst:408 +#: ../../howto/logging-cookbook.rst:410 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 " @@ -260,30 +260,30 @@ msgid "" "handler if it's appropriate to do so." msgstr "" -#: ../../howto/logging-cookbook.rst:421 +#: ../../howto/logging-cookbook.rst:423 msgid "Sending and receiving logging events across a network" msgstr "" -#: ../../howto/logging-cookbook.rst:423 +#: ../../howto/logging-cookbook.rst:425 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:451 +#: ../../howto/logging-cookbook.rst:453 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:539 +#: ../../howto/logging-cookbook.rst:541 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:551 +#: ../../howto/logging-cookbook.rst:553 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 " @@ -292,11 +292,11 @@ msgid "" "use your alternative serialization." msgstr "" -#: ../../howto/logging-cookbook.rst:559 +#: ../../howto/logging-cookbook.rst:561 msgid "Running a logging socket listener in production" msgstr "" -#: ../../howto/logging-cookbook.rst:561 +#: ../../howto/logging-cookbook.rst:563 msgid "" "To run a logging listener in production, you may need to use a process-" "management tool such as `Supervisor `_. `Here " @@ -306,11 +306,11 @@ msgid "" "to reflect the actual paths you want to use." msgstr "" -#: ../../howto/logging-cookbook.rst:572 +#: ../../howto/logging-cookbook.rst:574 msgid "Adding contextual information to your logging output" msgstr "" -#: ../../howto/logging-cookbook.rst:574 +#: ../../howto/logging-cookbook.rst:576 msgid "" "Sometimes you want logging output to contain contextual information in " "addition to the parameters passed to the logging call. For example, in a " @@ -326,11 +326,11 @@ msgid "" "`Logger` instances becomes effectively unbounded." msgstr "" -#: ../../howto/logging-cookbook.rst:589 +#: ../../howto/logging-cookbook.rst:591 msgid "Using LoggerAdapters to impart contextual information" msgstr "" -#: ../../howto/logging-cookbook.rst:591 +#: ../../howto/logging-cookbook.rst:593 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. " @@ -341,7 +341,7 @@ msgid "" "types of instances interchangeably." msgstr "" -#: ../../howto/logging-cookbook.rst:599 +#: ../../howto/logging-cookbook.rst:601 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 " @@ -352,7 +352,7 @@ msgid "" "of :class:`LoggerAdapter`::" msgstr "" -#: ../../howto/logging-cookbook.rst:615 +#: ../../howto/logging-cookbook.rst:617 msgid "" "The :meth:`~LoggerAdapter.process` method of :class:`LoggerAdapter` is where " "the contextual information is added to the logging output. It's passed the " @@ -365,7 +365,7 @@ msgid "" "be silently overwritten." msgstr "" -#: ../../howto/logging-cookbook.rst:624 +#: ../../howto/logging-cookbook.rst:626 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 " @@ -376,21 +376,21 @@ msgid "" "`~LoggerAdapter.process` to do what you need. Here is a simple example::" msgstr "" -#: ../../howto/logging-cookbook.rst:640 +#: ../../howto/logging-cookbook.rst:642 msgid "which you can use like this::" msgstr "" -#: ../../howto/logging-cookbook.rst:645 +#: ../../howto/logging-cookbook.rst:647 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:649 +#: ../../howto/logging-cookbook.rst:651 msgid "Using objects other than dicts to pass contextual information" msgstr "" -#: ../../howto/logging-cookbook.rst:651 +#: ../../howto/logging-cookbook.rst:653 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 " @@ -399,11 +399,11 @@ msgid "" "would be constant)." msgstr "" -#: ../../howto/logging-cookbook.rst:660 +#: ../../howto/logging-cookbook.rst:662 msgid "Using Filters to impart contextual information" msgstr "" -#: ../../howto/logging-cookbook.rst:662 +#: ../../howto/logging-cookbook.rst:664 msgid "" "You can also add contextual information to log output using a user-defined :" "class:`Filter`. ``Filter`` instances are allowed to modify the " @@ -412,7 +412,7 @@ msgid "" "class:`Formatter`." msgstr "" -#: ../../howto/logging-cookbook.rst:667 +#: ../../howto/logging-cookbook.rst:669 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:" @@ -424,15 +424,15 @@ msgid "" "an example script::" msgstr "" -#: ../../howto/logging-cookbook.rst:713 +#: ../../howto/logging-cookbook.rst:715 msgid "which, when run, produces something like:" msgstr "" -#: ../../howto/logging-cookbook.rst:731 +#: ../../howto/logging-cookbook.rst:733 msgid "Use of ``contextvars``" msgstr "" -#: ../../howto/logging-cookbook.rst:733 +#: ../../howto/logging-cookbook.rst:735 msgid "" "Since Python 3.7, the :mod:`contextvars` module has provided context-local " "storage which works for both :mod:`threading` and :mod:`asyncio` processing " @@ -442,7 +442,7 @@ msgid "" "attributes handled by web applications." msgstr "" -#: ../../howto/logging-cookbook.rst:739 +#: ../../howto/logging-cookbook.rst:741 msgid "" "For the purposes of illustration, say that you have different web " "applications, each independent of the other but running in the same Python " @@ -453,18 +453,18 @@ msgid "" "information such as client IP, HTTP request method and client username?" msgstr "" -#: ../../howto/logging-cookbook.rst:746 +#: ../../howto/logging-cookbook.rst:748 msgid "Let's assume that the library can be simulated by the following code:" msgstr "" -#: ../../howto/logging-cookbook.rst:762 +#: ../../howto/logging-cookbook.rst:764 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:906 +#: ../../howto/logging-cookbook.rst:908 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 " @@ -475,11 +475,11 @@ msgid "" "illustrated by the following shell output:" msgstr "" -#: ../../howto/logging-cookbook.rst:953 +#: ../../howto/logging-cookbook.rst:955 msgid "Imparting contextual information in handlers" msgstr "" -#: ../../howto/logging-cookbook.rst:955 +#: ../../howto/logging-cookbook.rst:957 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 " @@ -487,11 +487,11 @@ msgid "" "instead of modifying it in-place, as shown in the following script::" msgstr "" -#: ../../howto/logging-cookbook.rst:982 +#: ../../howto/logging-cookbook.rst:984 msgid "Logging to a single file from multiple processes" msgstr "" -#: ../../howto/logging-cookbook.rst:984 +#: ../../howto/logging-cookbook.rst:986 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 " @@ -507,7 +507,7 @@ msgid "" "you to adapt in your own applications." msgstr "" -#: ../../howto/logging-cookbook.rst:997 +#: ../../howto/logging-cookbook.rst:999 msgid "" "You could also write your own handler which uses the :class:" "`~multiprocessing.Lock` class from the :mod:`multiprocessing` module to " @@ -518,7 +518,7 @@ msgid "" "platforms (see https://bugs.python.org/issue3770)." msgstr "" -#: ../../howto/logging-cookbook.rst:1007 +#: ../../howto/logging-cookbook.rst:1009 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 " @@ -533,13 +533,13 @@ msgid "" "requirements::" msgstr "" -#: ../../howto/logging-cookbook.rst:1123 +#: ../../howto/logging-cookbook.rst:1125 msgid "" "A variant of the above script keeps the logging in the main process, in a " "separate thread::" msgstr "" -#: ../../howto/logging-cookbook.rst:1218 +#: ../../howto/logging-cookbook.rst:1220 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 " @@ -549,34 +549,34 @@ msgid "" "appropriate destinations." msgstr "" -#: ../../howto/logging-cookbook.rst:1225 +#: ../../howto/logging-cookbook.rst:1227 msgid "Using concurrent.futures.ProcessPoolExecutor" msgstr "" -#: ../../howto/logging-cookbook.rst:1227 +#: ../../howto/logging-cookbook.rst:1229 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:1235 +#: ../../howto/logging-cookbook.rst:1237 msgid "you should use" msgstr "" -#: ../../howto/logging-cookbook.rst:1241 +#: ../../howto/logging-cookbook.rst:1243 msgid "and you can then replace the worker creation from this::" msgstr "" -#: ../../howto/logging-cookbook.rst:1252 +#: ../../howto/logging-cookbook.rst:1254 msgid "to this (remembering to first import :mod:`concurrent.futures`)::" msgstr "" -#: ../../howto/logging-cookbook.rst:1259 +#: ../../howto/logging-cookbook.rst:1261 msgid "Deploying Web applications using Gunicorn and uWSGI" msgstr "" -#: ../../howto/logging-cookbook.rst:1261 +#: ../../howto/logging-cookbook.rst:1263 msgid "" "When deploying Web applications using `Gunicorn `_ or " "`uWSGI `_ (or similar), " @@ -588,11 +588,11 @@ msgid "" "listener in production`_ for more details." msgstr "" -#: ../../howto/logging-cookbook.rst:1271 +#: ../../howto/logging-cookbook.rst:1273 msgid "Using file rotation" msgstr "" -#: ../../howto/logging-cookbook.rst:1276 +#: ../../howto/logging-cookbook.rst:1278 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, " @@ -602,13 +602,13 @@ msgid "" "RotatingFileHandler`::" msgstr "" -#: ../../howto/logging-cookbook.rst:1308 +#: ../../howto/logging-cookbook.rst:1310 msgid "" "The result should be 6 separate files, each with part of the log history for " "the application:" msgstr "" -#: ../../howto/logging-cookbook.rst:1320 +#: ../../howto/logging-cookbook.rst:1322 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 " @@ -616,17 +616,17 @@ msgid "" "(``.1`` becomes ``.2``, etc.) and the ``.6`` file is erased." msgstr "" -#: ../../howto/logging-cookbook.rst:1325 +#: ../../howto/logging-cookbook.rst:1327 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:1331 +#: ../../howto/logging-cookbook.rst:1333 msgid "Use of alternative formatting styles" msgstr "" -#: ../../howto/logging-cookbook.rst:1333 +#: ../../howto/logging-cookbook.rst:1335 msgid "" "When logging was added to the Python standard library, the only way of " "formatting messages with variable content was to use the %-formatting " @@ -635,7 +635,7 @@ msgid "" "Python 2.6)." msgstr "" -#: ../../howto/logging-cookbook.rst:1339 +#: ../../howto/logging-cookbook.rst:1341 msgid "" "Logging (as of 3.2) provides improved support for these two additional " "formatting styles. The :class:`Formatter` class been enhanced to take an " @@ -648,14 +648,14 @@ msgid "" "session to show the possibilities:" msgstr "" -#: ../../howto/logging-cookbook.rst:1373 +#: ../../howto/logging-cookbook.rst:1375 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:1381 +#: ../../howto/logging-cookbook.rst:1383 msgid "" "Logging calls (``logger.debug()``, ``logger.info()`` etc.) only take " "positional parameters for the actual logging message itself, with keyword " @@ -671,7 +671,7 @@ msgid "" "strings." msgstr "" -#: ../../howto/logging-cookbook.rst:1394 +#: ../../howto/logging-cookbook.rst:1396 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 " @@ -680,7 +680,7 @@ msgid "" "the following two classes::" msgstr "" -#: ../../howto/logging-cookbook.rst:1418 +#: ../../howto/logging-cookbook.rst:1420 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 " @@ -691,21 +691,21 @@ msgid "" "used as a synonym/alias for :func:`gettext.gettext` or its brethren)." msgstr "" -#: ../../howto/logging-cookbook.rst:1426 +#: ../../howto/logging-cookbook.rst:1428 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:1448 +#: ../../howto/logging-cookbook.rst:1450 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:1452 +#: ../../howto/logging-cookbook.rst:1454 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 " @@ -716,23 +716,23 @@ msgid "" "sugar for a constructor call to one of the XXXMessage classes." msgstr "" -#: ../../howto/logging-cookbook.rst:1460 +#: ../../howto/logging-cookbook.rst:1462 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:1491 +#: ../../howto/logging-cookbook.rst:1493 msgid "" "The above script should log the message ``Hello, world!`` when run with " "Python 3.2 or later." msgstr "" -#: ../../howto/logging-cookbook.rst:1500 +#: ../../howto/logging-cookbook.rst:1502 msgid "Customizing ``LogRecord``" msgstr "" -#: ../../howto/logging-cookbook.rst:1502 +#: ../../howto/logging-cookbook.rst:1504 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:" @@ -743,13 +743,13 @@ msgid "" "was done:" msgstr "" -#: ../../howto/logging-cookbook.rst:1509 +#: ../../howto/logging-cookbook.rst:1511 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:1512 +#: ../../howto/logging-cookbook.rst:1514 msgid "" ":func:`makeLogRecord`, which is called with a dictionary containing " "attributes to be added to the LogRecord. This is typically invoked when a " @@ -758,27 +758,27 @@ msgid "" "`~handlers.HTTPHandler`)." msgstr "" -#: ../../howto/logging-cookbook.rst:1518 +#: ../../howto/logging-cookbook.rst:1520 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:1521 +#: ../../howto/logging-cookbook.rst:1523 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:1524 +#: ../../howto/logging-cookbook.rst:1526 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:1528 +#: ../../howto/logging-cookbook.rst:1530 msgid "" "The first approach would be a little unwieldy in the scenario where (say) " "several different libraries wanted to do different things. Each would " @@ -786,7 +786,7 @@ msgid "" "last would win." msgstr "" -#: ../../howto/logging-cookbook.rst:1533 +#: ../../howto/logging-cookbook.rst:1535 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 " @@ -795,7 +795,7 @@ msgid "" "would do simply by adding new packages or modules and doing ::" msgstr "" -#: ../../howto/logging-cookbook.rst:1541 +#: ../../howto/logging-cookbook.rst:1543 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` " @@ -805,7 +805,7 @@ msgid "" "developer." msgstr "" -#: ../../howto/logging-cookbook.rst:1547 +#: ../../howto/logging-cookbook.rst:1549 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 " @@ -815,7 +815,7 @@ msgid "" "`LogRecord` is the default setting for the factory." msgstr "" -#: ../../howto/logging-cookbook.rst:1554 +#: ../../howto/logging-cookbook.rst:1556 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 " @@ -823,7 +823,7 @@ msgid "" "this::" msgstr "" -#: ../../howto/logging-cookbook.rst:1567 +#: ../../howto/logging-cookbook.rst:1569 msgid "" "This pattern allows different libraries to chain factories together, and as " "long as they don't overwrite each other's attributes or unintentionally " @@ -833,70 +833,70 @@ msgid "" "used when the use of a :class:`Filter` does not provide the desired result." msgstr "" -#: ../../howto/logging-cookbook.rst:1578 +#: ../../howto/logging-cookbook.rst:1580 msgid "Subclassing QueueHandler - a ZeroMQ example" msgstr "" -#: ../../howto/logging-cookbook.rst:1580 +#: ../../howto/logging-cookbook.rst:1582 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:1599 +#: ../../howto/logging-cookbook.rst:1601 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:1617 +#: ../../howto/logging-cookbook.rst:1619 msgid "Subclassing QueueListener - a ZeroMQ example" msgstr "" -#: ../../howto/logging-cookbook.rst:1619 +#: ../../howto/logging-cookbook.rst:1621 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:1638 ../../howto/logging-cookbook.rst:3520 +#: ../../howto/logging-cookbook.rst:1640 ../../howto/logging-cookbook.rst:3522 msgid "Module :mod:`logging`" msgstr ":mod:`logging` 模組" -#: ../../howto/logging-cookbook.rst:1638 ../../howto/logging-cookbook.rst:3520 +#: ../../howto/logging-cookbook.rst:1640 ../../howto/logging-cookbook.rst:3522 msgid "API reference for the logging module." msgstr "" -#: ../../howto/logging-cookbook.rst:1641 ../../howto/logging-cookbook.rst:3523 +#: ../../howto/logging-cookbook.rst:1643 ../../howto/logging-cookbook.rst:3525 msgid "Module :mod:`logging.config`" msgstr ":mod:`logging.config` 模組" -#: ../../howto/logging-cookbook.rst:1641 ../../howto/logging-cookbook.rst:3523 +#: ../../howto/logging-cookbook.rst:1643 ../../howto/logging-cookbook.rst:3525 msgid "Configuration API for the logging module." msgstr "" -#: ../../howto/logging-cookbook.rst:1644 ../../howto/logging-cookbook.rst:3526 +#: ../../howto/logging-cookbook.rst:1646 ../../howto/logging-cookbook.rst:3528 msgid "Module :mod:`logging.handlers`" msgstr ":mod:`logging.handlers` 模組" -#: ../../howto/logging-cookbook.rst:1644 ../../howto/logging-cookbook.rst:3526 +#: ../../howto/logging-cookbook.rst:1646 ../../howto/logging-cookbook.rst:3528 msgid "Useful handlers included with the logging module." msgstr "" -#: ../../howto/logging-cookbook.rst:1646 +#: ../../howto/logging-cookbook.rst:1648 msgid ":ref:`A basic logging tutorial `" msgstr "" -#: ../../howto/logging-cookbook.rst:1648 +#: ../../howto/logging-cookbook.rst:1650 msgid ":ref:`A more advanced logging tutorial `" msgstr "" -#: ../../howto/logging-cookbook.rst:1652 +#: ../../howto/logging-cookbook.rst:1654 msgid "An example dictionary-based configuration" msgstr "" -#: ../../howto/logging-cookbook.rst:1654 +#: ../../howto/logging-cookbook.rst:1656 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:1717 +#: ../../howto/logging-cookbook.rst:1719 msgid "Using a rotator and namer to customize log rotation processing" msgstr "" -#: ../../howto/logging-cookbook.rst:1719 +#: ../../howto/logging-cookbook.rst:1721 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:1737 +#: ../../howto/logging-cookbook.rst:1739 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:1742 +#: ../../howto/logging-cookbook.rst:1744 msgid "A more elaborate multiprocessing example" msgstr "" -#: ../../howto/logging-cookbook.rst:1744 +#: ../../howto/logging-cookbook.rst:1746 msgid "" "The following working example shows how logging can be used with " "multiprocessing using configuration files. The configurations are fairly " @@ -940,7 +940,7 @@ msgid "" "in a real multiprocessing scenario." msgstr "" -#: ../../howto/logging-cookbook.rst:1749 +#: ../../howto/logging-cookbook.rst:1751 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 " @@ -953,17 +953,17 @@ msgid "" "own scenario." msgstr "" -#: ../../howto/logging-cookbook.rst:1759 +#: ../../howto/logging-cookbook.rst:1761 msgid "" "Here's the script - the docstrings and the comments hopefully explain how it " "works::" msgstr "" -#: ../../howto/logging-cookbook.rst:1971 +#: ../../howto/logging-cookbook.rst:1973 msgid "Inserting a BOM into messages sent to a SysLogHandler" msgstr "" -#: ../../howto/logging-cookbook.rst:1973 +#: ../../howto/logging-cookbook.rst:1975 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 " @@ -972,7 +972,7 @@ msgid "" "<5424#section-6>`.)" msgstr "" -#: ../../howto/logging-cookbook.rst:1979 +#: ../../howto/logging-cookbook.rst:1981 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 " @@ -980,7 +980,7 @@ msgid "" "hence not allowing any pure-ASCII component to appear before it." msgstr "" -#: ../../howto/logging-cookbook.rst:1985 +#: ../../howto/logging-cookbook.rst:1987 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 " @@ -989,33 +989,33 @@ msgid "" "encoded using UTF-8, then you need to do the following:" msgstr "" -#: ../../howto/logging-cookbook.rst:1991 +#: ../../howto/logging-cookbook.rst:1993 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:1997 +#: ../../howto/logging-cookbook.rst:1999 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:2000 +#: ../../howto/logging-cookbook.rst:2002 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:2004 +#: ../../howto/logging-cookbook.rst:2006 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:2008 +#: ../../howto/logging-cookbook.rst:2010 msgid "" "The formatted message *will* be encoded using UTF-8 encoding by " "``SysLogHandler``. If you follow the above rules, you should be able to " @@ -1024,11 +1024,11 @@ msgid "" "daemon may complain." msgstr "" -#: ../../howto/logging-cookbook.rst:2015 +#: ../../howto/logging-cookbook.rst:2017 msgid "Implementing structured logging" msgstr "" -#: ../../howto/logging-cookbook.rst:2017 +#: ../../howto/logging-cookbook.rst:2019 msgid "" "Although most logging messages are intended for reading by humans, and thus " "not readily machine-parseable, there might be circumstances where you want " @@ -1040,31 +1040,31 @@ msgid "" "machine-parseable manner::" msgstr "" -#: ../../howto/logging-cookbook.rst:2041 +#: ../../howto/logging-cookbook.rst:2043 msgid "If the above script is run, it prints:" msgstr "" -#: ../../howto/logging-cookbook.rst:2047 ../../howto/logging-cookbook.rst:2089 +#: ../../howto/logging-cookbook.rst:2049 ../../howto/logging-cookbook.rst:2091 msgid "" "Note that the order of items might be different according to the version of " "Python used." msgstr "" -#: ../../howto/logging-cookbook.rst:2050 +#: ../../howto/logging-cookbook.rst:2052 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:2083 +#: ../../howto/logging-cookbook.rst:2085 msgid "When the above script is run, it prints:" msgstr "" -#: ../../howto/logging-cookbook.rst:2098 +#: ../../howto/logging-cookbook.rst:2100 msgid "Customizing handlers with :func:`dictConfig`" msgstr "" -#: ../../howto/logging-cookbook.rst:2100 +#: ../../howto/logging-cookbook.rst:2102 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 " @@ -1074,24 +1074,24 @@ msgid "" "customize handler creation using a plain function such as::" msgstr "" -#: ../../howto/logging-cookbook.rst:2114 +#: ../../howto/logging-cookbook.rst:2116 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:2147 +#: ../../howto/logging-cookbook.rst:2149 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:2194 +#: ../../howto/logging-cookbook.rst:2196 msgid "To run this, you will probably need to run as ``root``:" msgstr "" -#: ../../howto/logging-cookbook.rst:2204 +#: ../../howto/logging-cookbook.rst:2206 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 " @@ -1100,17 +1100,17 @@ msgid "" "change using e.g. :func:`os.chown`." msgstr "" -#: ../../howto/logging-cookbook.rst:2210 +#: ../../howto/logging-cookbook.rst:2212 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:2215 +#: ../../howto/logging-cookbook.rst:2217 msgid "you could use e.g.::" msgstr "" -#: ../../howto/logging-cookbook.rst:2219 +#: ../../howto/logging-cookbook.rst:2221 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://" @@ -1118,25 +1118,25 @@ msgid "" "resolved by :func:`dictConfig` from the ``ext://`` specification." msgstr "" -#: ../../howto/logging-cookbook.rst:2224 +#: ../../howto/logging-cookbook.rst:2226 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:2228 +#: ../../howto/logging-cookbook.rst:2230 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:2238 +#: ../../howto/logging-cookbook.rst:2240 msgid "Using particular formatting styles throughout your application" msgstr "" -#: ../../howto/logging-cookbook.rst:2240 +#: ../../howto/logging-cookbook.rst:2242 msgid "" "In Python 3.2, the :class:`~logging.Formatter` gained a ``style`` keyword " "parameter which, while defaulting to ``%`` for backward compatibility, " @@ -1147,7 +1147,7 @@ msgid "" "is constructed." msgstr "" -#: ../../howto/logging-cookbook.rst:2247 +#: ../../howto/logging-cookbook.rst:2249 msgid "" "Logging calls (:meth:`~Logger.debug`, :meth:`~Logger.info` etc.) only take " "positional parameters for the actual logging message itself, with keyword " @@ -1162,7 +1162,7 @@ msgid "" "calls which are out there in existing code will be using %-format strings." msgstr "" -#: ../../howto/logging-cookbook.rst:2259 +#: ../../howto/logging-cookbook.rst:2261 msgid "" "There have been suggestions to associate format styles with specific " "loggers, but that approach also runs into backward compatibility problems " @@ -1170,7 +1170,7 @@ msgid "" "formatting." msgstr "" -#: ../../howto/logging-cookbook.rst:2263 +#: ../../howto/logging-cookbook.rst:2265 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 " @@ -1178,11 +1178,11 @@ msgid "" "formatting styles can be accommodated." msgstr "" -#: ../../howto/logging-cookbook.rst:2270 +#: ../../howto/logging-cookbook.rst:2272 msgid "Using LogRecord factories" msgstr "" -#: ../../howto/logging-cookbook.rst:2272 +#: ../../howto/logging-cookbook.rst:2274 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 " @@ -1197,17 +1197,17 @@ msgid "" "implementation does." msgstr "" -#: ../../howto/logging-cookbook.rst:2283 +#: ../../howto/logging-cookbook.rst:2285 msgid "" "Refer to the reference documentation on :func:`setLogRecordFactory` and :" "class:`LogRecord` for more information." msgstr "" -#: ../../howto/logging-cookbook.rst:2288 +#: ../../howto/logging-cookbook.rst:2290 msgid "Using custom message objects" msgstr "" -#: ../../howto/logging-cookbook.rst:2290 +#: ../../howto/logging-cookbook.rst:2292 msgid "" "There is another, perhaps simpler way that you can use {}- and $- formatting " "to construct your individual log messages. You may recall (from :ref:" @@ -1217,7 +1217,7 @@ msgid "" "following two classes::" msgstr "" -#: ../../howto/logging-cookbook.rst:2315 +#: ../../howto/logging-cookbook.rst:2317 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 " @@ -1228,17 +1228,17 @@ msgid "" "using ``_`` for localization)." msgstr "" -#: ../../howto/logging-cookbook.rst:2323 +#: ../../howto/logging-cookbook.rst:2325 msgid "" "Examples of this approach are given below. Firstly, formatting with :meth:" "`str.format`::" msgstr "" -#: ../../howto/logging-cookbook.rst:2337 +#: ../../howto/logging-cookbook.rst:2339 msgid "Secondly, formatting with :class:`string.Template`::" msgstr "" -#: ../../howto/logging-cookbook.rst:2344 +#: ../../howto/logging-cookbook.rst:2346 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 " @@ -1250,11 +1250,11 @@ msgid "" "above." msgstr "" -#: ../../howto/logging-cookbook.rst:2358 +#: ../../howto/logging-cookbook.rst:2360 msgid "Configuring filters with :func:`dictConfig`" msgstr "" -#: ../../howto/logging-cookbook.rst:2360 +#: ../../howto/logging-cookbook.rst:2362 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). " @@ -1269,22 +1269,22 @@ msgid "" "complete example::" msgstr "" -#: ../../howto/logging-cookbook.rst:2413 +#: ../../howto/logging-cookbook.rst:2415 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:2421 +#: ../../howto/logging-cookbook.rst:2423 msgid "which shows that the filter is working as configured." msgstr "" -#: ../../howto/logging-cookbook.rst:2423 +#: ../../howto/logging-cookbook.rst:2425 msgid "A couple of extra points to note:" msgstr "" -#: ../../howto/logging-cookbook.rst:2425 +#: ../../howto/logging-cookbook.rst:2427 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 " @@ -1294,7 +1294,7 @@ msgid "" "the above example." msgstr "" -#: ../../howto/logging-cookbook.rst:2432 +#: ../../howto/logging-cookbook.rst:2434 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 " @@ -1303,11 +1303,11 @@ msgid "" "above." msgstr "" -#: ../../howto/logging-cookbook.rst:2441 +#: ../../howto/logging-cookbook.rst:2443 msgid "Customized exception formatting" msgstr "" -#: ../../howto/logging-cookbook.rst:2443 +#: ../../howto/logging-cookbook.rst:2445 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, " @@ -1315,22 +1315,22 @@ msgid "" "formatter class, as shown in the following example::" msgstr "" -#: ../../howto/logging-cookbook.rst:2484 +#: ../../howto/logging-cookbook.rst:2486 msgid "When run, this produces a file with exactly two lines:" msgstr "" -#: ../../howto/logging-cookbook.rst:2491 +#: ../../howto/logging-cookbook.rst:2493 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:2498 +#: ../../howto/logging-cookbook.rst:2500 msgid "Speaking logging messages" msgstr "" -#: ../../howto/logging-cookbook.rst:2500 +#: ../../howto/logging-cookbook.rst:2502 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 " @@ -1347,24 +1347,24 @@ msgid "" "approach, which assumes that the ``espeak`` TTS package is available::" msgstr "" -#: ../../howto/logging-cookbook.rst:2542 +#: ../../howto/logging-cookbook.rst:2544 msgid "" "When run, this script should say \"Hello\" and then \"Goodbye\" in a female " "voice." msgstr "" -#: ../../howto/logging-cookbook.rst:2544 +#: ../../howto/logging-cookbook.rst:2546 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:2552 +#: ../../howto/logging-cookbook.rst:2554 msgid "Buffering logging messages and outputting them conditionally" msgstr "" -#: ../../howto/logging-cookbook.rst:2554 +#: ../../howto/logging-cookbook.rst:2556 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 " @@ -1374,7 +1374,7 @@ msgid "" "debug information to be output as well as the error." msgstr "" -#: ../../howto/logging-cookbook.rst:2561 +#: ../../howto/logging-cookbook.rst:2563 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 " @@ -1387,7 +1387,7 @@ msgid "" "subclass of ``MemoryHandler`` if you want custom flushing behavior." msgstr "" -#: ../../howto/logging-cookbook.rst:2571 +#: ../../howto/logging-cookbook.rst:2573 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 " @@ -1396,7 +1396,7 @@ msgid "" "levels - otherwise, it only logs at DEBUG, INFO and WARNING levels." msgstr "" -#: ../../howto/logging-cookbook.rst:2577 +#: ../../howto/logging-cookbook.rst:2579 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 " @@ -1408,30 +1408,30 @@ msgid "" "respectively." msgstr "" -#: ../../howto/logging-cookbook.rst:2585 +#: ../../howto/logging-cookbook.rst:2587 msgid "Here's the script::" msgstr "" -#: ../../howto/logging-cookbook.rst:2648 +#: ../../howto/logging-cookbook.rst:2650 msgid "When this script is run, the following output should be observed:" msgstr "" -#: ../../howto/logging-cookbook.rst:2678 +#: ../../howto/logging-cookbook.rst:2680 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:2682 +#: ../../howto/logging-cookbook.rst:2684 msgid "You can of course use the conventional means of decoration::" msgstr "" -#: ../../howto/logging-cookbook.rst:2692 +#: ../../howto/logging-cookbook.rst:2694 msgid "Sending logging messages to email, with buffering" msgstr "" -#: ../../howto/logging-cookbook.rst:2694 +#: ../../howto/logging-cookbook.rst:2696 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." @@ -1442,7 +1442,7 @@ msgid "" "argument to see the required and optional arguments.)" msgstr "" -#: ../../howto/logging-cookbook.rst:2766 +#: ../../howto/logging-cookbook.rst:2768 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 " @@ -1450,17 +1450,17 @@ msgid "" "messages. That makes up 102 messages as specified in the script." msgstr "" -#: ../../howto/logging-cookbook.rst:2774 +#: ../../howto/logging-cookbook.rst:2776 msgid "Formatting times using UTC (GMT) via configuration" msgstr "" -#: ../../howto/logging-cookbook.rst:2776 +#: ../../howto/logging-cookbook.rst:2778 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:2785 +#: ../../howto/logging-cookbook.rst:2787 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 " @@ -1468,21 +1468,21 @@ msgid "" "the following complete example::" msgstr "" -#: ../../howto/logging-cookbook.rst:2828 +#: ../../howto/logging-cookbook.rst:2830 msgid "When this script is run, it should print something like:" msgstr "" -#: ../../howto/logging-cookbook.rst:2835 +#: ../../howto/logging-cookbook.rst:2837 msgid "" "showing how the time is formatted both as local time and UTC, one for each " "handler." msgstr "" -#: ../../howto/logging-cookbook.rst:2842 +#: ../../howto/logging-cookbook.rst:2844 msgid "Using a context manager for selective logging" msgstr "" -#: ../../howto/logging-cookbook.rst:2844 +#: ../../howto/logging-cookbook.rst:2846 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 " @@ -1492,7 +1492,7 @@ msgid "" "scope of the context manager::" msgstr "" -#: ../../howto/logging-cookbook.rst:2877 +#: ../../howto/logging-cookbook.rst:2879 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 " @@ -1501,13 +1501,13 @@ msgid "" "block exit - you could do this if you don't need the handler any more." msgstr "" -#: ../../howto/logging-cookbook.rst:2883 +#: ../../howto/logging-cookbook.rst:2885 msgid "" "To illustrate how it works, we can add the following block of code to the " "above::" msgstr "" -#: ../../howto/logging-cookbook.rst:2901 +#: ../../howto/logging-cookbook.rst:2903 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 " @@ -1520,56 +1520,56 @@ msgid "" "(like message #1) whereas message #7 doesn't (just like message #2)." msgstr "" -#: ../../howto/logging-cookbook.rst:2911 +#: ../../howto/logging-cookbook.rst:2913 msgid "If we run the resulting script, the result is as follows:" msgstr "" -#: ../../howto/logging-cookbook.rst:2922 +#: ../../howto/logging-cookbook.rst:2924 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:2930 +#: ../../howto/logging-cookbook.rst:2932 msgid "Once again, but piping ``stdout`` to ``/dev/null``, we get:" msgstr "" -#: ../../howto/logging-cookbook.rst:2940 +#: ../../howto/logging-cookbook.rst:2942 msgid "" "In this case, the message #5 printed to ``stdout`` doesn't appear, as " "expected." msgstr "" -#: ../../howto/logging-cookbook.rst:2942 +#: ../../howto/logging-cookbook.rst:2944 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:2950 +#: ../../howto/logging-cookbook.rst:2952 msgid "A CLI application starter template" msgstr "" -#: ../../howto/logging-cookbook.rst:2952 +#: ../../howto/logging-cookbook.rst:2954 msgid "Here's an example which shows how you can:" msgstr "" -#: ../../howto/logging-cookbook.rst:2954 +#: ../../howto/logging-cookbook.rst:2956 msgid "Use a logging level based on command-line arguments" msgstr "" -#: ../../howto/logging-cookbook.rst:2955 +#: ../../howto/logging-cookbook.rst:2957 msgid "" "Dispatch to multiple subcommands in separate files, all logging at the same " "level in a consistent way" msgstr "" -#: ../../howto/logging-cookbook.rst:2957 +#: ../../howto/logging-cookbook.rst:2959 msgid "Make use of simple, minimal configuration" msgstr "" -#: ../../howto/logging-cookbook.rst:2959 +#: ../../howto/logging-cookbook.rst:2961 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 " @@ -1580,53 +1580,53 @@ msgid "" "``logging.INFO``. Here's one way that ``app.py`` could be written::" msgstr "" -#: ../../howto/logging-cookbook.rst:3008 +#: ../../howto/logging-cookbook.rst:3010 msgid "" "And the ``start``, ``stop`` and ``restart`` commands can be implemented in " "separate modules, like so for starting::" msgstr "" -#: ../../howto/logging-cookbook.rst:3021 +#: ../../howto/logging-cookbook.rst:3023 msgid "and thus for stopping::" msgstr "" -#: ../../howto/logging-cookbook.rst:3042 +#: ../../howto/logging-cookbook.rst:3044 msgid "and similarly for restarting::" msgstr "" -#: ../../howto/logging-cookbook.rst:3063 +#: ../../howto/logging-cookbook.rst:3065 msgid "" "If we run this application with the default log level, we get output like " "this:" msgstr "" -#: ../../howto/logging-cookbook.rst:3076 +#: ../../howto/logging-cookbook.rst:3078 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:3079 +#: ../../howto/logging-cookbook.rst:3081 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:3096 +#: ../../howto/logging-cookbook.rst:3098 msgid "And if we want less:" msgstr "" -#: ../../howto/logging-cookbook.rst:3104 +#: ../../howto/logging-cookbook.rst:3106 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:3110 +#: ../../howto/logging-cookbook.rst:3112 msgid "A Qt GUI for logging" msgstr "" -#: ../../howto/logging-cookbook.rst:3112 +#: ../../howto/logging-cookbook.rst:3114 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-" @@ -1634,7 +1634,7 @@ msgid "" "project/PySide2/>`_ or `PyQt5 `_ libraries." msgstr "" -#: ../../howto/logging-cookbook.rst:3118 +#: ../../howto/logging-cookbook.rst:3120 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 " @@ -1644,14 +1644,14 @@ msgid "" "logging messages at random levels with random short delays in between)." msgstr "" -#: ../../howto/logging-cookbook.rst:3125 +#: ../../howto/logging-cookbook.rst:3127 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:3129 +#: ../../howto/logging-cookbook.rst:3131 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 " @@ -1659,11 +1659,11 @@ msgid "" "information." msgstr "" -#: ../../howto/logging-cookbook.rst:3343 +#: ../../howto/logging-cookbook.rst:3345 msgid "Logging to syslog with RFC5424 support" msgstr "" -#: ../../howto/logging-cookbook.rst:3345 +#: ../../howto/logging-cookbook.rst:3347 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 " @@ -1673,14 +1673,14 @@ msgid "" "handlers.SysLogHandler` functionality has not been updated." msgstr "" -#: ../../howto/logging-cookbook.rst:3352 +#: ../../howto/logging-cookbook.rst:3354 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:3418 +#: ../../howto/logging-cookbook.rst:3420 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 " @@ -1689,11 +1689,11 @@ msgid "" "using something like this::" msgstr "" -#: ../../howto/logging-cookbook.rst:3435 +#: ../../howto/logging-cookbook.rst:3437 msgid "Patterns to avoid" msgstr "" -#: ../../howto/logging-cookbook.rst:3437 +#: ../../howto/logging-cookbook.rst:3439 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 " @@ -1701,11 +1701,11 @@ msgid "" "The following sections are in no particular order." msgstr "" -#: ../../howto/logging-cookbook.rst:3444 +#: ../../howto/logging-cookbook.rst:3446 msgid "Opening the same log file multiple times" msgstr "" -#: ../../howto/logging-cookbook.rst:3446 +#: ../../howto/logging-cookbook.rst:3448 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. " @@ -1713,32 +1713,32 @@ msgid "" "file multiple times. This could be done accidentally, for example by:" msgstr "" -#: ../../howto/logging-cookbook.rst:3451 +#: ../../howto/logging-cookbook.rst:3453 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:3454 +#: ../../howto/logging-cookbook.rst:3456 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:3457 +#: ../../howto/logging-cookbook.rst:3459 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:3461 +#: ../../howto/logging-cookbook.rst:3463 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:3464 +#: ../../howto/logging-cookbook.rst:3466 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 " @@ -1747,7 +1747,7 @@ msgid "" "different handler instances which happen to point to the same file." msgstr "" -#: ../../howto/logging-cookbook.rst:3470 +#: ../../howto/logging-cookbook.rst:3472 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 " @@ -1757,17 +1757,17 @@ msgid "" "being supposedly in place." msgstr "" -#: ../../howto/logging-cookbook.rst:3477 +#: ../../howto/logging-cookbook.rst:3479 msgid "" "Use the techniques outlined in :ref:`multiple-processes` to circumvent such " "issues." msgstr "" -#: ../../howto/logging-cookbook.rst:3481 +#: ../../howto/logging-cookbook.rst:3483 msgid "Using loggers as attributes in a class or passing them as parameters" msgstr "" -#: ../../howto/logging-cookbook.rst:3483 +#: ../../howto/logging-cookbook.rst:3485 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 " @@ -1778,12 +1778,12 @@ msgid "" "module (and not the class) is the unit of software decomposition." msgstr "" -#: ../../howto/logging-cookbook.rst:3493 +#: ../../howto/logging-cookbook.rst:3495 msgid "" "Adding handlers other than :class:`NullHandler` to a logger in a library" msgstr "" -#: ../../howto/logging-cookbook.rst:3495 +#: ../../howto/logging-cookbook.rst:3497 msgid "" "Configuring logging by adding handlers, formatters and filters is the " "responsibility of the application developer, not the library developer. If " @@ -1791,11 +1791,11 @@ msgid "" "your loggers other than a :class:`~logging.NullHandler` instance." msgstr "" -#: ../../howto/logging-cookbook.rst:3502 +#: ../../howto/logging-cookbook.rst:3504 msgid "Creating a lot of loggers" msgstr "" -#: ../../howto/logging-cookbook.rst:3504 +#: ../../howto/logging-cookbook.rst:3506 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. " @@ -1806,14 +1806,14 @@ msgid "" "occasionally slightly more fine-grained than that)." msgstr "" -#: ../../howto/logging-cookbook.rst:3515 +#: ../../howto/logging-cookbook.rst:3517 msgid "Other resources" msgstr "" -#: ../../howto/logging-cookbook.rst:3528 +#: ../../howto/logging-cookbook.rst:3530 msgid ":ref:`Basic Tutorial `" msgstr "" -#: ../../howto/logging-cookbook.rst:3530 +#: ../../howto/logging-cookbook.rst:3532 msgid ":ref:`Advanced Tutorial `" msgstr "" diff --git a/library/asyncio-dev.po b/library/asyncio-dev.po index 0666c865cf..8cae7fa792 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: 2022-09-29 00:25+0000\n" +"POT-Creation-Date: 2022-10-13 00:23+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-" @@ -216,10 +216,10 @@ msgid "" "different process." msgstr "" "目前沒有什麼辦法能直接從另一個行程(例如透過 :mod:`multiprocessing` 啟動的程" -"序)來為協程或回呼排程。\\ :ref:`asyncio-event-loop-methods`\\ 小節列" -"出了可以從 pipes(管道)讀取並監視 file descriptor(檔案描述器)而不會阻塞事" -"件迴圈的 API。此外,asyncio 的\\ :ref:`子行程 ` API 提供" -"了一種啟動行程並從事件迴圈與其通訊的辦法。最後,之前提到的 :meth:`loop." +"序)來為協程或回呼排程。\\ :ref:`asyncio-event-loop-methods`\\ 小節列出了可以" +"從 pipes(管道)讀取並監視 file descriptor(檔案描述器)而不會阻塞事件迴圈的 " +"API。此外,asyncio 的\\ :ref:`子行程 ` API 提供了一種啟動" +"行程並從事件迴圈與其通訊的辦法。最後,之前提到的 :meth:`loop." "run_in_executor` 方法也可和 :class:`concurrent.futures.ProcessPoolExecutor` " "搭配使用,以在另一個行程中執行程式。" @@ -270,14 +270,15 @@ msgstr "" #: ../../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." +"separate thread for handling logs or use non-blocking IO. For example, see :" +"ref:`blocking-handlers`." msgstr "" -#: ../../library/asyncio-dev.rst:158 +#: ../../library/asyncio-dev.rst:159 msgid "Detect never-awaited coroutines" msgstr "偵測從未被等待的 (never-awaited) 協程" -#: ../../library/asyncio-dev.rst:160 +#: ../../library/asyncio-dev.rst:161 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:" @@ -289,21 +290,21 @@ msgstr "" "\n" "::" -#: ../../library/asyncio-dev.rst:175 ../../library/asyncio-dev.rst:220 +#: ../../library/asyncio-dev.rst:176 ../../library/asyncio-dev.rst:221 msgid "Output::" msgstr "" "輸出:\n" "\n" "::" -#: ../../library/asyncio-dev.rst:180 ../../library/asyncio-dev.rst:236 +#: ../../library/asyncio-dev.rst:181 ../../library/asyncio-dev.rst:237 msgid "Output in debug mode::" msgstr "" "除錯模式中的輸出:\n" "\n" "::" -#: ../../library/asyncio-dev.rst:193 +#: ../../library/asyncio-dev.rst:194 msgid "" "The usual fix is to either await the coroutine or call the :meth:`asyncio." "create_task` function::" @@ -312,11 +313,11 @@ msgstr "" "\n" "::" -#: ../../library/asyncio-dev.rst:201 +#: ../../library/asyncio-dev.rst:202 msgid "Detect never-retrieved exceptions" msgstr "偵測從未被獲取的 (never-retrieved) 例外" -#: ../../library/asyncio-dev.rst:203 +#: ../../library/asyncio-dev.rst:204 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 " @@ -327,14 +328,14 @@ msgstr "" "傳播 (propagate) 到使用者程式。在這種情況下,當 Future 物件被垃圾回收 " "(garbage collected) 時,asyncio 將發出一則日誌訊息。" -#: ../../library/asyncio-dev.rst:208 +#: ../../library/asyncio-dev.rst:209 msgid "Example of an unhandled exception::" msgstr "" "未處理例外的例子:\n" "\n" "::" -#: ../../library/asyncio-dev.rst:231 +#: ../../library/asyncio-dev.rst:232 msgid "" ":ref:`Enable the debug mode ` to get the traceback where " "the task was created::" diff --git a/library/contextlib.po b/library/contextlib.po index d53e4f5c0e..41761931d3 100644 --- a/library/contextlib.po +++ b/library/contextlib.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-03-30 00:13+0000\n" +"POT-Creation-Date: 2022-10-13 00:23+0000\n" "PO-Revision-Date: 2018-05-23 14:41+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -81,14 +81,18 @@ msgid "" "management::" msgstr "" -#: ../../library/contextlib.rst:73 +#: ../../library/contextlib.rst:69 +msgid "The function can then be used like this::" +msgstr "" + +#: ../../library/contextlib.rst:75 msgid "" "The function being decorated must return a :term:`generator`-iterator when " "called. This iterator must yield exactly one value, which will be bound to " "the targets in the :keyword:`with` statement's :keyword:`!as` clause, if any." msgstr "" -#: ../../library/contextlib.rst:77 +#: ../../library/contextlib.rst:79 msgid "" "At the point where the generator yields, the block nested in the :keyword:" "`with` statement is executed. The generator is then resumed after the block " @@ -104,7 +108,7 @@ msgid "" "the :keyword:`!with` statement." msgstr "" -#: ../../library/contextlib.rst:89 +#: ../../library/contextlib.rst:91 msgid "" ":func:`contextmanager` uses :class:`ContextDecorator` so the context " "managers it creates can be used as decorators as well as in :keyword:`with` " @@ -115,17 +119,17 @@ msgid "" "decorators)." msgstr "" -#: ../../library/contextlib.rst:96 +#: ../../library/contextlib.rst:98 msgid "Use of :class:`ContextDecorator`." msgstr "" -#: ../../library/contextlib.rst:102 +#: ../../library/contextlib.rst:104 msgid "" "Similar to :func:`~contextlib.contextmanager`, but creates an :ref:" "`asynchronous context manager `." msgstr "" -#: ../../library/contextlib.rst:105 +#: ../../library/contextlib.rst:107 msgid "" "This function is a :term:`decorator` that can be used to define a factory " "function for :keyword:`async with` statement asynchronous context managers, " @@ -134,20 +138,20 @@ msgid "" "function." msgstr "" -#: ../../library/contextlib.rst:111 +#: ../../library/contextlib.rst:113 msgid "A simple example::" msgstr "" "一個簡單範例:\n" "\n" "::" -#: ../../library/contextlib.rst:129 +#: ../../library/contextlib.rst:131 msgid "" "Context managers defined with :func:`asynccontextmanager` can be used either " "as decorators or with :keyword:`async with` statements::" msgstr "" -#: ../../library/contextlib.rst:147 +#: ../../library/contextlib.rst:149 msgid "" "When used as a decorator, a new generator instance is implicitly created on " "each function call. This allows the otherwise \"one-shot\" context managers " @@ -155,42 +159,42 @@ msgid "" "managers support multiple invocations in order to be used as decorators." msgstr "" -#: ../../library/contextlib.rst:152 +#: ../../library/contextlib.rst:154 msgid "" "Async context managers created with :func:`asynccontextmanager` can be used " "as decorators." msgstr "" -#: ../../library/contextlib.rst:159 +#: ../../library/contextlib.rst:161 msgid "" "Return a context manager that closes *thing* upon completion of the block. " "This is basically equivalent to::" msgstr "" -#: ../../library/contextlib.rst:171 +#: ../../library/contextlib.rst:173 msgid "And lets you write code like this::" msgstr "" -#: ../../library/contextlib.rst:180 +#: ../../library/contextlib.rst:182 msgid "" "without needing to explicitly close ``page``. Even if an error occurs, " "``page.close()`` will be called when the :keyword:`with` block is exited." msgstr "" -#: ../../library/contextlib.rst:186 +#: ../../library/contextlib.rst:188 msgid "" "Return an async context manager that calls the ``aclose()`` method of " "*thing* upon completion of the block. This is basically equivalent to::" msgstr "" -#: ../../library/contextlib.rst:198 +#: ../../library/contextlib.rst:200 msgid "" "Significantly, ``aclosing()`` supports deterministic cleanup of async " "generators when they happen to exit early by :keyword:`break` or an " "exception. For example::" msgstr "" -#: ../../library/contextlib.rst:209 +#: ../../library/contextlib.rst:211 msgid "" "This pattern ensures that the generator's async exit code is executed in the " "same context as its iterations (so that exceptions and context variables " @@ -198,31 +202,31 @@ msgid "" "task it depends on)." msgstr "" -#: ../../library/contextlib.rst:221 +#: ../../library/contextlib.rst:223 msgid "" "Return a context manager that returns *enter_result* from ``__enter__``, but " "otherwise does nothing. It is intended to be used as a stand-in for an " "optional context manager, for example::" msgstr "" -#: ../../library/contextlib.rst:235 +#: ../../library/contextlib.rst:237 msgid "An example using *enter_result*::" msgstr "" "一個使用 *enter_result* 的範例:\n" "\n" "::" -#: ../../library/contextlib.rst:248 +#: ../../library/contextlib.rst:250 msgid "" "It can also be used as a stand-in for :ref:`asynchronous context managers " "`::" msgstr "" -#: ../../library/contextlib.rst:264 +#: ../../library/contextlib.rst:266 msgid ":term:`asynchronous context manager` support was added." msgstr "" -#: ../../library/contextlib.rst:271 +#: ../../library/contextlib.rst:273 msgid "" "Return a context manager that suppresses any of the specified exceptions if " "they occur in the body of a :keyword:`!with` statement and then resumes " @@ -230,7 +234,7 @@ msgid "" "statement." msgstr "" -#: ../../library/contextlib.rst:276 +#: ../../library/contextlib.rst:278 msgid "" "As with any other mechanism that completely suppresses exceptions, this " "context manager should be used only to cover very specific errors where " @@ -238,35 +242,35 @@ msgid "" "do." msgstr "" -#: ../../library/contextlib.rst:281 +#: ../../library/contextlib.rst:283 msgid "For example::" msgstr "" "舉例來說:\n" "\n" "::" -#: ../../library/contextlib.rst:291 +#: ../../library/contextlib.rst:293 msgid "This code is equivalent to::" msgstr "" -#: ../../library/contextlib.rst:303 ../../library/contextlib.rst:343 -#: ../../library/contextlib.rst:353 +#: ../../library/contextlib.rst:305 ../../library/contextlib.rst:345 +#: ../../library/contextlib.rst:355 msgid "This context manager is :ref:`reentrant `." msgstr "" -#: ../../library/contextlib.rst:310 +#: ../../library/contextlib.rst:312 msgid "" "Context manager for temporarily redirecting :data:`sys.stdout` to another " "file or file-like object." msgstr "" -#: ../../library/contextlib.rst:313 +#: ../../library/contextlib.rst:315 msgid "" "This tool adds flexibility to existing functions or classes whose output is " "hardwired to stdout." msgstr "" -#: ../../library/contextlib.rst:316 +#: ../../library/contextlib.rst:318 msgid "" "For example, the output of :func:`help` normally is sent to *sys.stdout*. " "You can capture that output in a string by redirecting the output to an :" @@ -275,17 +279,17 @@ msgid "" "`with` statement::" msgstr "" -#: ../../library/contextlib.rst:326 +#: ../../library/contextlib.rst:328 msgid "" "To send the output of :func:`help` to a file on disk, redirect the output to " "a regular file::" msgstr "" -#: ../../library/contextlib.rst:333 +#: ../../library/contextlib.rst:335 msgid "To send the output of :func:`help` to *sys.stderr*::" msgstr "" -#: ../../library/contextlib.rst:338 +#: ../../library/contextlib.rst:340 msgid "" "Note that the global side effect on :data:`sys.stdout` means that this " "context manager is not suitable for use in library code and most threaded " @@ -293,59 +297,63 @@ msgid "" "it is still a useful approach for many utility scripts." msgstr "" -#: ../../library/contextlib.rst:350 +#: ../../library/contextlib.rst:352 msgid "" "Similar to :func:`~contextlib.redirect_stdout` but redirecting :data:`sys." "stderr` to another file or file-like object." msgstr "" -#: ../../library/contextlib.rst:360 +#: ../../library/contextlib.rst:362 msgid "" "A base class that enables a context manager to also be used as a decorator." msgstr "" -#: ../../library/contextlib.rst:362 +#: ../../library/contextlib.rst:364 msgid "" "Context managers inheriting from ``ContextDecorator`` have to implement " "``__enter__`` and ``__exit__`` as normal. ``__exit__`` retains its optional " "exception handling even when used as a decorator." msgstr "" -#: ../../library/contextlib.rst:366 +#: ../../library/contextlib.rst:368 msgid "" "``ContextDecorator`` is used by :func:`contextmanager`, so you get this " "functionality automatically." msgstr "" -#: ../../library/contextlib.rst:369 +#: ../../library/contextlib.rst:371 msgid "Example of ``ContextDecorator``::" msgstr "" "``ContextDecorator`` 範例:\n" "\n" "::" -#: ../../library/contextlib.rst:398 +#: ../../library/contextlib.rst:384 ../../library/contextlib.rst:456 +msgid "The class can then be used like this::" +msgstr "" + +#: ../../library/contextlib.rst:402 msgid "" "This change is just syntactic sugar for any construct of the following form::" msgstr "" -#: ../../library/contextlib.rst:404 +#: ../../library/contextlib.rst:408 msgid "``ContextDecorator`` lets you instead write::" msgstr "" -#: ../../library/contextlib.rst:410 +#: ../../library/contextlib.rst:414 msgid "" "It makes it clear that the ``cm`` applies to the whole function, rather than " "just a piece of it (and saving an indentation level is nice, too)." msgstr "" -#: ../../library/contextlib.rst:413 +#: ../../library/contextlib.rst:417 msgid "" "Existing context managers that already have a base class can be extended by " "using ``ContextDecorator`` as a mixin class::" msgstr "" -#: ../../library/contextlib.rst:426 +#: ../../library/contextlib.rst:430 msgid "" "As the decorated function must be able to be called multiple times, the " "underlying context manager must support use in multiple :keyword:`with` " @@ -353,38 +361,38 @@ msgid "" "explicit :keyword:`!with` statement inside the function should be used." msgstr "" -#: ../../library/contextlib.rst:436 +#: ../../library/contextlib.rst:440 msgid "" "Similar to :class:`ContextDecorator` but only for asynchronous functions." msgstr "" -#: ../../library/contextlib.rst:438 +#: ../../library/contextlib.rst:442 msgid "Example of ``AsyncContextDecorator``::" msgstr "" "``AsyncContextDecorator`` 範例:\n" "\n" "::" -#: ../../library/contextlib.rst:475 +#: ../../library/contextlib.rst:481 msgid "" "A context manager that is designed to make it easy to programmatically " "combine other context managers and cleanup functions, especially those that " "are optional or otherwise driven by input data." msgstr "" -#: ../../library/contextlib.rst:479 +#: ../../library/contextlib.rst:485 msgid "" "For example, a set of files may easily be handled in a single with statement " "as follows::" msgstr "" -#: ../../library/contextlib.rst:488 +#: ../../library/contextlib.rst:494 msgid "" "The :meth:`__enter__` method returns the :class:`ExitStack` instance, and " "performs no additional operations." msgstr "" -#: ../../library/contextlib.rst:491 +#: ../../library/contextlib.rst:497 msgid "" "Each instance maintains a stack of registered callbacks that are called in " "reverse order when the instance is closed (either explicitly or implicitly " @@ -392,14 +400,14 @@ msgid "" "invoked implicitly when the context stack instance is garbage collected." msgstr "" -#: ../../library/contextlib.rst:496 +#: ../../library/contextlib.rst:502 msgid "" "This stack model is used so that context managers that acquire their " "resources in their ``__init__`` method (such as file objects) can be handled " "correctly." msgstr "" -#: ../../library/contextlib.rst:500 +#: ../../library/contextlib.rst:506 msgid "" "Since registered callbacks are invoked in the reverse order of registration, " "this ends up behaving as if multiple nested :keyword:`with` statements had " @@ -409,7 +417,7 @@ msgid "" "updated state." msgstr "" -#: ../../library/contextlib.rst:507 +#: ../../library/contextlib.rst:513 msgid "" "This is a relatively low level API that takes care of the details of " "correctly unwinding the stack of exit callbacks. It provides a suitable " @@ -417,68 +425,68 @@ msgid "" "in application specific ways." msgstr "" -#: ../../library/contextlib.rst:516 +#: ../../library/contextlib.rst:522 msgid "" "Enters a new context manager and adds its :meth:`__exit__` method to the " "callback stack. The return value is the result of the context manager's own :" "meth:`__enter__` method." msgstr "" -#: ../../library/contextlib.rst:520 +#: ../../library/contextlib.rst:526 msgid "" "These context managers may suppress exceptions just as they normally would " "if used directly as part of a :keyword:`with` statement." msgstr "" -#: ../../library/contextlib.rst:525 +#: ../../library/contextlib.rst:531 msgid "Adds a context manager's :meth:`__exit__` method to the callback stack." msgstr "" -#: ../../library/contextlib.rst:527 +#: ../../library/contextlib.rst:533 msgid "" "As ``__enter__`` is *not* invoked, this method can be used to cover part of " "an :meth:`__enter__` implementation with a context manager's own :meth:" "`__exit__` method." msgstr "" -#: ../../library/contextlib.rst:531 +#: ../../library/contextlib.rst:537 msgid "" "If passed an object that is not a context manager, this method assumes it is " "a callback with the same signature as a context manager's :meth:`__exit__` " "method and adds it directly to the callback stack." msgstr "" -#: ../../library/contextlib.rst:535 +#: ../../library/contextlib.rst:541 msgid "" "By returning true values, these callbacks can suppress exceptions the same " "way context manager :meth:`__exit__` methods can." msgstr "" -#: ../../library/contextlib.rst:538 +#: ../../library/contextlib.rst:544 msgid "" "The passed in object is returned from the function, allowing this method to " "be used as a function decorator." msgstr "" -#: ../../library/contextlib.rst:543 +#: ../../library/contextlib.rst:549 msgid "" "Accepts an arbitrary callback function and arguments and adds it to the " "callback stack." msgstr "" -#: ../../library/contextlib.rst:546 +#: ../../library/contextlib.rst:552 msgid "" "Unlike the other methods, callbacks added this way cannot suppress " "exceptions (as they are never passed the exception details)." msgstr "" -#: ../../library/contextlib.rst:549 +#: ../../library/contextlib.rst:555 msgid "" "The passed in callback is returned from the function, allowing this method " "to be used as a function decorator." msgstr "" -#: ../../library/contextlib.rst:554 +#: ../../library/contextlib.rst:560 msgid "" "Transfers the callback stack to a fresh :class:`ExitStack` instance and " "returns it. No callbacks are invoked by this operation - instead, they will " @@ -486,70 +494,70 @@ msgid "" "at the end of a :keyword:`with` statement)." msgstr "" -#: ../../library/contextlib.rst:559 +#: ../../library/contextlib.rst:565 msgid "" "For example, a group of files can be opened as an \"all or nothing\" " "operation as follows::" msgstr "" -#: ../../library/contextlib.rst:573 +#: ../../library/contextlib.rst:579 msgid "" "Immediately unwinds the callback stack, invoking callbacks in the reverse " "order of registration. For any context managers and exit callbacks " "registered, the arguments passed in will indicate that no exception occurred." msgstr "" -#: ../../library/contextlib.rst:580 +#: ../../library/contextlib.rst:586 msgid "" "An :ref:`asynchronous context manager `, similar to :" "class:`ExitStack`, that supports combining both synchronous and asynchronous " "context managers, as well as having coroutines for cleanup logic." msgstr "" -#: ../../library/contextlib.rst:585 +#: ../../library/contextlib.rst:591 msgid "" "The :meth:`close` method is not implemented, :meth:`aclose` must be used " "instead." msgstr "" -#: ../../library/contextlib.rst:590 +#: ../../library/contextlib.rst:596 msgid "" "Similar to :meth:`enter_context` but expects an asynchronous context manager." msgstr "" -#: ../../library/contextlib.rst:595 +#: ../../library/contextlib.rst:601 msgid "" "Similar to :meth:`push` but expects either an asynchronous context manager " "or a coroutine function." msgstr "" -#: ../../library/contextlib.rst:600 +#: ../../library/contextlib.rst:606 msgid "Similar to :meth:`callback` but expects a coroutine function." msgstr "" -#: ../../library/contextlib.rst:604 +#: ../../library/contextlib.rst:610 msgid "Similar to :meth:`close` but properly handles awaitables." msgstr "" -#: ../../library/contextlib.rst:606 +#: ../../library/contextlib.rst:612 msgid "Continuing the example for :func:`asynccontextmanager`::" msgstr "" -#: ../../library/contextlib.rst:618 +#: ../../library/contextlib.rst:624 msgid "Examples and Recipes" msgstr "" -#: ../../library/contextlib.rst:620 +#: ../../library/contextlib.rst:626 msgid "" "This section describes some examples and recipes for making effective use of " "the tools provided by :mod:`contextlib`." msgstr "" -#: ../../library/contextlib.rst:625 +#: ../../library/contextlib.rst:631 msgid "Supporting a variable number of context managers" msgstr "" -#: ../../library/contextlib.rst:627 +#: ../../library/contextlib.rst:633 msgid "" "The primary use case for :class:`ExitStack` is the one given in the class " "documentation: supporting a variable number of context managers and other " @@ -559,18 +567,18 @@ msgid "" "of the context managers being optional::" msgstr "" -#: ../../library/contextlib.rst:642 +#: ../../library/contextlib.rst:648 msgid "" "As shown, :class:`ExitStack` also makes it quite easy to use :keyword:`with` " "statements to manage arbitrary resources that don't natively support the " "context management protocol." msgstr "" -#: ../../library/contextlib.rst:648 +#: ../../library/contextlib.rst:654 msgid "Catching exceptions from ``__enter__`` methods" msgstr "" -#: ../../library/contextlib.rst:650 +#: ../../library/contextlib.rst:656 msgid "" "It is occasionally desirable to catch exceptions from an ``__enter__`` " "method implementation, *without* inadvertently catching exceptions from the :" @@ -579,7 +587,7 @@ msgid "" "be separated slightly in order to allow this::" msgstr "" -#: ../../library/contextlib.rst:665 +#: ../../library/contextlib.rst:671 msgid "" "Actually needing to do this is likely to indicate that the underlying API " "should be providing a direct resource management interface for use with :" @@ -590,29 +598,29 @@ msgid "" "`with` statement." msgstr "" -#: ../../library/contextlib.rst:675 +#: ../../library/contextlib.rst:681 msgid "Cleaning up in an ``__enter__`` implementation" msgstr "" -#: ../../library/contextlib.rst:677 +#: ../../library/contextlib.rst:683 msgid "" "As noted in the documentation of :meth:`ExitStack.push`, this method can be " "useful in cleaning up an already allocated resource if later steps in the :" "meth:`__enter__` implementation fail." msgstr "" -#: ../../library/contextlib.rst:681 +#: ../../library/contextlib.rst:687 msgid "" "Here's an example of doing this for a context manager that accepts resource " "acquisition and release functions, along with an optional validation " "function, and maps them to the context management protocol::" msgstr "" -#: ../../library/contextlib.rst:721 +#: ../../library/contextlib.rst:727 msgid "Replacing any use of ``try-finally`` and flag variables" msgstr "" -#: ../../library/contextlib.rst:723 +#: ../../library/contextlib.rst:729 msgid "" "A pattern you will sometimes see is a ``try-finally`` statement with a flag " "variable to indicate whether or not the body of the ``finally`` clause " @@ -620,57 +628,57 @@ msgid "" "by using an ``except`` clause instead), it looks something like this::" msgstr "" -#: ../../library/contextlib.rst:737 +#: ../../library/contextlib.rst:743 msgid "" "As with any ``try`` statement based code, this can cause problems for " "development and review, because the setup code and the cleanup code can end " "up being separated by arbitrarily long sections of code." msgstr "" -#: ../../library/contextlib.rst:741 +#: ../../library/contextlib.rst:747 msgid "" ":class:`ExitStack` makes it possible to instead register a callback for " "execution at the end of a ``with`` statement, and then later decide to skip " "executing that callback::" msgstr "" -#: ../../library/contextlib.rst:753 +#: ../../library/contextlib.rst:759 msgid "" "This allows the intended cleanup up behaviour to be made explicit up front, " "rather than requiring a separate flag variable." msgstr "" -#: ../../library/contextlib.rst:756 +#: ../../library/contextlib.rst:762 msgid "" "If a particular application uses this pattern a lot, it can be simplified " "even further by means of a small helper class::" msgstr "" -#: ../../library/contextlib.rst:774 +#: ../../library/contextlib.rst:780 msgid "" "If the resource cleanup isn't already neatly bundled into a standalone " "function, then it is still possible to use the decorator form of :meth:" "`ExitStack.callback` to declare the resource cleanup in advance::" msgstr "" -#: ../../library/contextlib.rst:789 +#: ../../library/contextlib.rst:795 msgid "" "Due to the way the decorator protocol works, a callback function declared " "this way cannot take any parameters. Instead, any resources to be released " "must be accessed as closure variables." msgstr "" -#: ../../library/contextlib.rst:795 +#: ../../library/contextlib.rst:801 msgid "Using a context manager as a function decorator" msgstr "" -#: ../../library/contextlib.rst:797 +#: ../../library/contextlib.rst:803 msgid "" ":class:`ContextDecorator` makes it possible to use a context manager in both " "an ordinary ``with`` statement and also as a function decorator." msgstr "" -#: ../../library/contextlib.rst:800 +#: ../../library/contextlib.rst:806 msgid "" "For example, it is sometimes useful to wrap functions or groups of " "statements with a logger that can track the time of entry and time of exit. " @@ -679,15 +687,15 @@ msgid "" "in a single definition::" msgstr "" -#: ../../library/contextlib.rst:821 +#: ../../library/contextlib.rst:827 msgid "Instances of this class can be used as both a context manager::" msgstr "" -#: ../../library/contextlib.rst:827 +#: ../../library/contextlib.rst:833 msgid "And also as a function decorator::" msgstr "" -#: ../../library/contextlib.rst:834 +#: ../../library/contextlib.rst:840 msgid "" "Note that there is one additional limitation when using context managers as " "function decorators: there's no way to access the return value of :meth:" @@ -695,21 +703,21 @@ msgid "" "explicit ``with`` statement." msgstr "" -#: ../../library/contextlib.rst:842 +#: ../../library/contextlib.rst:848 msgid ":pep:`343` - The \"with\" statement" msgstr ":pep:`343` - \"with\" 陳述式" -#: ../../library/contextlib.rst:842 +#: ../../library/contextlib.rst:848 msgid "" "The specification, background, and examples for the Python :keyword:`with` " "statement." msgstr "" -#: ../../library/contextlib.rst:848 +#: ../../library/contextlib.rst:854 msgid "Single use, reusable and reentrant context managers" msgstr "" -#: ../../library/contextlib.rst:850 +#: ../../library/contextlib.rst:856 msgid "" "Most context managers are written in a way that means they can only be used " "effectively in a :keyword:`with` statement once. These single use context " @@ -717,32 +725,32 @@ msgid "" "them a second time will trigger an exception or otherwise not work correctly." msgstr "" -#: ../../library/contextlib.rst:856 +#: ../../library/contextlib.rst:862 msgid "" "This common limitation means that it is generally advisable to create " "context managers directly in the header of the :keyword:`with` statement " "where they are used (as shown in all of the usage examples above)." msgstr "" -#: ../../library/contextlib.rst:860 +#: ../../library/contextlib.rst:866 msgid "" "Files are an example of effectively single use context managers, since the " "first :keyword:`with` statement will close the file, preventing any further " "IO operations using that file object." msgstr "" -#: ../../library/contextlib.rst:864 +#: ../../library/contextlib.rst:870 msgid "" "Context managers created using :func:`contextmanager` are also single use " "context managers, and will complain about the underlying generator failing " "to yield if an attempt is made to use them a second time::" msgstr "" -#: ../../library/contextlib.rst:892 +#: ../../library/contextlib.rst:898 msgid "Reentrant context managers" msgstr "" -#: ../../library/contextlib.rst:894 +#: ../../library/contextlib.rst:900 msgid "" "More sophisticated context managers may be \"reentrant\". These context " "managers can not only be used in multiple :keyword:`with` statements, but " @@ -750,21 +758,21 @@ msgid "" "the same context manager." msgstr "" -#: ../../library/contextlib.rst:899 +#: ../../library/contextlib.rst:905 msgid "" ":class:`threading.RLock` is an example of a reentrant context manager, as " "are :func:`suppress` and :func:`redirect_stdout`. Here's a very simple " "example of reentrant use::" msgstr "" -#: ../../library/contextlib.rst:918 +#: ../../library/contextlib.rst:924 msgid "" "Real world examples of reentrancy are more likely to involve multiple " "functions calling each other and hence be far more complicated than this " "example." msgstr "" -#: ../../library/contextlib.rst:922 +#: ../../library/contextlib.rst:928 msgid "" "Note also that being reentrant is *not* the same thing as being thread " "safe. :func:`redirect_stdout`, for example, is definitely not thread safe, " @@ -772,11 +780,11 @@ msgid "" "stdout` to a different stream." msgstr "" -#: ../../library/contextlib.rst:931 +#: ../../library/contextlib.rst:937 msgid "Reusable context managers" msgstr "" -#: ../../library/contextlib.rst:933 +#: ../../library/contextlib.rst:939 msgid "" "Distinct from both single use and reentrant context managers are \"reusable" "\" context managers (or, to be completely explicit, \"reusable, but not " @@ -786,21 +794,21 @@ msgid "" "instance has already been used in a containing with statement." msgstr "" -#: ../../library/contextlib.rst:940 +#: ../../library/contextlib.rst:946 msgid "" ":class:`threading.Lock` is an example of a reusable, but not reentrant, " "context manager (for a reentrant lock, it is necessary to use :class:" "`threading.RLock` instead)." msgstr "" -#: ../../library/contextlib.rst:944 +#: ../../library/contextlib.rst:950 msgid "" "Another example of a reusable, but not reentrant, context manager is :class:" "`ExitStack`, as it invokes *all* currently registered callbacks when leaving " "any with statement, regardless of where those callbacks were added::" msgstr "" -#: ../../library/contextlib.rst:975 +#: ../../library/contextlib.rst:981 msgid "" "As the output from the example shows, reusing a single stack object across " "multiple with statements works correctly, but attempting to nest them will " @@ -808,7 +816,7 @@ msgid "" "which is unlikely to be desirable behaviour." msgstr "" -#: ../../library/contextlib.rst:980 +#: ../../library/contextlib.rst:986 msgid "" "Using separate :class:`ExitStack` instances instead of reusing a single " "instance avoids that problem::" diff --git a/library/typing.po b/library/typing.po index b63c3a2337..bad5b780c0 100644 --- a/library/typing.po +++ b/library/typing.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-09-21 00:21+0000\n" +"POT-Creation-Date: 2022-10-13 00:23+0000\n" "PO-Revision-Date: 2018-05-23 16:14+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -461,7 +461,7 @@ msgstr "" #: ../../library/typing.rst:457 msgid "" -"Notice that no typechecking is performed when assigning a value of type :" +"Notice that no type checking is performed when assigning a value of type :" "data:`Any` to a more precise type. For example, the static type checker did " "not report an error when assigning ``a`` to ``s`` even though ``s`` was " "declared to be of type :class:`str` and receives an :class:`int` value at " diff --git a/tutorial/interpreter.po b/tutorial/interpreter.po index cc4c8cc51c..04a137c88c 100644 --- a/tutorial/interpreter.po +++ b/tutorial/interpreter.po @@ -8,7 +8,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-10-13 00:23+0000\n" "PO-Revision-Date: 2021-05-18 16:28+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -35,8 +35,8 @@ msgid "" "local/bin` in your Unix shell's search path makes it possible to start it by " "typing the command:" msgstr "" -"Python 直譯器一般安裝在 :file:`/usr/local/bin/python3.10` 路徑下;將 :file:`" -"/usr/local/bin` 加入Unix shell 的搜索路徑,輸入以下指令就可以啟動 Python:" +"Python 直譯器一般安裝在 :file:`/usr/local/bin/python3.10` 路徑下;將 :file:`/" +"usr/local/bin` 加入Unix shell 的搜索路徑,輸入以下指令就可以啟動 Python:" #: ../../tutorial/interpreter.rst:21 msgid "" @@ -58,9 +58,9 @@ msgid "" "Python." msgstr "" "Windows 系統中,從 :ref:`Microsoft Store ` 安裝 Python 後,就" -"可以使用 :file:`python3.10` 命令了。如果安裝了 :ref:`py.exe launcher" -" ` ,則可以使用 :file:`py` 命令。請參閱附錄:\\ :ref:`setting" -"-envvars`\\ ,了解其他啟動 Python 的方式。" +"可以使用 :file:`python3.10` 命令了。如果安裝了 :ref:`py.exe launcher " +"` ,則可以使用 :file:`py` 命令。請參閱附錄:\\ :ref:`setting-" +"envvars`\\ ,了解其他啟動 Python 的方式。" #: ../../tutorial/interpreter.rst:31 msgid "" @@ -104,12 +104,13 @@ msgstr "" "它會將這個檔案視為\\ **腳本**\\ 來閱讀。" #: ../../tutorial/interpreter.rst:51 +#, fuzzy msgid "" "A second way of starting the interpreter is ``python -c command [arg] ...``, " "which executes the statement(s) in *command*, analogous to the shell's :" "option:`-c` option. Since Python statements often contain spaces or other " "characters that are special to the shell, it is usually advised to quote " -"*command* in its entirety with single quotes." +"*command* in its entirety." msgstr "" "另一個啟動直譯器的方式為 ``python -c command [arg] ...``\\ ,它會執行在 " "*command* 裡的指令(們),行為如同 shell 的 :option:`-c` 選項。因為 Python 的" From 6aeb6522a0afc73a9785602e6727c7e1b10d004e Mon Sep 17 00:00:00 2001 From: "Matt.Wang" Date: Sun, 16 Oct 2022 03:51:28 +0800 Subject: [PATCH 14/14] fix: resolve fuzzy entries --- c-api/arg.po | 82 ++++++++++++++++++--------------------- c-api/call.po | 16 +++----- faq/general.po | 59 ++++++++-------------------- glossary.po | 17 +++++--- library/asyncio-future.po | 3 +- library/ctypes.po | 57 ++++++++++----------------- library/struct.po | 54 +++++++++----------------- tutorial/interpreter.po | 3 +- tutorial/introduction.po | 8 ++-- 9 files changed, 113 insertions(+), 186 deletions(-) diff --git a/c-api/arg.po b/c-api/arg.po index 9e5bbd62ac..321eb15476 100644 --- a/c-api/arg.po +++ b/c-api/arg.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2022-10-06 00:23+0000\n" -"PO-Revision-Date: 2021-11-22 16:44+0800\n" +"PO-Revision-Date: 2022-10-16 03:21+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -17,7 +17,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\n" +"X-Generator: Poedit 3.1.1\n" #: ../../c-api/arg.rst:6 msgid "Parsing arguments and building values" @@ -473,18 +473,19 @@ msgstr "``h`` (:class:`int`) [short int]" #: ../../c-api/arg.rst:262 msgid "Convert a Python integer to a C :c:expr:`short int`." -msgstr "" +msgstr "將一個 Python 整數轉換成 C 的 :c:expr:`short int`。" #: ../../c-api/arg.rst:266 ../../c-api/arg.rst:602 msgid "``H`` (:class:`int`) [unsigned short int]" msgstr "``H`` (:class:`int`) [unsigned short int]" #: ../../c-api/arg.rst:265 -#, fuzzy msgid "" "Convert a Python integer to a C :c:expr:`unsigned short int`, without " "overflow checking." -msgstr "將一個 C 的 :c:type:`unsigned short int` 轉換成 Python 整數物件。" +msgstr "" +"將一個 Python 整數轉換成 C 的 :c:expr:`unsigned short int`,轉換過程無溢位檢" +"查。" #: ../../c-api/arg.rst:269 ../../c-api/arg.rst:587 msgid "``i`` (:class:`int`) [int]" @@ -492,7 +493,7 @@ msgstr "``i`` (:class:`int`) [int]" #: ../../c-api/arg.rst:269 msgid "Convert a Python integer to a plain C :c:expr:`int`." -msgstr "" +msgstr "將一個 Python 整數轉換成 C 的 :c:expr:`int`。" #: ../../c-api/arg.rst:273 ../../c-api/arg.rst:605 msgid "``I`` (:class:`int`) [unsigned int]" @@ -503,6 +504,7 @@ msgid "" "Convert a Python integer to a C :c:expr:`unsigned int`, without overflow " "checking." msgstr "" +"將一個 Python 整數轉換成 C 的 :c:expr:`unsigned int`,轉換過程無溢位檢查。" #: ../../c-api/arg.rst:276 ../../c-api/arg.rst:596 msgid "``l`` (:class:`int`) [long int]" @@ -510,7 +512,7 @@ msgstr "``l`` (:class:`int`) [long int]" #: ../../c-api/arg.rst:276 msgid "Convert a Python integer to a C :c:expr:`long int`." -msgstr "" +msgstr "將一個 Python 整數轉換成 C 的 :c:expr:`long int`。" #: ../../c-api/arg.rst:280 ../../c-api/arg.rst:608 msgid "``k`` (:class:`int`) [unsigned long]" @@ -521,6 +523,7 @@ msgid "" "Convert a Python integer to a C :c:expr:`unsigned long` without overflow " "checking." msgstr "" +"將一個 Python 整數轉換成 C 的 :c:expr:`unsigned long`,轉換過程無溢位檢查。" #: ../../c-api/arg.rst:283 ../../c-api/arg.rst:611 msgid "``L`` (:class:`int`) [long long]" @@ -528,18 +531,19 @@ msgstr "``L`` (:class:`int`) [long long]" #: ../../c-api/arg.rst:283 msgid "Convert a Python integer to a C :c:expr:`long long`." -msgstr "" +msgstr "將一個 Python 整數轉換成 C 的 :c:expr:`long long`。" #: ../../c-api/arg.rst:287 ../../c-api/arg.rst:614 msgid "``K`` (:class:`int`) [unsigned long long]" msgstr "``K`` (:class:`int`) [unsigned long long]" #: ../../c-api/arg.rst:286 -#, fuzzy msgid "" "Convert a Python integer to a C :c:expr:`unsigned long long` without " "overflow checking." -msgstr "將一個 C 的 :c:type:`unsigned long long` 轉換成 Python 整數物件。" +msgstr "" +"將一個 Python 整數轉換成 C 的 :c:expr:`unsigned long long`,轉換過程無溢位檢" +"查。" #: ../../c-api/arg.rst:290 ../../c-api/arg.rst:617 msgid "``n`` (:class:`int`) [:c:type:`Py_ssize_t`]" @@ -547,7 +551,7 @@ msgstr "``n`` (:class:`int`) [:c:type:`Py_ssize_t`]" #: ../../c-api/arg.rst:290 msgid "Convert a Python integer to a C :c:type:`Py_ssize_t`." -msgstr "" +msgstr "將一個 Python 整數轉換成 C 的 :c:type:`Py_ssize_t`。" #: ../../c-api/arg.rst:297 msgid "``c`` (:class:`bytes` or :class:`bytearray` of length 1) [char]" @@ -578,18 +582,16 @@ msgid "``f`` (:class:`float`) [float]" msgstr "``f`` (:class:`float`) [float]" #: ../../c-api/arg.rst:304 -#, fuzzy msgid "Convert a Python floating point number to a C :c:expr:`float`." -msgstr "將一個 C 的 :c:type:`float` 轉換成 Python 浮點數。" +msgstr "將一個 Python 浮點數轉換成 C 的 :c:type::c:expr:`float`。" #: ../../c-api/arg.rst:307 ../../c-api/arg.rst:628 msgid "``d`` (:class:`float`) [double]" msgstr "``d`` (:class:`float`) [double]" #: ../../c-api/arg.rst:307 -#, fuzzy msgid "Convert a Python floating point number to a C :c:expr:`double`." -msgstr "將一個 C 的 :c:type:`float` 轉換成 Python 浮點數。" +msgstr "將一個 Python 浮點數轉換成 C 的 :c:type::c:expr:`double`。" #: ../../c-api/arg.rst:310 msgid "``D`` (:class:`complex`) [Py_complex]" @@ -597,7 +599,7 @@ msgstr "``D`` (:class:`complex`) [Py_complex]" #: ../../c-api/arg.rst:310 msgid "Convert a Python complex number to a C :c:type:`Py_complex` structure." -msgstr "" +msgstr "將一個 Python 複數轉換成 C 的 :c:type:`Py_complex` 結構。" #: ../../c-api/arg.rst:313 msgid "Other objects" @@ -997,58 +999,48 @@ msgstr "" "``U#``\\ (:class:`str` 或 ``None``)[const char \\*, :c:type:`Py_ssize_t`]" #: ../../c-api/arg.rst:587 -#, fuzzy msgid "Convert a plain C :c:expr:`int` to a Python integer object." -msgstr "將一個 C 的 :c:type:`int` 轉換成 Python 整數物件。" +msgstr "將一個 C 的 :c:expr:`int` 轉換成 Python 整數物件。" #: ../../c-api/arg.rst:590 msgid "``b`` (:class:`int`) [char]" msgstr "``b`` (:class:`int`) [char]" #: ../../c-api/arg.rst:590 -#, fuzzy msgid "Convert a plain C :c:expr:`char` to a Python integer object." -msgstr "將一個 C 的 :c:type:`char` 轉換成 Python 整數物件。" +msgstr "將一個 C 的 :c:expr:`char` 轉換成 Python 整數物件。" #: ../../c-api/arg.rst:593 -#, fuzzy msgid "Convert a plain C :c:expr:`short int` to a Python integer object." -msgstr "將一個 C 的 :c:type:`short int` 轉換成 Python 整數物件。" +msgstr "將一個 C 的 :c:expr:`short int` 轉換成 Python 整數物件。" #: ../../c-api/arg.rst:596 -#, fuzzy msgid "Convert a C :c:expr:`long int` to a Python integer object." -msgstr "將一個 C 的 :c:type:`long int` 轉換成 Python 整數物件。" +msgstr "將一個 C 的 :c:expr:`long int` 轉換成 Python 整數物件。" #: ../../c-api/arg.rst:599 -#, fuzzy msgid "Convert a C :c:expr:`unsigned char` to a Python integer object." -msgstr "將一個 C 的 :c:type:`unsigned char` 轉換成 Python 整數物件。" +msgstr "將一個 C 的 :c:expr:`unsigned char` 轉換成 Python 整數物件。" #: ../../c-api/arg.rst:602 -#, fuzzy msgid "Convert a C :c:expr:`unsigned short int` to a Python integer object." -msgstr "將一個 C 的 :c:type:`unsigned short int` 轉換成 Python 整數物件。" +msgstr "將一個 C 的 :c:expr:`unsigned short int` 轉換成 Python 整數物件。" #: ../../c-api/arg.rst:605 -#, fuzzy msgid "Convert a C :c:expr:`unsigned int` to a Python integer object." -msgstr "將一個 C 的 :c:type:`unsigned int` 轉換成 Python 整數物件。" +msgstr "將一個 C 的 :c:expr:`unsigned int` 轉換成 Python 整數物件。" #: ../../c-api/arg.rst:608 -#, fuzzy msgid "Convert a C :c:expr:`unsigned long` to a Python integer object." -msgstr "將一個 C 的 :c:type:`unsigned long` 轉換成 Python 整數物件。" +msgstr "將一個 C 的 :c:expr:`unsigned long` 轉換成 Python 整數物件。" #: ../../c-api/arg.rst:611 -#, fuzzy msgid "Convert a C :c:expr:`long long` to a Python integer object." -msgstr "將一個 C 的 :c:type:`long long` 轉換成 Python 整數物件。" +msgstr "將一個 C 的 :c:expr:`long long` 轉換成 Python 整數物件。" #: ../../c-api/arg.rst:614 -#, fuzzy msgid "Convert a C :c:expr:`unsigned long long` to a Python integer object." -msgstr "將一個 C 的 :c:type:`unsigned long long` 轉換成 Python 整數物件。" +msgstr "將一個 C 的 :c:expr:`unsigned long long` 轉換成 Python 整數物件。" #: ../../c-api/arg.rst:617 msgid "Convert a C :c:type:`Py_ssize_t` to a Python integer." @@ -1059,28 +1051,28 @@ msgid "``c`` (:class:`bytes` of length 1) [char]" msgstr "``c``\\ (長度為 1 的 :class:`bytes`)[char]" #: ../../c-api/arg.rst:620 -#, fuzzy msgid "" "Convert a C :c:expr:`int` representing a byte to a Python :class:`bytes` " "object of length 1." -msgstr "將一個 C 的 :c:type:`long int` 轉換成 Python 整數物件。" +msgstr "" +"將一個 C 中代表一個位元組的 :c:expr:`int` 轉換成 Python 中長度為一的 :class:" +"`bytes`。" #: ../../c-api/arg.rst:624 -#, fuzzy msgid "" "Convert a C :c:expr:`int` representing a character to Python :class:`str` " "object of length 1." -msgstr "將一個 C 的 :c:type:`unsigned char` 轉換成 Python 整數物件。" +msgstr "" +"將一個 C 中代表一個字元的 :c:expr:`int` 轉換成 Python 中長度為一的 :class:" +"`str`。" #: ../../c-api/arg.rst:628 -#, fuzzy msgid "Convert a C :c:expr:`double` to a Python floating point number." -msgstr "將一個 C 的 :c:type:`double` 轉換成 Python 浮點數。" +msgstr "將一個 C 的 :c:expr:`double` 轉換成 Python 浮點數。" #: ../../c-api/arg.rst:631 -#, fuzzy msgid "Convert a C :c:expr:`float` to a Python floating point number." -msgstr "將一個 C 的 :c:type:`float` 轉換成 Python 浮點數。" +msgstr "將一個 C 的 :c:expr:`float` 轉換成 Python 浮點數。" #: ../../c-api/arg.rst:634 msgid "``D`` (:class:`complex`) [Py_complex \\*]" @@ -1088,7 +1080,7 @@ msgstr "``D`` (:class:`complex`) [Py_complex \\*]" #: ../../c-api/arg.rst:634 msgid "Convert a C :c:type:`Py_complex` structure to a Python complex number." -msgstr "" +msgstr "將一個 C 的 :c:type:`Py_complex` 結構轉換成 Python 複數。" #: ../../c-api/arg.rst:637 msgid "" diff --git a/c-api/call.po b/c-api/call.po index abb7fffb74..4446a0beb3 100644 --- a/c-api/call.po +++ b/c-api/call.po @@ -9,7 +9,7 @@ msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2022-10-06 00:23+0000\n" -"PO-Revision-Date: 2022-06-12 14:46+0800\n" +"PO-Revision-Date: 2022-10-16 03:20+0800\n" "Last-Translator: Matt Wang \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.1\n" +"X-Generator: Poedit 3.1.1\n" #: ../../c-api/call.rst:6 msgid "Call Protocol" @@ -524,12 +524,11 @@ msgstr "" "提供任何引數。" #: ../../c-api/call.rst:278 -#, fuzzy msgid "" "Note that if you only pass :c:expr:`PyObject *` args, :c:func:" "`PyObject_CallFunctionObjArgs` is a faster alternative." msgstr "" -"注意,如果你只傳入 :c:type:`PyObject *` 引數,則 :c:func:" +"注意,如果你只傳入 :c:expr:`PyObject *` 引數,則 :c:func:" "`PyObject_CallFunctionObjArgs` 是另一個更快速的選擇。" #: ../../c-api/call.rst:281 @@ -556,12 +555,11 @@ msgid "" msgstr "這等價於 Python 運算式 ``obj.name(arg1, arg2, ...)``。" #: ../../c-api/call.rst:299 -#, fuzzy msgid "" "Note that if you only pass :c:expr:`PyObject *` args, :c:func:" "`PyObject_CallMethodObjArgs` is a faster alternative." msgstr "" -"注意,如果你只傳入 :c:type:`PyObject *` 引數,則 :c:func:" +"注意,如果你只傳入 :c:expr:`PyObject *` 引數,則 :c:func:" "`PyObject_CallMethodObjArgs` 是另一個更快速的選擇。" #: ../../c-api/call.rst:302 @@ -569,13 +567,12 @@ msgid "The types of *name* and *format* were changed from ``char *``." msgstr "*name* 和 *format* 的型別已從 ``char *`` 更改。" #: ../../c-api/call.rst:308 -#, fuzzy msgid "" "Call a callable Python object *callable*, with a variable number of :c:expr:" "`PyObject *` arguments. The arguments are provided as a variable number of " "parameters followed by *NULL*." msgstr "" -"呼叫一個可呼叫的 Python 物件 *callable*,附帶數量可變的 :c:type:`PyObject *` " +"呼叫一個可呼叫的 Python 物件 *callable*,附帶數量可變的 :c:expr:`PyObject *` " "引數。這些引數是以位置在 *NULL* 後面、數量可變的參數來提供。" #: ../../c-api/call.rst:315 @@ -585,7 +582,6 @@ msgid "" msgstr "這等價於 Python 運算式 ``callable(arg1, arg2, ...)``。" #: ../../c-api/call.rst:321 -#, fuzzy msgid "" "Call a method of the Python object *obj*, where the name of the method is " "given as a Python string object in *name*. It is called with a variable " @@ -593,7 +589,7 @@ msgid "" "variable number of parameters followed by *NULL*." msgstr "" "呼叫 Python 物件 *obj* 中的一個 method,其中 method 名稱由 *name* 中的 " -"Python 字串物件給定。被呼叫時會附帶數量可變的 :c:type:`PyObject *` 引數。這些" +"Python 字串物件給定。被呼叫時會附帶數量可變的 :c:expr:`PyObject *` 引數。這些" "引數是以位置在 *NULL* 後面、且數量可變的參數來提供。" #: ../../c-api/call.rst:332 diff --git a/faq/general.po b/faq/general.po index 7728c714ff..df08a6e961 100644 --- a/faq/general.po +++ b/faq/general.po @@ -11,7 +11,7 @@ msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2022-10-13 00:23+0000\n" -"PO-Revision-Date: 2022-09-01 12:06+0800\n" +"PO-Revision-Date: 2022-10-16 03:39+0800\n" "Last-Translator: Steven Hsu \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -253,28 +253,28 @@ msgstr "Python 的版本編號系統是如何運作的?" #: ../../faq/general.rst:128 msgid "Python versions are numbered \"A.B.C\" or \"A.B\":" -msgstr "" +msgstr "Python 各版本會被編號為 \"A.B.C\" 或 \"A.B\":" #: ../../faq/general.rst:130 msgid "" "*A* is the major version number -- it is only incremented for really major " "changes in the language." -msgstr "" +msgstr "*A* 為主要版本編號 -- 它只會在語言中有真正重大的變更時才會增加。" #: ../../faq/general.rst:132 msgid "" "*B* is the minor version number -- it is incremented for less earth-" "shattering changes." -msgstr "" +msgstr "*B* 為次要版本編號 -- 只有在影響範圍較小的變更出現時增加。" #: ../../faq/general.rst:134 msgid "" "*C* is the micro version number -- it is incremented for each bugfix release." -msgstr "" +msgstr "*C* 為微小版本編號 —- 會在每個錯誤修正發布 (bugfix release) 增加。" #: ../../faq/general.rst:136 msgid "See :pep:`6` for more information about bugfix releases." -msgstr "" +msgstr "更多關於錯誤修正發布的資訊請見 :pep:`6`。" #: ../../faq/general.rst:138 msgid "" @@ -294,27 +294,29 @@ msgstr "" #: ../../faq/general.rst:146 msgid "Alpha, beta and release candidate versions have an additional suffix:" -msgstr "" +msgstr "Alpha、beta 和候選發布版本都有一個額外的後綴:" #: ../../faq/general.rst:148 msgid "The suffix for an alpha version is \"aN\" for some small number *N*." -msgstr "" +msgstr "Alpha 版本的後綴是 \"aN\",其中 *N* 是某個較小的數字。" #: ../../faq/general.rst:149 msgid "The suffix for a beta version is \"bN\" for some small number *N*." -msgstr "" +msgstr "Beta 版本的後綴是 \"bN\",其中 *N* 是某個較小的數字。" #: ../../faq/general.rst:150 msgid "" "The suffix for a release candidate version is \"rcN\" for some small number " "*N*." -msgstr "" +msgstr "候選發布版本的後綴是 \"rcN\",其中 *N* 是某個較小的數字。" #: ../../faq/general.rst:152 msgid "" "In other words, all versions labeled *2.0aN* precede the versions labeled " "*2.0bN*, which precede versions labeled *2.0rcN*, and *those* precede 2.0." msgstr "" +"換句話說,所有標記為 *2.0aN* 的版本都在標記為 *2.0bN* 的版本之前,而 *2.0bN* " +"版本都在標記為 *2.0rcN* 的版本之前,而\\ *它們*\\ 都是在 2.0 版之前。" #: ../../faq/general.rst:155 msgid "" @@ -832,7 +834,6 @@ msgid "" msgstr "有了直譯器,當學生正在程式設計時,說明文件永遠都不會遠離他們。" #: ../../faq/general.rst:443 -#, fuzzy msgid "" "There are also good IDEs for Python. IDLE is a cross-platform IDE for " "Python that is written in Python using Tkinter. Emacs users will be happy to " @@ -843,11 +844,10 @@ msgid "" "Python editing environments." msgstr "" "Python 也有很好的 IDE。IDLE 是 Python 的一個跨平臺 IDE,它以 Python 編寫並使" -"用 Tkinter。PythonWin 是一個 Windows 特有的 IDE。Emacs 使用者會很高興知道 " -"Emacs 有一個非常好的 Python 模式。這些程式設計環境全部都能提供語法突顯 " -"(syntax highlighting)、自動縮排,以及在編寫程式時存取互動式直譯器。要查看 " -"Python 編輯環境的完整清單,請參閱 `Python wiki `_。" +"用 Tkinter。Emacs 使用者會很高興知道 Emacs 有一個非常好的 Python 模式。這些程" +"式設計環境全部都能提供語法突顯 (syntax highlighting)、自動縮排,以及在編寫程" +"式時存取互動式直譯器。要查看 Python 編輯環境的完整清單,請參閱 `Python wiki " +"`_。" #: ../../faq/general.rst:451 msgid "" @@ -857,30 +857,3 @@ msgid "" msgstr "" "如果你想討論 Python 在教育領域中的使用,你可能會有興趣加入 `edu-sig 郵件討論" "群 `_。" - -#~ msgid "" -#~ "Python versions are numbered A.B.C or A.B. A is the major version number " -#~ "-- it is only incremented for really major changes in the language. B is " -#~ "the minor version number, incremented for less earth-shattering changes. " -#~ "C is the micro-level -- it is incremented for each bugfix release. See :" -#~ "pep:`6` for more information about bugfix releases." -#~ msgstr "" -#~ "Python 各版本會被編號為 A.B.C 或 A.B。A 是主要版本編號——它只會在語言中有真" -#~ "正重大的變更時才會增加。B 是次要版本編號,它會在沒那麼重大的變更出現時增" -#~ "加。C 是微小級別——它會在每個錯誤修正發布版本 (bugfix release) 中增加。有關" -#~ "錯誤修正發布版本的更多資訊,請參閱 :pep:`6`。" - -#~ msgid "" -#~ "Alpha, beta and release candidate versions have an additional suffix. " -#~ "The suffix for an alpha version is \"aN\" for some small number N, the " -#~ "suffix for a beta version is \"bN\" for some small number N, and the " -#~ "suffix for a release candidate version is \"rcN\" for some small number " -#~ "N. In other words, all versions labeled 2.0aN precede the versions " -#~ "labeled 2.0bN, which precede versions labeled 2.0rcN, and *those* precede " -#~ "2.0." -#~ msgstr "" -#~ "Alpha、beta 和候選發布版本都有一個額外的後綴。Alpha 版本的後綴是「aN」," -#~ "beta 版本的後綴是「bN」,候選發布版本的後綴是「rcN」,其中 N 都是某個小的" -#~ "數字。換句話說,所有標記為 2.0aN 的版本,順序都在標記為 2.0bN 的版本之前," -#~ "而 2.0bN 版本都在標記為 2.0rcN 的版本之前,而\\ *它們*\\ 都是在 2.0 版之" -#~ "前。" diff --git a/glossary.po b/glossary.po index b06b9fb396..ab16faced1 100644 --- a/glossary.po +++ b/glossary.po @@ -9,7 +9,7 @@ msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2022-10-13 00:23+0000\n" -"PO-Revision-Date: 2022-10-05 09:39+0800\n" +"PO-Revision-Date: 2022-10-16 03:48+0800\n" "Last-Translator: Steven Hsu \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -333,9 +333,9 @@ msgid "" "using a dotted expression, and would instead need to be retrieved with :func:" "`getattr`." msgstr "" -"如果一個物件允許,給予該物件一個名稱不是由\\ :ref:`identifiers`\\ 所" -"定義之識別符 (identifier) 的屬性是有可能的,例如使用 :func:`setattr`。像這樣" -"的屬性將無法使用點分隔運算式來存取,而是需要使用 :func:`getattr` 來取得它。" +"如果一個物件允許,給予該物件一個名稱不是由\\ :ref:`identifiers`\\ 所定義之識" +"別符 (identifier) 的屬性是有可能的,例如使用 :func:`setattr`。像這樣的屬性將" +"無法使用點分隔運算式來存取,而是需要使用 :func:`getattr` 來取得它。" #: ../../glossary.rst:149 msgid "awaitable" @@ -483,15 +483,18 @@ msgstr "" "位元組碼的指令列表可以在 :ref:`dis 模組 `\\ 的說明文件中找到。" #: ../../glossary.rst:212 -#, fuzzy msgid "callable" -msgstr "callback(回呼)" +msgstr "callable(可呼叫物件)" #: ../../glossary.rst:214 msgid "" "A callable is an object that can be called, possibly with a set of arguments " "(see :term:`argument`), with the following syntax::" msgstr "" +"一個 callable 是可以被呼叫的物件,呼叫時可能以下列形式帶有一組引數(請" +"見 :term:`argument`):\n" +"\n" +"::" #: ../../glossary.rst:219 msgid "" @@ -499,6 +502,8 @@ msgid "" "instance of a class that implements the :meth:`~object.__call__` method is " "also a callable." msgstr "" +"一個 :term:`function` 與其延伸的 :term:`method` 都是 callable。一個有實作 :" +"meth:`~object.__call__` 方法的 class 之實例也是個 callable。" #: ../../glossary.rst:222 msgid "callback" diff --git a/library/asyncio-future.po b/library/asyncio-future.po index 6348b4ed73..c8d016ae11 100644 --- a/library/asyncio-future.po +++ b/library/asyncio-future.po @@ -144,14 +144,13 @@ msgstr "" "一個 Future 代表一個非同步運算的最終結果。並不支援執行緒安全 (thread-safe)。" #: ../../library/asyncio-future.rst:86 -#, fuzzy msgid "" "Future is an :term:`awaitable` object. Coroutines can await on Future " "objects until they either have a result or an exception set, or until they " "are cancelled. A Future can be awaited multiple times and the result is same." msgstr "" "Future 是一個 :term:`awaitable` 物件。協程可以等待 Future 物件直到它們有結果" -"或例外被設置、或者被取消。" +"或例外被設置、或者被取消。一個 Future 可被多次等待而結果都會是相同的。" #: ../../library/asyncio-future.rst:91 msgid "" diff --git a/library/ctypes.po b/library/ctypes.po index d305b386c8..d98f00c67a 100644 --- a/library/ctypes.po +++ b/library/ctypes.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2022-10-06 00:23+0000\n" -"PO-Revision-Date: 2018-05-23 14:42+0000\n" +"PO-Revision-Date: 2022-10-16 03:20+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -17,6 +17,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.1.1\n" #: ../../library/ctypes.rst:2 msgid ":mod:`ctypes` --- A foreign function library for Python" @@ -230,9 +231,8 @@ msgid ":class:`c_bool`" msgstr ":class:`c_bool`" #: ../../library/ctypes.rst:218 -#, fuzzy msgid ":c:expr:`_Bool`" -msgstr ":c:type:`_Bool`" +msgstr ":c:expr:`_Bool`" #: ../../library/ctypes.rst:218 msgid "bool (1)" @@ -243,9 +243,8 @@ msgid ":class:`c_char`" msgstr ":class:`c_char`" #: ../../library/ctypes.rst:220 ../../library/ctypes.rst:224 -#, fuzzy msgid ":c:expr:`char`" -msgstr ":c:type:`char`" +msgstr ":c:expr:`char`" #: ../../library/ctypes.rst:220 msgid "1-character bytes object" @@ -256,9 +255,8 @@ msgid ":class:`c_wchar`" msgstr ":class:`c_wchar`" #: ../../library/ctypes.rst:222 -#, fuzzy msgid ":c:expr:`wchar_t`" -msgstr ":c:type:`wchar_t`" +msgstr ":c:expr:`wchar_t`" #: ../../library/ctypes.rst:222 msgid "1-character string" @@ -282,108 +280,96 @@ msgid ":class:`c_ubyte`" msgstr ":class:`c_ubyte`" #: ../../library/ctypes.rst:226 -#, fuzzy msgid ":c:expr:`unsigned char`" -msgstr ":c:type:`unsigned char`" +msgstr ":c:expr:`unsigned char`" #: ../../library/ctypes.rst:228 msgid ":class:`c_short`" msgstr ":class:`c_short`" #: ../../library/ctypes.rst:228 -#, fuzzy msgid ":c:expr:`short`" -msgstr ":c:type:`short`" +msgstr ":c:expr:`short`" #: ../../library/ctypes.rst:230 msgid ":class:`c_ushort`" msgstr ":class:`c_ushort`" #: ../../library/ctypes.rst:230 -#, fuzzy msgid ":c:expr:`unsigned short`" -msgstr ":c:type:`unsigned short`" +msgstr ":c:expr:`unsigned short`" #: ../../library/ctypes.rst:232 msgid ":class:`c_int`" msgstr ":class:`c_int`" #: ../../library/ctypes.rst:232 -#, fuzzy msgid ":c:expr:`int`" -msgstr ":c:type:`int`" +msgstr ":c:expr:`int`" #: ../../library/ctypes.rst:234 msgid ":class:`c_uint`" msgstr ":class:`c_uint`" #: ../../library/ctypes.rst:234 -#, fuzzy msgid ":c:expr:`unsigned int`" -msgstr ":c:type:`unsigned int`" +msgstr ":c:expr:`unsigned int`" #: ../../library/ctypes.rst:236 msgid ":class:`c_long`" msgstr ":class:`c_long`" #: ../../library/ctypes.rst:236 -#, fuzzy msgid ":c:expr:`long`" -msgstr ":c:type:`long`" +msgstr ":c:expr:`long`" #: ../../library/ctypes.rst:238 msgid ":class:`c_ulong`" msgstr ":class:`c_ulong`" #: ../../library/ctypes.rst:238 -#, fuzzy msgid ":c:expr:`unsigned long`" -msgstr ":c:type:`unsigned long`" +msgstr ":c:expr:`unsigned long`" #: ../../library/ctypes.rst:240 msgid ":class:`c_longlong`" msgstr ":class:`c_longlong`" #: ../../library/ctypes.rst:240 -#, fuzzy msgid ":c:expr:`__int64` or :c:expr:`long long`" -msgstr ":c:type:`__int64` 或 :c:type:`long long`" +msgstr ":c:expr:`__int64` 或 :c:expr:`long long`" #: ../../library/ctypes.rst:242 msgid ":class:`c_ulonglong`" msgstr ":class:`c_ulonglong`" #: ../../library/ctypes.rst:242 -#, fuzzy msgid ":c:expr:`unsigned __int64` or :c:expr:`unsigned long long`" -msgstr ":c:type:`unsigned __int64` 或 :c:type:`unsigned long long`" +msgstr ":c:expr:`unsigned __int64` 或 :c:expr:`unsigned long long`" #: ../../library/ctypes.rst:245 msgid ":class:`c_size_t`" msgstr ":class:`c_size_t`" #: ../../library/ctypes.rst:245 -#, fuzzy msgid ":c:expr:`size_t`" -msgstr ":c:type:`size_t`" +msgstr ":c:expr:`size_t`" #: ../../library/ctypes.rst:247 msgid ":class:`c_ssize_t`" msgstr ":class:`c_ssize_t`" #: ../../library/ctypes.rst:247 -#, fuzzy msgid ":c:expr:`ssize_t` or :c:expr:`Py_ssize_t`" -msgstr ":c:type:`ssize_t` 或 :c:type:`Py_ssize_t`" +msgstr ":c:expr:`ssize_t` 或 :c:expr:`Py_ssize_t`" #: ../../library/ctypes.rst:250 msgid ":class:`c_float`" msgstr ":class:`c_float`" #: ../../library/ctypes.rst:250 -#, fuzzy msgid ":c:expr:`float`" -msgstr ":c:type:`float`" +msgstr ":c:expr:`float`" #: ../../library/ctypes.rst:250 ../../library/ctypes.rst:252 #: ../../library/ctypes.rst:254 @@ -395,18 +381,16 @@ msgid ":class:`c_double`" msgstr ":class:`c_double`" #: ../../library/ctypes.rst:252 -#, fuzzy msgid ":c:expr:`double`" -msgstr ":c:type:`double`" +msgstr ":c:expr:`double`" #: ../../library/ctypes.rst:254 msgid ":class:`c_longdouble`" msgstr ":class:`c_longdouble`" #: ../../library/ctypes.rst:254 -#, fuzzy msgid ":c:expr:`long double`" -msgstr ":c:type:`long double`" +msgstr ":c:expr:`long double`" #: ../../library/ctypes.rst:256 msgid ":class:`c_char_p`" @@ -437,9 +421,8 @@ msgid ":class:`c_void_p`" msgstr ":class:`c_void_p`" #: ../../library/ctypes.rst:260 -#, fuzzy msgid ":c:expr:`void *`" -msgstr ":c:type:`void *`" +msgstr ":c:expr:`void *`" #: ../../library/ctypes.rst:260 msgid "int or ``None``" diff --git a/library/struct.po b/library/struct.po index 9000db2e80..d98b498b0c 100644 --- a/library/struct.po +++ b/library/struct.po @@ -332,9 +332,8 @@ msgid "``c``" msgstr "``c``" #: ../../library/struct.rst:199 -#, fuzzy msgid ":c:expr:`char`" -msgstr ":c:type:`char`" +msgstr ":c:expr:`char`" #: ../../library/struct.rst:199 msgid "bytes of length 1" @@ -350,9 +349,8 @@ msgid "``b``" msgstr "``b``" #: ../../library/struct.rst:201 -#, fuzzy msgid ":c:expr:`signed char`" -msgstr ":c:type:`signed char`" +msgstr ":c:expr:`signed char`" #: ../../library/struct.rst:201 ../../library/struct.rst:203 #: ../../library/struct.rst:207 ../../library/struct.rst:209 @@ -373,9 +371,8 @@ msgid "``B``" msgstr "``B``" #: ../../library/struct.rst:203 -#, fuzzy msgid ":c:expr:`unsigned char`" -msgstr ":c:type:`unsigned char`" +msgstr ":c:expr:`unsigned char`" #: ../../library/struct.rst:203 ../../library/struct.rst:207 #: ../../library/struct.rst:209 ../../library/struct.rst:211 @@ -390,9 +387,8 @@ msgid "``?``" msgstr "``?``" #: ../../library/struct.rst:205 -#, fuzzy msgid ":c:expr:`_Bool`" -msgstr ":c:type:`_Bool`" +msgstr ":c:expr:`_Bool`" #: ../../library/struct.rst:205 msgid "bool" @@ -407,9 +403,8 @@ msgid "``h``" msgstr "``h``" #: ../../library/struct.rst:207 -#, fuzzy msgid ":c:expr:`short`" -msgstr ":c:type:`short`" +msgstr ":c:expr:`short`" #: ../../library/struct.rst:207 ../../library/struct.rst:209 #: ../../library/struct.rst:228 @@ -421,18 +416,16 @@ msgid "``H``" msgstr "``H``" #: ../../library/struct.rst:209 -#, fuzzy msgid ":c:expr:`unsigned short`" -msgstr ":c:type:`unsigned short`" +msgstr ":c:expr:`unsigned short`" #: ../../library/struct.rst:211 msgid "``i``" msgstr "``i``" #: ../../library/struct.rst:211 -#, fuzzy msgid ":c:expr:`int`" -msgstr ":c:type:`int`" +msgstr ":c:expr:`int`" #: ../../library/struct.rst:211 ../../library/struct.rst:213 #: ../../library/struct.rst:215 ../../library/struct.rst:217 @@ -445,36 +438,32 @@ msgid "``I``" msgstr "``I``" #: ../../library/struct.rst:213 -#, fuzzy msgid ":c:expr:`unsigned int`" -msgstr ":c:type:`unsigned int`" +msgstr ":c:expr:`unsigned int`" #: ../../library/struct.rst:215 msgid "``l``" msgstr "``l``" #: ../../library/struct.rst:215 -#, fuzzy msgid ":c:expr:`long`" -msgstr ":c:type:`long`" +msgstr ":c:expr:`long`" #: ../../library/struct.rst:217 msgid "``L``" msgstr "``L``" #: ../../library/struct.rst:217 -#, fuzzy msgid ":c:expr:`unsigned long`" -msgstr ":c:type:`unsigned long`" +msgstr ":c:expr:`unsigned long`" #: ../../library/struct.rst:219 msgid "``q``" msgstr "``q``" #: ../../library/struct.rst:219 -#, fuzzy msgid ":c:expr:`long long`" -msgstr ":c:type:`long long`" +msgstr ":c:expr:`long long`" #: ../../library/struct.rst:219 ../../library/struct.rst:221 #: ../../library/struct.rst:232 @@ -486,18 +475,16 @@ msgid "``Q``" msgstr "``Q``" #: ../../library/struct.rst:221 -#, fuzzy msgid ":c:expr:`unsigned long long`" -msgstr ":c:type:`unsigned long long`" +msgstr ":c:expr:`unsigned long long`" #: ../../library/struct.rst:224 msgid "``n``" msgstr "``n``" #: ../../library/struct.rst:224 -#, fuzzy msgid ":c:expr:`ssize_t`" -msgstr ":c:type:`ssize_t`" +msgstr ":c:expr:`ssize_t`" #: ../../library/struct.rst:224 ../../library/struct.rst:226 msgid "\\(3)" @@ -508,9 +495,8 @@ msgid "``N``" msgstr "``N``" #: ../../library/struct.rst:226 -#, fuzzy msgid ":c:expr:`size_t`" -msgstr ":c:type:`size_t`" +msgstr ":c:expr:`size_t`" #: ../../library/struct.rst:228 msgid "``e``" @@ -535,27 +521,24 @@ msgid "``f``" msgstr "``f``" #: ../../library/struct.rst:230 -#, fuzzy msgid ":c:expr:`float`" -msgstr ":c:type:`float`" +msgstr ":c:expr:`float`" #: ../../library/struct.rst:232 msgid "``d``" msgstr "``d``" #: ../../library/struct.rst:232 -#, fuzzy msgid ":c:expr:`double`" -msgstr ":c:type:`double`" +msgstr ":c:expr:`double`" #: ../../library/struct.rst:234 msgid "``s``" msgstr "``s``" #: ../../library/struct.rst:234 ../../library/struct.rst:236 -#, fuzzy msgid ":c:expr:`char[]`" -msgstr ":c:type:`char[]`" +msgstr ":c:expr:`char[]`" #: ../../library/struct.rst:234 ../../library/struct.rst:236 msgid "bytes" @@ -570,9 +553,8 @@ msgid "``P``" msgstr "``P``" #: ../../library/struct.rst:238 -#, fuzzy msgid ":c:expr:`void \\*`" -msgstr ":c:type:`void \\*`" +msgstr ":c:expr:`void \\*`" #: ../../library/struct.rst:238 msgid "\\(5)" diff --git a/tutorial/interpreter.po b/tutorial/interpreter.po index 04a137c88c..23d2bb634c 100644 --- a/tutorial/interpreter.po +++ b/tutorial/interpreter.po @@ -104,7 +104,6 @@ msgstr "" "它會將這個檔案視為\\ **腳本**\\ 來閱讀。" #: ../../tutorial/interpreter.rst:51 -#, fuzzy msgid "" "A second way of starting the interpreter is ``python -c command [arg] ...``, " "which executes the statement(s) in *command*, analogous to the shell's :" @@ -114,7 +113,7 @@ msgid "" msgstr "" "另一個啟動直譯器的方式為 ``python -c command [arg] ...``\\ ,它會執行在 " "*command* 裡的指令(們),行為如同 shell 的 :option:`-c` 選項。因為 Python 的" -"指令包含空白等 shell 用到的特殊字元,通常建議用單引號把 *command* 包起來。" +"指令包含空白等 shell 用到的特殊字元,通常建議用引號把 *command* 包起來。" #: ../../tutorial/interpreter.rst:57 msgid "" diff --git a/tutorial/introduction.po b/tutorial/introduction.po index d63c1004fa..240888492a 100644 --- a/tutorial/introduction.po +++ b/tutorial/introduction.po @@ -11,7 +11,7 @@ msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2022-10-11 00:23+0000\n" -"PO-Revision-Date: 2022-06-07 16:52+0800\n" +"PO-Revision-Date: 2022-10-16 03:20+0800\n" "Last-Translator: Steven Hsu \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -20,7 +20,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" #: ../../tutorial/introduction.rst:5 msgid "An Informal Introduction to Python" @@ -115,15 +115,13 @@ msgstr "" "字相關的型態。" #: ../../tutorial/introduction.rst:72 -#, fuzzy msgid "" "Division (``/``) always returns a float. To do :term:`floor division` and " "get an integer result you can use the ``//`` operator; to calculate the " "remainder you can use ``%``::" msgstr "" "除法 (``/``) 永遠回傳一個 float。如果要做 :term:`floor division` 並拿到整數的" -"結果(即去除所有小數點的部份),你可以使用 ``//`` 運算子;計算餘數可以使用 ``" -"%``:\n" +"結果,你可以使用 ``//`` 運算子;計算餘數可以使用 ``%``:\n" "\n" "::"