diff --git a/c-api/call.po b/c-api/call.po index a6d8d70fe7..746c63dd32 100644 --- a/c-api/call.po +++ b/c-api/call.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-13 00:11+0000\n" +"POT-Creation-Date: 2021-10-07 00:10+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -254,7 +254,7 @@ msgstr "" msgid "" "Various functions are available for calling a Python object. Each converts " "its arguments to a convention supported by the called object – either " -"*tp_call* or vectorcall. In order to do as litle conversion as possible, " +"*tp_call* or vectorcall. In order to do as little conversion as possible, " "pick one that best fits the format of data you have available." msgstr "" diff --git a/c-api/init.po b/c-api/init.po index 7516e192ba..390563a8fc 100644 --- a/c-api/init.po +++ b/c-api/init.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-13 00:11+0000\n" +"POT-Creation-Date: 2021-09-24 00:11+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-" @@ -618,7 +618,7 @@ msgid "" "name (set by :c:func:`Py_SetProgramName` above) and some environment " "variables. The returned string consists of a series of directory names " "separated by a platform dependent delimiter character. The delimiter " -"character is ``':'`` on Unix and Mac OS X, ``';'`` on Windows. The returned " +"character is ``':'`` on Unix and macOS, ``';'`` on Windows. The returned " "string points into static storage; the caller should not modify its value. " "The list :data:`sys.path` is initialized with this value on interpreter " "startup; it can be (and usually is) modified later to change the search path " @@ -632,8 +632,8 @@ msgid "" "default search path but uses the one provided instead. This is useful if " "Python is embedded by an application that has full knowledge of the location " "of all modules. The path components should be separated by the platform " -"dependent delimiter character, which is ``':'`` on Unix and Mac OS X, " -"``';'`` on Windows." +"dependent delimiter character, which is ``':'`` on Unix and macOS, ``';'`` " +"on Windows." msgstr "" #: ../../c-api/init.rst:475 @@ -676,10 +676,10 @@ msgid "" "Return the platform identifier for the current platform. On Unix, this is " "formed from the \"official\" name of the operating system, converted to " "lower case, followed by the major revision number; e.g., for Solaris 2.x, " -"which is also known as SunOS 5.x, the value is ``'sunos5'``. On Mac OS X, " -"it is ``'darwin'``. On Windows, it is ``'win'``. The returned string " -"points into static storage; the caller should not modify its value. The " -"value is available to Python code as ``sys.platform``." +"which is also known as SunOS 5.x, the value is ``'sunos5'``. On macOS, it " +"is ``'darwin'``. On Windows, it is ``'win'``. The returned string points " +"into static storage; the caller should not modify its value. The value is " +"available to Python code as ``sys.platform``." msgstr "" #: ../../c-api/init.rst:521 diff --git a/c-api/type.po b/c-api/type.po index bd5d1418b2..676d3def6b 100644 --- a/c-api/type.po +++ b/c-api/type.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-13 00:11+0000\n" +"POT-Creation-Date: 2021-09-19 00:12+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-" @@ -209,7 +209,7 @@ msgstr "" msgid "" "The *module* argument can be used to record the module in which the new " "class is defined. It must be a module object or ``NULL``. If not ``NULL``, " -"the module is associated with the new type and can later be retreived with :" +"the module is associated with the new type and can later be retrieved with :" "c:func:`PyType_GetModule`. The associated module is not inherited by " "subclasses; it must be specified for each class individually." msgstr "" diff --git a/c-api/typeobj.po b/c-api/typeobj.po index 12a8e2681a..88757bfeee 100644 --- a/c-api/typeobj.po +++ b/c-api/typeobj.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-13 00:11+0000\n" +"POT-Creation-Date: 2021-09-18 00:10+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-" @@ -694,7 +694,7 @@ msgid ":c:member:`~PyNumberMethods.nb_inplace_subtract`" msgstr "" #: ../../c-api/typeobj.rst:212 -msgid "__sub__" +msgid "__isub__" msgstr "" #: ../../c-api/typeobj.rst:214 @@ -709,8 +709,8 @@ msgstr "" msgid ":c:member:`~PyNumberMethods.nb_inplace_multiply`" msgstr "" -#: ../../c-api/typeobj.rst:217 ../../c-api/typeobj.rst:303 -msgid "__mul__" +#: ../../c-api/typeobj.rst:217 ../../c-api/typeobj.rst:314 +msgid "__imul__" msgstr "" #: ../../c-api/typeobj.rst:219 @@ -726,7 +726,7 @@ msgid ":c:member:`~PyNumberMethods.nb_inplace_remainder`" msgstr "" #: ../../c-api/typeobj.rst:222 -msgid "__mod__" +msgid "__imod__" msgstr "" #: ../../c-api/typeobj.rst:224 @@ -750,7 +750,7 @@ msgid ":c:member:`~PyNumberMethods.nb_inplace_power`" msgstr "" #: ../../c-api/typeobj.rst:230 -msgid "__pow__" +msgid "__ipow__" msgstr "" #: ../../c-api/typeobj.rst:232 @@ -806,7 +806,7 @@ msgid ":c:member:`~PyNumberMethods.nb_inplace_lshift`" msgstr "" #: ../../c-api/typeobj.rst:245 -msgid "__lshift__" +msgid "__ilshift__" msgstr "" #: ../../c-api/typeobj.rst:247 @@ -822,7 +822,7 @@ msgid ":c:member:`~PyNumberMethods.nb_inplace_rshift`" msgstr "" #: ../../c-api/typeobj.rst:250 -msgid "__rshift__" +msgid "__irshift__" msgstr "" #: ../../c-api/typeobj.rst:252 @@ -838,7 +838,7 @@ msgid ":c:member:`~PyNumberMethods.nb_inplace_and`" msgstr "" #: ../../c-api/typeobj.rst:255 -msgid "__and__" +msgid "__iand__" msgstr "" #: ../../c-api/typeobj.rst:257 @@ -854,7 +854,7 @@ msgid ":c:member:`~PyNumberMethods.nb_inplace_xor`" msgstr "" #: ../../c-api/typeobj.rst:260 -msgid "__xor__" +msgid "__ixor__" msgstr "" #: ../../c-api/typeobj.rst:262 @@ -870,7 +870,7 @@ msgid ":c:member:`~PyNumberMethods.nb_inplace_or`" msgstr "" #: ../../c-api/typeobj.rst:265 -msgid "__or__" +msgid "__ior__" msgstr "" #: ../../c-api/typeobj.rst:267 @@ -903,7 +903,7 @@ msgstr "" msgid ":c:member:`~PyNumberMethods.nb_floor_divide`" msgstr "" -#: ../../c-api/typeobj.rst:273 ../../c-api/typeobj.rst:275 +#: ../../c-api/typeobj.rst:273 msgid "__floordiv__" msgstr "" @@ -911,11 +911,15 @@ msgstr "" msgid ":c:member:`~PyNumberMethods.nb_inplace_floor_divide`" msgstr "" +#: ../../c-api/typeobj.rst:275 +msgid "__ifloordiv__" +msgstr "" + #: ../../c-api/typeobj.rst:277 msgid ":c:member:`~PyNumberMethods.nb_true_divide`" msgstr "" -#: ../../c-api/typeobj.rst:277 ../../c-api/typeobj.rst:279 +#: ../../c-api/typeobj.rst:277 msgid "__truediv__" msgstr "" @@ -923,6 +927,10 @@ msgstr "" msgid ":c:member:`~PyNumberMethods.nb_inplace_true_divide`" msgstr "" +#: ../../c-api/typeobj.rst:279 +msgid "__itruediv__" +msgstr "" + #: ../../c-api/typeobj.rst:281 msgid ":c:member:`~PyNumberMethods.nb_index`" msgstr "" @@ -944,7 +952,7 @@ msgid ":c:member:`~PyNumberMethods.nb_inplace_matrix_multiply`" msgstr "" #: ../../c-api/typeobj.rst:286 -msgid "__matmul__" +msgid "__imatmul__" msgstr "" #: ../../c-api/typeobj.rst:290 @@ -1001,6 +1009,10 @@ msgstr "" msgid ":c:type:`ssizeargfunc`" msgstr "" +#: ../../c-api/typeobj.rst:303 +msgid "__mul__" +msgstr "" + #: ../../c-api/typeobj.rst:305 msgid ":c:member:`~PySequenceMethods.sq_item`" msgstr "" @@ -1037,10 +1049,6 @@ msgstr "" msgid ":c:member:`~PySequenceMethods.sq_inplace_repeat`" msgstr "" -#: ../../c-api/typeobj.rst:314 -msgid "__imul__" -msgstr "" - #: ../../c-api/typeobj.rst:318 msgid ":c:member:`~PyBufferProcs.bf_getbuffer`" msgstr "" diff --git a/distributing/index.po b/distributing/index.po index d433b531fd..86080d0ace 100644 --- a/distributing/index.po +++ b/distributing/index.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-20 18:08+0800\n" +"POT-Creation-Date: 2021-10-02 17:19+0000\n" "PO-Revision-Date: 2021-07-04 18:06+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -208,8 +208,8 @@ msgstr "" #: ../../distributing/index.rst:104 msgid "" -"For POSIX users (including Mac OS X and Linux users), these instructions " -"assume the use of a :term:`virtual environment`." +"For POSIX users (including macOS and Linux users), these instructions assume " +"the use of a :term:`virtual environment`." msgstr "" "對於 POSIX 使用者(包括 Mac OS X 和 Linux 使用者),這些教學皆假設有使用 :" "term:`virtual environment`\\ 。" diff --git a/distutils/apiref.po b/distutils/apiref.po index 25ecd1f78d..a29ad2521f 100644 --- a/distutils/apiref.po +++ b/distutils/apiref.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-20 18:08+0800\n" +"POT-Creation-Date: 2021-09-24 00:11+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-" @@ -1546,14 +1546,14 @@ msgstr "" #: ../../distutils/apiref.rst:1122 msgid "" -"For Mac OS X systems the OS version reflects the minimal version on which " +"For macOS systems the OS version reflects the minimal version on which " "binaries will run (that is, the value of ``MACOSX_DEPLOYMENT_TARGET`` during " "the build of Python), not the OS version of the current system." msgstr "" #: ../../distutils/apiref.rst:1126 msgid "" -"For universal binary builds on Mac OS X the architecture value reflects the " +"For universal binary builds on macOS the architecture value reflects the " "universal binary status instead of the architecture of the current " "processor. For 32-bit universal binaries the architecture is ``fat``, for 64-" "bit universal binaries the architecture is ``fat64``, and for 4-way " @@ -1564,7 +1564,7 @@ msgid "" msgstr "" #: ../../distutils/apiref.rst:1135 -msgid "Examples of returned values on Mac OS X:" +msgid "Examples of returned values on macOS:" msgstr "" #: ../../distutils/apiref.rst:1137 diff --git a/faq/design.po b/faq/design.po index cfc98f6a66..094f325e15 100644 --- a/faq/design.po +++ b/faq/design.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-13 00:11+0000\n" +"POT-Creation-Date: 2021-10-07 00:10+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-" @@ -922,7 +922,7 @@ msgid "" "For technical reasons, a generator used directly as a context manager would " "not work correctly. When, as is most common, a generator is used as an " "iterator run to completion, no closing is needed. When it is, wrap it as " -"\"contextlib.closing(generator)\" in the 'with' statment." +"\"contextlib.closing(generator)\" in the 'with' statement." msgstr "" #: ../../faq/design.rst:722 diff --git a/faq/gui.po b/faq/gui.po index 161587f7de..a508ef849b 100644 --- a/faq/gui.po +++ b/faq/gui.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-13 00:11+0000\n" +"POT-Creation-Date: 2021-09-24 00:11+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-" @@ -42,8 +42,7 @@ msgid "" "to install (since it comes included with most `binary distributions `_ of Python) and use. For more info about Tk, " "including pointers to the source, see the `Tcl/Tk home page `_. Tcl/Tk is fully portable to the Mac OS X, Windows, and Unix " -"platforms." +"tk>`_. Tcl/Tk is fully portable to the macOS, Windows, and Unix platforms." msgstr "" #: ../../faq/gui.rst:28 diff --git a/faq/installed.po b/faq/installed.po index 43f958c0ba..f88cde1d1c 100644 --- a/faq/installed.po +++ b/faq/installed.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-06-26 18:54+0800\n" +"POT-Creation-Date: 2021-09-24 00:11+0000\n" "PO-Revision-Date: 2017-09-22 18:26+0000\n" "Last-Translator: Ching-Lung Chuang\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -89,11 +89,11 @@ msgstr "" #: ../../faq/installed.rst:32 msgid "" -"Many Unix-compatible operating systems, such as Mac OS X and some Linux " +"Many Unix-compatible operating systems, such as macOS and some Linux " "distributions, have Python installed by default; it's included in the base " "installation." msgstr "" -"許多相容於Unix 系統,例如:Mac OS X 和 一些 Linux 發行版本預設安裝Python ;安" +"許多相容於 Unix 系統,例如:maxOS 和 一些 Linux 發行版本預設安裝 Python;安" "裝時被包含在基本安裝功能內。" #: ../../faq/installed.rst:38 diff --git a/faq/programming.po b/faq/programming.po index ccf4efe418..6a63b9dba6 100644 --- a/faq/programming.po +++ b/faq/programming.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-13 00:11+0000\n" +"POT-Creation-Date: 2021-10-07 00:10+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-" @@ -1349,8 +1349,8 @@ msgstr "" msgid "" "The ``array`` module also provides methods for creating arrays of fixed " "types with compact representations, but they are slower to index than " -"lists. Also note that the Numeric extensions and others define array-like " -"structures with various characteristics as well." +"lists. Also note that NumPy and other third party packages define array-" +"like structures with various characteristics as well." msgstr "" #: ../../faq/programming.rst:1190 diff --git a/howto/functional.po b/howto/functional.po index 288cc4c921..fd4da05d94 100644 --- a/howto/functional.po +++ b/howto/functional.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-20 18:08+0800\n" +"POT-Creation-Date: 2021-10-07 00:10+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-" @@ -127,14 +127,14 @@ msgstr "" msgid "" "Some languages are very strict about purity and don't even have assignment " "statements such as ``a=3`` or ``c = a + b``, but it's difficult to avoid all " -"side effects. Printing to the screen or writing to a disk file are side " -"effects, for example. For example, in Python a call to the :func:`print` " -"or :func:`time.sleep` function both return no useful value; they're only " -"called for their side effects of sending some text to the screen or pausing " -"execution for a second." +"side effects, such as printing to the screen or writing to a disk file. " +"Another example is a call to the :func:`print` or :func:`time.sleep` " +"function, neither of which returns a useful value. Both are called only for " +"their side effects of sending some text to the screen or pausing execution " +"for a second." msgstr "" -#: ../../howto/functional.rst:74 +#: ../../howto/functional.rst:73 msgid "" "Python programs written in functional style usually won't go to the extreme " "of avoiding all I/O or all assignments; instead, they'll provide a " @@ -144,7 +144,7 @@ msgid "" "other side effects." msgstr "" -#: ../../howto/functional.rst:80 +#: ../../howto/functional.rst:79 msgid "" "Functional programming can be considered the opposite of object-oriented " "programming. Objects are little capsules containing some internal state " @@ -156,40 +156,40 @@ msgid "" "objects in your application (e-mail messages, transactions, etc.)." msgstr "" -#: ../../howto/functional.rst:89 +#: ../../howto/functional.rst:88 msgid "" "Functional design may seem like an odd constraint to work under. Why should " "you avoid objects and side effects? There are theoretical and practical " "advantages to the functional style:" msgstr "" -#: ../../howto/functional.rst:93 +#: ../../howto/functional.rst:92 msgid "Formal provability." msgstr "" -#: ../../howto/functional.rst:94 +#: ../../howto/functional.rst:93 msgid "Modularity." msgstr "" -#: ../../howto/functional.rst:95 +#: ../../howto/functional.rst:94 msgid "Composability." msgstr "" -#: ../../howto/functional.rst:96 +#: ../../howto/functional.rst:95 msgid "Ease of debugging and testing." msgstr "" -#: ../../howto/functional.rst:100 +#: ../../howto/functional.rst:99 msgid "Formal provability" msgstr "" -#: ../../howto/functional.rst:102 +#: ../../howto/functional.rst:101 msgid "" "A theoretical benefit is that it's easier to construct a mathematical proof " "that a functional program is correct." msgstr "" -#: ../../howto/functional.rst:105 +#: ../../howto/functional.rst:104 msgid "" "For a long time researchers have been interested in finding ways to " "mathematically prove programs correct. This is different from testing a " @@ -199,7 +199,7 @@ msgid "" "the right result for all possible inputs." msgstr "" -#: ../../howto/functional.rst:112 +#: ../../howto/functional.rst:111 msgid "" "The technique used to prove programs correct is to write down " "**invariants**, properties of the input data and of the program's variables " @@ -210,7 +210,7 @@ msgid "" "invariants should match the desired conditions on the program's output." msgstr "" -#: ../../howto/functional.rst:120 +#: ../../howto/functional.rst:119 msgid "" "Functional programming's avoidance of assignments arose because assignments " "are difficult to handle with this technique; assignments can break " @@ -218,7 +218,7 @@ msgid "" "invariants that can be propagated onward." msgstr "" -#: ../../howto/functional.rst:125 +#: ../../howto/functional.rst:124 msgid "" "Unfortunately, proving programs correct is largely impractical and not " "relevant to Python software. Even trivial programs require proofs that are " @@ -230,11 +230,11 @@ msgid "" "wrongly believe you've proved the program correct." msgstr "" -#: ../../howto/functional.rst:136 +#: ../../howto/functional.rst:135 msgid "Modularity" msgstr "" -#: ../../howto/functional.rst:138 +#: ../../howto/functional.rst:137 msgid "" "A more practical benefit of functional programming is that it forces you to " "break apart your problem into small pieces. Programs are more modular as a " @@ -243,15 +243,15 @@ msgid "" "Small functions are also easier to read and to check for errors." msgstr "" -#: ../../howto/functional.rst:146 +#: ../../howto/functional.rst:145 msgid "Ease of debugging and testing" msgstr "" -#: ../../howto/functional.rst:148 +#: ../../howto/functional.rst:147 msgid "Testing and debugging a functional-style program is easier." msgstr "" -#: ../../howto/functional.rst:150 +#: ../../howto/functional.rst:149 msgid "" "Debugging is simplified because functions are generally small and clearly " "specified. When a program doesn't work, each function is an interface point " @@ -260,7 +260,7 @@ msgid "" "responsible for a bug." msgstr "" -#: ../../howto/functional.rst:155 +#: ../../howto/functional.rst:154 msgid "" "Testing is easier because each function is a potential subject for a unit " "test. Functions don't depend on system state that needs to be replicated " @@ -268,11 +268,11 @@ msgid "" "and then check that the output matches expectations." msgstr "" -#: ../../howto/functional.rst:162 +#: ../../howto/functional.rst:161 msgid "Composability" msgstr "" -#: ../../howto/functional.rst:164 +#: ../../howto/functional.rst:163 msgid "" "As you work on a functional-style program, you'll write a number of " "functions with varying inputs and outputs. Some of these functions will be " @@ -283,24 +283,24 @@ msgid "" "different situations." msgstr "" -#: ../../howto/functional.rst:171 +#: ../../howto/functional.rst:170 msgid "" "Over time you'll form a personal library of utilities. Often you'll " "assemble new programs by arranging existing functions in a new configuration " "and writing a few functions specialized for the current task." msgstr "" -#: ../../howto/functional.rst:179 +#: ../../howto/functional.rst:178 msgid "Iterators" msgstr "" -#: ../../howto/functional.rst:181 +#: ../../howto/functional.rst:180 msgid "" "I'll start by looking at a Python language feature that's an important " "foundation for writing functional-style programs: iterators." msgstr "" -#: ../../howto/functional.rst:184 +#: ../../howto/functional.rst:183 msgid "" "An iterator is an object representing a stream of data; this object returns " "the data one element at a time. A Python iterator must support a method " @@ -311,7 +311,7 @@ msgid "" "reasonable to write an iterator that produces an infinite stream of data." msgstr "" -#: ../../howto/functional.rst:192 +#: ../../howto/functional.rst:191 msgid "" "The built-in :func:`iter` function takes an arbitrary object and tries to " "return an iterator that will return the object's contents or elements, " @@ -321,11 +321,11 @@ msgid "" "an iterator for it." msgstr "" -#: ../../howto/functional.rst:199 +#: ../../howto/functional.rst:198 msgid "You can experiment with the iteration interface manually:" msgstr "" -#: ../../howto/functional.rst:217 +#: ../../howto/functional.rst:216 msgid "" "Python expects iterable objects in several different contexts, the most " "important being the :keyword:`for` statement. In the statement ``for X in " @@ -333,19 +333,19 @@ msgid "" "an iterator. These two statements are equivalent::" msgstr "" -#: ../../howto/functional.rst:229 +#: ../../howto/functional.rst:228 msgid "" "Iterators can be materialized as lists or tuples by using the :func:`list` " "or :func:`tuple` constructor functions:" msgstr "" -#: ../../howto/functional.rst:238 +#: ../../howto/functional.rst:237 msgid "" "Sequence unpacking also supports iterators: if you know an iterator will " "return N elements, you can unpack them into an N-tuple:" msgstr "" -#: ../../howto/functional.rst:247 +#: ../../howto/functional.rst:246 msgid "" "Built-in functions such as :func:`max` and :func:`min` can take a single " "iterator argument and will return the largest or smallest element. The ``" @@ -356,7 +356,7 @@ msgid "" "stream, the ``\"in\"`` and ``\"not in\"`` operators won't return either." msgstr "" -#: ../../howto/functional.rst:255 +#: ../../howto/functional.rst:254 msgid "" "Note that you can only go forward in an iterator; there's no way to get the " "previous element, reset the iterator, or make a copy of it. Iterator " @@ -367,31 +367,31 @@ msgid "" "new iterator." msgstr "" -#: ../../howto/functional.rst:265 +#: ../../howto/functional.rst:264 msgid "Data Types That Support Iterators" msgstr "" -#: ../../howto/functional.rst:267 +#: ../../howto/functional.rst:266 msgid "" "We've already seen how lists and tuples support iterators. In fact, any " "Python sequence type, such as strings, will automatically support creation " "of an iterator." msgstr "" -#: ../../howto/functional.rst:271 +#: ../../howto/functional.rst:270 msgid "" "Calling :func:`iter` on a dictionary returns an iterator that will loop over " "the dictionary's keys::" msgstr "" -#: ../../howto/functional.rst:291 +#: ../../howto/functional.rst:290 msgid "" "Note that starting with Python 3.7, dictionary iteration order is guaranteed " "to be the same as the insertion order. In earlier versions, the behaviour " "was unspecified and could vary between implementations." msgstr "" -#: ../../howto/functional.rst:295 +#: ../../howto/functional.rst:294 msgid "" "Applying :func:`iter` to a dictionary always loops over the keys, but " "dictionaries have methods that return other iterators. If you want to " @@ -399,30 +399,30 @@ msgid "" "`~dict.values` or :meth:`~dict.items` methods to get an appropriate iterator." msgstr "" -#: ../../howto/functional.rst:301 +#: ../../howto/functional.rst:300 msgid "" "The :func:`dict` constructor can accept an iterator that returns a finite " "stream of ``(key, value)`` tuples:" msgstr "" -#: ../../howto/functional.rst:308 +#: ../../howto/functional.rst:307 msgid "" "Files also support iteration by calling the :meth:`~io.TextIOBase.readline` " "method until there are no more lines in the file. This means you can read " "each line of a file like this::" msgstr "" -#: ../../howto/functional.rst:316 +#: ../../howto/functional.rst:315 msgid "" "Sets can take their contents from an iterable and let you iterate over the " "set's elements::" msgstr "" -#: ../../howto/functional.rst:326 +#: ../../howto/functional.rst:325 msgid "Generator expressions and list comprehensions" msgstr "" -#: ../../howto/functional.rst:328 +#: ../../howto/functional.rst:327 msgid "" "Two common operations on an iterator's output are 1) performing some " "operation for every element, 2) selecting a subset of elements that meet " @@ -431,7 +431,7 @@ msgid "" "containing a given substring." msgstr "" -#: ../../howto/functional.rst:334 +#: ../../howto/functional.rst:333 msgid "" "List comprehensions and generator expressions (short form: \"listcomps\" and " "\"genexps\") are a concise notation for such operations, borrowed from the " @@ -439,12 +439,12 @@ msgid "" "strip all the whitespace from a stream of strings with the following code::" msgstr "" -#: ../../howto/functional.rst:347 +#: ../../howto/functional.rst:346 msgid "" "You can select only certain elements by adding an ``\"if\"`` condition::" msgstr "" -#: ../../howto/functional.rst:352 +#: ../../howto/functional.rst:351 msgid "" "With a list comprehension, you get back a Python list; ``stripped_list`` is " "a list containing the resulting lines, not an iterator. Generator " @@ -455,20 +455,20 @@ msgid "" "preferable in these situations." msgstr "" -#: ../../howto/functional.rst:359 +#: ../../howto/functional.rst:358 msgid "" "Generator expressions are surrounded by parentheses (\"()\") and list " "comprehensions are surrounded by square brackets (\"[]\"). Generator " "expressions have the form::" msgstr "" -#: ../../howto/functional.rst:372 +#: ../../howto/functional.rst:371 msgid "" "Again, for a list comprehension only the outside brackets are different " "(square brackets instead of parentheses)." msgstr "" -#: ../../howto/functional.rst:375 +#: ../../howto/functional.rst:374 msgid "" "The elements of the generated output will be the successive values of " "``expression``. The ``if`` clauses are all optional; if present, " @@ -476,14 +476,14 @@ msgid "" "is true." msgstr "" -#: ../../howto/functional.rst:379 +#: ../../howto/functional.rst:378 msgid "" "Generator expressions always have to be written inside parentheses, but the " "parentheses signalling a function call also count. If you want to create an " "iterator that will be immediately passed to a function you can write::" msgstr "" -#: ../../howto/functional.rst:385 +#: ../../howto/functional.rst:384 msgid "" "The ``for...in`` clauses contain the sequences to be iterated over. The " "sequences do not have to be the same length, because they are iterated over " @@ -493,13 +493,13 @@ msgid "" "``sequence2``." msgstr "" -#: ../../howto/functional.rst:391 +#: ../../howto/functional.rst:390 msgid "" "To put it another way, a list comprehension or generator expression is " "equivalent to the following Python code::" msgstr "" -#: ../../howto/functional.rst:408 +#: ../../howto/functional.rst:407 msgid "" "This means that when there are multiple ``for...in`` clauses but no ``if`` " "clauses, the length of the resulting output will be equal to the product of " @@ -507,25 +507,25 @@ msgid "" "output list is 9 elements long:" msgstr "" -#: ../../howto/functional.rst:420 +#: ../../howto/functional.rst:419 msgid "" "To avoid introducing an ambiguity into Python's grammar, if ``expression`` " "is creating a tuple, it must be surrounded with parentheses. The first list " "comprehension below is a syntax error, while the second one is correct::" msgstr "" -#: ../../howto/functional.rst:431 +#: ../../howto/functional.rst:430 msgid "Generators" msgstr "" -#: ../../howto/functional.rst:433 +#: ../../howto/functional.rst:432 msgid "" "Generators are a special class of functions that simplify the task of " "writing iterators. Regular functions compute a value and return it, but " "generators return an iterator that returns a stream of values." msgstr "" -#: ../../howto/functional.rst:437 +#: ../../howto/functional.rst:436 msgid "" "You're doubtless familiar with how regular function calls work in Python or " "C. When you call a function, it gets a private namespace where its local " @@ -538,18 +538,18 @@ msgid "" "thought of as resumable functions." msgstr "" -#: ../../howto/functional.rst:446 +#: ../../howto/functional.rst:445 msgid "Here's the simplest example of a generator function:" msgstr "" -#: ../../howto/functional.rst:452 +#: ../../howto/functional.rst:451 msgid "" "Any function containing a :keyword:`yield` keyword is a generator function; " "this is detected by Python's :term:`bytecode` compiler which compiles the " "function specially as a result." msgstr "" -#: ../../howto/functional.rst:456 +#: ../../howto/functional.rst:455 msgid "" "When you call a generator function, it doesn't return a single value; " "instead it returns a generator object that supports the iterator protocol. " @@ -561,17 +561,17 @@ msgid "" "method, the function will resume executing." msgstr "" -#: ../../howto/functional.rst:465 +#: ../../howto/functional.rst:464 msgid "Here's a sample usage of the ``generate_ints()`` generator:" msgstr "" -#: ../../howto/functional.rst:482 +#: ../../howto/functional.rst:481 msgid "" "You could equally write ``for i in generate_ints(5)``, or ``a, b, c = " "generate_ints(3)``." msgstr "" -#: ../../howto/functional.rst:485 +#: ../../howto/functional.rst:484 msgid "" "Inside a generator function, ``return value`` causes " "``StopIteration(value)`` to be raised from the :meth:`~generator.__next__` " @@ -579,7 +579,7 @@ msgid "" "procession of values ends and the generator cannot yield any further values." msgstr "" -#: ../../howto/functional.rst:490 +#: ../../howto/functional.rst:489 msgid "" "You could achieve the effect of generators manually by writing your own " "class and storing all the local variables of the generator as instance " @@ -589,7 +589,7 @@ msgid "" "complicated generator, writing a corresponding class can be much messier." msgstr "" -#: ../../howto/functional.rst:498 +#: ../../howto/functional.rst:497 msgid "" "The test suite included with Python's library, :source:`Lib/test/" "test_generators.py`, contains a number of more interesting examples. Here's " @@ -597,7 +597,7 @@ msgid "" "generators recursively. ::" msgstr "" -#: ../../howto/functional.rst:514 +#: ../../howto/functional.rst:513 msgid "" "Two other examples in ``test_generators.py`` produce solutions for the N-" "Queens problem (placing N queens on an NxN chess board so that no queen " @@ -606,11 +606,11 @@ msgid "" "twice)." msgstr "" -#: ../../howto/functional.rst:522 +#: ../../howto/functional.rst:521 msgid "Passing values into a generator" msgstr "" -#: ../../howto/functional.rst:524 +#: ../../howto/functional.rst:523 msgid "" "In Python 2.4 and earlier, generators only produced output. Once a " "generator's code was invoked to create an iterator, there was no way to pass " @@ -620,14 +620,14 @@ msgid "" "these approaches are messy." msgstr "" -#: ../../howto/functional.rst:531 +#: ../../howto/functional.rst:530 msgid "" "In Python 2.5 there's a simple way to pass values into a generator. :keyword:" "`yield` became an expression, returning a value that can be assigned to a " "variable or otherwise operated on::" msgstr "" -#: ../../howto/functional.rst:537 +#: ../../howto/functional.rst:536 msgid "" "I recommend that you **always** put parentheses around a ``yield`` " "expression when you're doing something with the returned value, as in the " @@ -635,7 +635,7 @@ msgid "" "always add them instead of having to remember when they're needed." msgstr "" -#: ../../howto/functional.rst:542 +#: ../../howto/functional.rst:541 msgid "" "(:pep:`342` explains the exact rules, which are that a ``yield``-expression " "must always be parenthesized except when it occurs at the top-level " @@ -644,7 +644,7 @@ msgid "" "operation, as in ``val = (yield i) + 12``.)" msgstr "" -#: ../../howto/functional.rst:548 +#: ../../howto/functional.rst:547 msgid "" "Values are sent into a generator by calling its :meth:`send(value) " "` method. This method resumes the generator's code and the " @@ -652,17 +652,17 @@ msgid "" "`~generator.__next__` method is called, the ``yield`` returns ``None``." msgstr "" -#: ../../howto/functional.rst:553 +#: ../../howto/functional.rst:552 msgid "" "Here's a simple counter that increments by 1 and allows changing the value " "of the internal counter." msgstr "" -#: ../../howto/functional.rst:568 +#: ../../howto/functional.rst:567 msgid "And here's an example of changing the counter:" msgstr "" -#: ../../howto/functional.rst:585 +#: ../../howto/functional.rst:584 msgid "" "Because ``yield`` will often be returning ``None``, you should always check " "for this case. Don't just use its value in expressions unless you're sure " @@ -670,20 +670,20 @@ msgid "" "resume your generator function." msgstr "" -#: ../../howto/functional.rst:590 +#: ../../howto/functional.rst:589 msgid "" "In addition to :meth:`~generator.send`, there are two other methods on " "generators:" msgstr "" -#: ../../howto/functional.rst:593 +#: ../../howto/functional.rst:592 msgid "" ":meth:`throw(type, value=None, traceback=None) ` is used to " "raise an exception inside the generator; the exception is raised by the " "``yield`` expression where the generator's execution is paused." msgstr "" -#: ../../howto/functional.rst:597 +#: ../../howto/functional.rst:596 msgid "" ":meth:`~generator.close` raises a :exc:`GeneratorExit` exception inside the " "generator to terminate the iteration. On receiving this exception, the " @@ -694,20 +694,20 @@ msgid "" "collected." msgstr "" -#: ../../howto/functional.rst:605 +#: ../../howto/functional.rst:604 msgid "" "If you need to run cleanup code when a :exc:`GeneratorExit` occurs, I " "suggest using a ``try: ... finally:`` suite instead of catching :exc:" "`GeneratorExit`." msgstr "" -#: ../../howto/functional.rst:608 +#: ../../howto/functional.rst:607 msgid "" "The cumulative effect of these changes is to turn generators from one-way " "producers of information into both producers and consumers." msgstr "" -#: ../../howto/functional.rst:611 +#: ../../howto/functional.rst:610 msgid "" "Generators also become **coroutines**, a more generalized form of " "subroutines. Subroutines are entered at one point and exited at another " @@ -716,36 +716,36 @@ msgid "" "statements)." msgstr "" -#: ../../howto/functional.rst:618 +#: ../../howto/functional.rst:617 msgid "Built-in functions" msgstr "" -#: ../../howto/functional.rst:620 +#: ../../howto/functional.rst:619 msgid "" "Let's look in more detail at built-in functions often used with iterators." msgstr "" -#: ../../howto/functional.rst:622 +#: ../../howto/functional.rst:621 msgid "" "Two of Python's built-in functions, :func:`map` and :func:`filter` duplicate " "the features of generator expressions:" msgstr "" -#: ../../howto/functional.rst:634 +#: ../../howto/functional.rst:633 msgid "" ":func:`map(f, iterA, iterB, ...) ` returns an iterator over the sequence" msgstr "" -#: ../../howto/functional.rst:626 +#: ../../howto/functional.rst:625 msgid "" "``f(iterA[0], iterB[0]), f(iterA[1], iterB[1]), f(iterA[2], iterB[2]), ...``." msgstr "" -#: ../../howto/functional.rst:636 +#: ../../howto/functional.rst:635 msgid "You can of course achieve the same effect with a list comprehension." msgstr "" -#: ../../howto/functional.rst:638 +#: ../../howto/functional.rst:637 msgid "" ":func:`filter(predicate, iter) ` returns an iterator over all the " "sequence elements that meet a certain condition, and is similarly duplicated " @@ -754,24 +754,24 @@ msgid "" "must take a single value." msgstr "" -#: ../../howto/functional.rst:651 +#: ../../howto/functional.rst:650 msgid "This can also be written as a list comprehension:" msgstr "" -#: ../../howto/functional.rst:657 +#: ../../howto/functional.rst:656 msgid "" ":func:`enumerate(iter, start=0) ` counts off the elements in the " "iterable returning 2-tuples containing the count (from *start*) and each " "element. ::" msgstr "" -#: ../../howto/functional.rst:667 +#: ../../howto/functional.rst:666 msgid "" ":func:`enumerate` is often used when looping through a list and recording " "the indexes at which certain conditions are met::" msgstr "" -#: ../../howto/functional.rst:675 +#: ../../howto/functional.rst:674 msgid "" ":func:`sorted(iterable, key=None, reverse=False) ` collects all the " "elements of the iterable into a list, sorts the list, and returns the sorted " @@ -779,12 +779,12 @@ msgid "" "constructed list's :meth:`~list.sort` method. ::" msgstr "" -#: ../../howto/functional.rst:690 +#: ../../howto/functional.rst:689 msgid "" "(For a more detailed discussion of sorting, see the :ref:`sortinghowto`.)" msgstr "" -#: ../../howto/functional.rst:693 +#: ../../howto/functional.rst:692 msgid "" "The :func:`any(iter) ` and :func:`all(iter) ` built-ins look at " "the truth values of an iterable's contents. :func:`any` returns ``True`` if " @@ -792,13 +792,13 @@ msgid "" "``True`` if all of the elements are true values:" msgstr "" -#: ../../howto/functional.rst:712 +#: ../../howto/functional.rst:711 msgid "" ":func:`zip(iterA, iterB, ...) ` takes one element from each iterable " "and returns them in a tuple::" msgstr "" -#: ../../howto/functional.rst:718 +#: ../../howto/functional.rst:717 msgid "" "It doesn't construct an in-memory list and exhaust all the input iterators " "before returning; instead tuples are constructed and returned only if " @@ -806,56 +806,56 @@ msgid "" "evaluation `__.)" msgstr "" -#: ../../howto/functional.rst:723 +#: ../../howto/functional.rst:722 msgid "" "This iterator is intended to be used with iterables that are all of the same " "length. If the iterables are of different lengths, the resulting stream " "will be the same length as the shortest iterable. ::" msgstr "" -#: ../../howto/functional.rst:730 +#: ../../howto/functional.rst:729 msgid "" "You should avoid doing this, though, because an element may be taken from " "the longer iterators and discarded. This means you can't go on to use the " "iterators further because you risk skipping a discarded element." msgstr "" -#: ../../howto/functional.rst:736 +#: ../../howto/functional.rst:735 msgid "The itertools module" msgstr "" -#: ../../howto/functional.rst:738 +#: ../../howto/functional.rst:737 msgid "" "The :mod:`itertools` module contains a number of commonly-used iterators as " "well as functions for combining several iterators. This section will " "introduce the module's contents by showing small examples." msgstr "" -#: ../../howto/functional.rst:742 +#: ../../howto/functional.rst:741 msgid "The module's functions fall into a few broad classes:" msgstr "" -#: ../../howto/functional.rst:744 +#: ../../howto/functional.rst:743 msgid "Functions that create a new iterator based on an existing iterator." msgstr "" -#: ../../howto/functional.rst:745 +#: ../../howto/functional.rst:744 msgid "Functions for treating an iterator's elements as function arguments." msgstr "" -#: ../../howto/functional.rst:746 +#: ../../howto/functional.rst:745 msgid "Functions for selecting portions of an iterator's output." msgstr "" -#: ../../howto/functional.rst:747 +#: ../../howto/functional.rst:746 msgid "A function for grouping an iterator's output." msgstr "" -#: ../../howto/functional.rst:750 +#: ../../howto/functional.rst:749 msgid "Creating new iterators" msgstr "" -#: ../../howto/functional.rst:752 +#: ../../howto/functional.rst:751 msgid "" ":func:`itertools.count(start, step) ` returns an infinite " "stream of evenly spaced values. You can optionally supply the starting " @@ -863,7 +863,7 @@ msgid "" "defaults to 1::" msgstr "" -#: ../../howto/functional.rst:763 +#: ../../howto/functional.rst:762 msgid "" ":func:`itertools.cycle(iter) ` saves a copy of the contents " "of a provided iterable and returns a new iterator that returns its elements " @@ -871,14 +871,14 @@ msgid "" "infinitely. ::" msgstr "" -#: ../../howto/functional.rst:770 +#: ../../howto/functional.rst:769 msgid "" ":func:`itertools.repeat(elem, [n]) ` returns the provided " "element *n* times, or returns the element endlessly if *n* is not " "provided. ::" msgstr "" -#: ../../howto/functional.rst:778 +#: ../../howto/functional.rst:777 msgid "" ":func:`itertools.chain(iterA, iterB, ...) ` takes an " "arbitrary number of iterables as input, and returns all the elements of the " @@ -886,7 +886,7 @@ msgid "" "the iterables have been exhausted. ::" msgstr "" -#: ../../howto/functional.rst:786 +#: ../../howto/functional.rst:785 msgid "" ":func:`itertools.islice(iter, [start], stop, [step]) ` " "returns a stream that's a slice of the iterator. With a single *stop* " @@ -897,7 +897,7 @@ msgid "" "*step*. ::" msgstr "" -#: ../../howto/functional.rst:800 +#: ../../howto/functional.rst:799 msgid "" ":func:`itertools.tee(iter, [n]) ` replicates an iterator; it " "returns *n* independent iterators that will all return the contents of the " @@ -907,11 +907,11 @@ msgid "" "and one of the new iterators is consumed more than the others. ::" msgstr "" -#: ../../howto/functional.rst:819 +#: ../../howto/functional.rst:818 msgid "Calling functions on elements" msgstr "" -#: ../../howto/functional.rst:821 +#: ../../howto/functional.rst:820 msgid "" "The :mod:`operator` module contains a set of functions corresponding to " "Python's operators. Some examples are :func:`operator.add(a, b) ` assumes that the " "iterable will return a stream of tuples, and calls *func* using these tuples " "as the arguments::" msgstr "" -#: ../../howto/functional.rst:839 +#: ../../howto/functional.rst:838 msgid "Selecting elements" msgstr "" -#: ../../howto/functional.rst:841 +#: ../../howto/functional.rst:840 msgid "" "Another group of functions chooses a subset of an iterator's elements based " "on a predicate." msgstr "" -#: ../../howto/functional.rst:844 +#: ../../howto/functional.rst:843 msgid "" ":func:`itertools.filterfalse(predicate, iter) ` is " "the opposite of :func:`filter`, returning all elements for which the " "predicate returns false::" msgstr "" -#: ../../howto/functional.rst:851 +#: ../../howto/functional.rst:850 msgid "" ":func:`itertools.takewhile(predicate, iter) ` returns " "elements for as long as the predicate returns true. Once the predicate " "returns false, the iterator will signal the end of its results. ::" msgstr "" -#: ../../howto/functional.rst:864 +#: ../../howto/functional.rst:863 msgid "" ":func:`itertools.dropwhile(predicate, iter) ` discards " "elements while the predicate returns true, and then returns the rest of the " "iterable's results. ::" msgstr "" -#: ../../howto/functional.rst:874 +#: ../../howto/functional.rst:873 msgid "" ":func:`itertools.compress(data, selectors) ` takes two " "iterators and returns only those elements of *data* for which the " @@ -966,18 +966,18 @@ msgid "" "is exhausted::" msgstr "" -#: ../../howto/functional.rst:883 +#: ../../howto/functional.rst:882 msgid "Combinatoric functions" msgstr "" -#: ../../howto/functional.rst:885 +#: ../../howto/functional.rst:884 msgid "" "The :func:`itertools.combinations(iterable, r) ` " "returns an iterator giving all possible *r*-tuple combinations of the " "elements contained in *iterable*. ::" msgstr "" -#: ../../howto/functional.rst:900 +#: ../../howto/functional.rst:899 msgid "" "The elements within each tuple remain in the same order as *iterable* " "returned them. For example, the number 1 is always before 2, 3, 4, or 5 in " @@ -986,25 +986,25 @@ msgid "" "constraint on the order, returning all possible arrangements of length *r*::" msgstr "" -#: ../../howto/functional.rst:919 +#: ../../howto/functional.rst:918 msgid "" "If you don't supply a value for *r* the length of the iterable is used, " "meaning that all the elements are permuted." msgstr "" -#: ../../howto/functional.rst:922 +#: ../../howto/functional.rst:921 msgid "" "Note that these functions produce all of the possible combinations by " "position and don't require that the contents of *iterable* are unique::" msgstr "" -#: ../../howto/functional.rst:929 +#: ../../howto/functional.rst:928 msgid "" "The identical tuple ``('a', 'a', 'b')`` occurs twice, but the two 'a' " "strings came from different positions." msgstr "" -#: ../../howto/functional.rst:932 +#: ../../howto/functional.rst:931 msgid "" "The :func:`itertools.combinations_with_replacement(iterable, r) ` function relaxes a different constraint: " @@ -1013,11 +1013,11 @@ msgid "" "the second element is selected. ::" msgstr "" -#: ../../howto/functional.rst:947 +#: ../../howto/functional.rst:946 msgid "Grouping elements" msgstr "" -#: ../../howto/functional.rst:949 +#: ../../howto/functional.rst:948 msgid "" "The last function I'll discuss, :func:`itertools.groupby(iter, " "key_func=None) `, is the most complicated. " @@ -1026,14 +1026,14 @@ msgid "" "key is simply each element itself." msgstr "" -#: ../../howto/functional.rst:954 +#: ../../howto/functional.rst:953 msgid "" ":func:`~itertools.groupby` collects all the consecutive elements from the " "underlying iterable that have the same key value, and returns a stream of 2-" "tuples containing a key value and an iterator for the elements with that key." msgstr "" -#: ../../howto/functional.rst:982 +#: ../../howto/functional.rst:981 msgid "" ":func:`~itertools.groupby` assumes that the underlying iterable's contents " "will already be sorted based on the key. Note that the returned iterators " @@ -1041,11 +1041,11 @@ msgid "" "iterator-1 before requesting iterator-2 and its corresponding key." msgstr "" -#: ../../howto/functional.rst:989 +#: ../../howto/functional.rst:988 msgid "The functools module" msgstr "" -#: ../../howto/functional.rst:991 +#: ../../howto/functional.rst:990 msgid "" "The :mod:`functools` module in Python 2.5 contains some higher-order " "functions. A **higher-order function** takes one or more functions as input " @@ -1053,7 +1053,7 @@ msgid "" "func:`functools.partial` function." msgstr "" -#: ../../howto/functional.rst:996 +#: ../../howto/functional.rst:995 msgid "" "For programs written in a functional style, you'll sometimes want to " "construct variants of existing functions that have some of the parameters " @@ -1063,7 +1063,7 @@ msgid "" "\"partial function application\"." msgstr "" -#: ../../howto/functional.rst:1002 +#: ../../howto/functional.rst:1001 msgid "" "The constructor for :func:`~functools.partial` takes the arguments " "``(function, arg1, arg2, ..., kwarg1=value1, kwarg2=value2)``. The " @@ -1071,11 +1071,11 @@ msgid "" "with the filled-in arguments." msgstr "" -#: ../../howto/functional.rst:1007 +#: ../../howto/functional.rst:1006 msgid "Here's a small but realistic example::" msgstr "" -#: ../../howto/functional.rst:1019 +#: ../../howto/functional.rst:1018 msgid "" ":func:`functools.reduce(func, iter, [initial_value]) ` " "cumulatively performs an operation on all the iterable's elements and, " @@ -1090,20 +1090,20 @@ msgid "" "``func(initial_value, A)`` is the first calculation. ::" msgstr "" -#: ../../howto/functional.rst:1043 +#: ../../howto/functional.rst:1042 msgid "" "If you use :func:`operator.add` with :func:`functools.reduce`, you'll add up " "all the elements of the iterable. This case is so common that there's a " "special built-in called :func:`sum` to compute it:" msgstr "" -#: ../../howto/functional.rst:1055 +#: ../../howto/functional.rst:1054 msgid "" "For many uses of :func:`functools.reduce`, though, it can be clearer to just " "write the obvious :keyword:`for` loop::" msgstr "" -#: ../../howto/functional.rst:1067 +#: ../../howto/functional.rst:1066 msgid "" "A related function is :func:`itertools.accumulate(iterable, func=operator." "add) `. It performs the same calculation, but instead " @@ -1111,11 +1111,11 @@ msgid "" "that also yields each partial result::" msgstr "" -#: ../../howto/functional.rst:1080 +#: ../../howto/functional.rst:1079 msgid "The operator module" msgstr "" -#: ../../howto/functional.rst:1082 +#: ../../howto/functional.rst:1081 msgid "" "The :mod:`operator` module was mentioned earlier. It contains a set of " "functions corresponding to Python's operators. These functions are often " @@ -1123,54 +1123,54 @@ msgid "" "functions that perform a single operation." msgstr "" -#: ../../howto/functional.rst:1087 +#: ../../howto/functional.rst:1086 msgid "Some of the functions in this module are:" msgstr "" -#: ../../howto/functional.rst:1089 +#: ../../howto/functional.rst:1088 msgid "" "Math operations: ``add()``, ``sub()``, ``mul()``, ``floordiv()``, " "``abs()``, ..." msgstr "" -#: ../../howto/functional.rst:1090 +#: ../../howto/functional.rst:1089 msgid "Logical operations: ``not_()``, ``truth()``." msgstr "" -#: ../../howto/functional.rst:1091 +#: ../../howto/functional.rst:1090 msgid "Bitwise operations: ``and_()``, ``or_()``, ``invert()``." msgstr "" -#: ../../howto/functional.rst:1092 +#: ../../howto/functional.rst:1091 msgid "" "Comparisons: ``eq()``, ``ne()``, ``lt()``, ``le()``, ``gt()``, and ``ge()``." msgstr "" -#: ../../howto/functional.rst:1093 +#: ../../howto/functional.rst:1092 msgid "Object identity: ``is_()``, ``is_not()``." msgstr "" -#: ../../howto/functional.rst:1095 +#: ../../howto/functional.rst:1094 msgid "Consult the operator module's documentation for a complete list." msgstr "" -#: ../../howto/functional.rst:1099 +#: ../../howto/functional.rst:1098 msgid "Small functions and the lambda expression" msgstr "" -#: ../../howto/functional.rst:1101 +#: ../../howto/functional.rst:1100 msgid "" "When writing functional-style programs, you'll often need little functions " "that act as predicates or that combine elements in some way." msgstr "" -#: ../../howto/functional.rst:1104 +#: ../../howto/functional.rst:1103 msgid "" "If there's a Python built-in or a module function that's suitable, you don't " "need to define a new function at all::" msgstr "" -#: ../../howto/functional.rst:1110 +#: ../../howto/functional.rst:1109 msgid "" "If the function you need doesn't exist, you need to write it. One way to " "write small functions is to use the :keyword:`lambda` expression. " @@ -1179,19 +1179,19 @@ msgid "" "expression::" msgstr "" -#: ../../howto/functional.rst:1119 +#: ../../howto/functional.rst:1118 msgid "" "An alternative is to just use the ``def`` statement and define a function in " "the usual way::" msgstr "" -#: ../../howto/functional.rst:1128 +#: ../../howto/functional.rst:1127 msgid "" "Which alternative is preferable? That's a style question; my usual course " "is to avoid using ``lambda``." msgstr "" -#: ../../howto/functional.rst:1131 +#: ../../howto/functional.rst:1130 msgid "" "One reason for my preference is that ``lambda`` is quite limited in the " "functions it can define. The result has to be computable as a single " @@ -1201,66 +1201,66 @@ msgid "" "that's hard to read. Quick, what's the following code doing? ::" msgstr "" -#: ../../howto/functional.rst:1141 +#: ../../howto/functional.rst:1140 msgid "" "You can figure it out, but it takes time to disentangle the expression to " "figure out what's going on. Using a short nested ``def`` statements makes " "things a little bit better::" msgstr "" -#: ../../howto/functional.rst:1151 +#: ../../howto/functional.rst:1150 msgid "But it would be best of all if I had simply used a ``for`` loop::" msgstr "" -#: ../../howto/functional.rst:1157 +#: ../../howto/functional.rst:1156 msgid "Or the :func:`sum` built-in and a generator expression::" msgstr "" -#: ../../howto/functional.rst:1161 +#: ../../howto/functional.rst:1160 msgid "" "Many uses of :func:`functools.reduce` are clearer when written as ``for`` " "loops." msgstr "" -#: ../../howto/functional.rst:1163 +#: ../../howto/functional.rst:1162 msgid "" "Fredrik Lundh once suggested the following set of rules for refactoring uses " "of ``lambda``:" msgstr "" -#: ../../howto/functional.rst:1166 +#: ../../howto/functional.rst:1165 msgid "Write a lambda function." msgstr "" -#: ../../howto/functional.rst:1167 +#: ../../howto/functional.rst:1166 msgid "Write a comment explaining what the heck that lambda does." msgstr "" -#: ../../howto/functional.rst:1168 +#: ../../howto/functional.rst:1167 msgid "" "Study the comment for a while, and think of a name that captures the essence " "of the comment." msgstr "" -#: ../../howto/functional.rst:1170 +#: ../../howto/functional.rst:1169 msgid "Convert the lambda to a def statement, using that name." msgstr "" -#: ../../howto/functional.rst:1171 +#: ../../howto/functional.rst:1170 msgid "Remove the comment." msgstr "" -#: ../../howto/functional.rst:1173 +#: ../../howto/functional.rst:1172 msgid "" "I really like these rules, but you're free to disagree about whether this " "lambda-free style is better." msgstr "" -#: ../../howto/functional.rst:1178 +#: ../../howto/functional.rst:1177 msgid "Revision History and Acknowledgements" msgstr "" -#: ../../howto/functional.rst:1180 +#: ../../howto/functional.rst:1179 msgid "" "The author would like to thank the following people for offering " "suggestions, corrections and assistance with various drafts of this article: " @@ -1268,40 +1268,40 @@ msgid "" "Krell, Leandro Lameiro, Jussi Salmela, Collin Winter, Blake Winton." msgstr "" -#: ../../howto/functional.rst:1185 +#: ../../howto/functional.rst:1184 msgid "Version 0.1: posted June 30 2006." msgstr "" -#: ../../howto/functional.rst:1187 +#: ../../howto/functional.rst:1186 msgid "Version 0.11: posted July 1 2006. Typo fixes." msgstr "" -#: ../../howto/functional.rst:1189 +#: ../../howto/functional.rst:1188 msgid "" "Version 0.2: posted July 10 2006. Merged genexp and listcomp sections into " "one. Typo fixes." msgstr "" -#: ../../howto/functional.rst:1192 +#: ../../howto/functional.rst:1191 msgid "" "Version 0.21: Added more references suggested on the tutor mailing list." msgstr "" -#: ../../howto/functional.rst:1194 +#: ../../howto/functional.rst:1193 msgid "" "Version 0.30: Adds a section on the ``functional`` module written by Collin " "Winter; adds short section on the operator module; a few other edits." msgstr "" -#: ../../howto/functional.rst:1199 +#: ../../howto/functional.rst:1198 msgid "References" msgstr "" -#: ../../howto/functional.rst:1202 +#: ../../howto/functional.rst:1201 msgid "General" msgstr "" -#: ../../howto/functional.rst:1204 +#: ../../howto/functional.rst:1203 msgid "" "**Structure and Interpretation of Computer Programs**, by Harold Abelson and " "Gerald Jay Sussman with Julie Sussman. Full text at https://mitpress.mit." @@ -1312,33 +1312,33 @@ msgid "" "Python code." msgstr "" -#: ../../howto/functional.rst:1212 +#: ../../howto/functional.rst:1211 msgid "" "http://www.defmacro.org/ramblings/fp.html: A general introduction to " "functional programming that uses Java examples and has a lengthy historical " "introduction." msgstr "" -#: ../../howto/functional.rst:1215 +#: ../../howto/functional.rst:1214 msgid "" "https://en.wikipedia.org/wiki/Functional_programming: General Wikipedia " "entry describing functional programming." msgstr "" -#: ../../howto/functional.rst:1218 +#: ../../howto/functional.rst:1217 msgid "https://en.wikipedia.org/wiki/Coroutine: Entry for coroutines." msgstr "" -#: ../../howto/functional.rst:1220 +#: ../../howto/functional.rst:1219 msgid "" "https://en.wikipedia.org/wiki/Currying: Entry for the concept of currying." msgstr "" -#: ../../howto/functional.rst:1223 +#: ../../howto/functional.rst:1222 msgid "Python-specific" msgstr "" -#: ../../howto/functional.rst:1225 +#: ../../howto/functional.rst:1224 msgid "" "http://gnosis.cx/TPiP/: The first chapter of David Mertz's book :title-" "reference:`Text Processing in Python` discusses functional programming for " @@ -1346,7 +1346,7 @@ msgid "" "Text Processing\"." msgstr "" -#: ../../howto/functional.rst:1230 +#: ../../howto/functional.rst:1229 msgid "" "Mertz also wrote a 3-part series of articles on functional programming for " "IBM's DeveloperWorks site; see `part 1 `__," msgstr "" -#: ../../howto/functional.rst:1238 +#: ../../howto/functional.rst:1237 msgid "Python documentation" msgstr "" -#: ../../howto/functional.rst:1240 +#: ../../howto/functional.rst:1239 msgid "Documentation for the :mod:`itertools` module." msgstr "" -#: ../../howto/functional.rst:1242 +#: ../../howto/functional.rst:1241 msgid "Documentation for the :mod:`functools` module." msgstr "" -#: ../../howto/functional.rst:1244 +#: ../../howto/functional.rst:1243 msgid "Documentation for the :mod:`operator` module." msgstr "" -#: ../../howto/functional.rst:1246 +#: ../../howto/functional.rst:1245 msgid ":pep:`289`: \"Generator Expressions\"" msgstr "" -#: ../../howto/functional.rst:1248 +#: ../../howto/functional.rst:1247 msgid "" ":pep:`342`: \"Coroutines via Enhanced Generators\" describes the new " "generator features in Python 2.5." diff --git a/install/index.po b/install/index.po index 28ba20bb23..1a3b39b3bd 100644 --- a/install/index.po +++ b/install/index.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-13 00:11+0000\n" +"POT-Creation-Date: 2021-09-24 00:11+0000\n" "PO-Revision-Date: 2018-05-23 14:37+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -258,8 +258,8 @@ msgid "" "If you don't choose an installation directory---i.e., if you just run " "``setup.py install``\\ ---then the :command:`install` command installs to " "the standard location for third-party Python modules. This location varies " -"by platform and by how you built/installed Python itself. On Unix (and Mac " -"OS X, which is also Unix-based), it also depends on whether the module " +"by platform and by how you built/installed Python itself. On Unix (and " +"macOS, which is also Unix-based), it also depends on whether the module " "distribution being installed is pure Python or contains extensions (\"non-" "pure\"):" msgstr "" @@ -346,7 +346,7 @@ msgid "" ":file:`{prefix}` and :file:`{exec-prefix}` stand for the directories that " "Python is installed to, and where it finds its libraries at run-time. They " "are always the same under Windows, and very often the same under Unix and " -"Mac OS X. You can find out what your Python installation uses for :file:" +"macOS. You can find out what your Python installation uses for :file:" "`{prefix}` and :file:`{exec-prefix}` by running Python in interactive mode " "and typing a few simple commands. Under Unix, just type ``python`` at the " "shell prompt. Under Windows, choose :menuselection:`Start --> Programs --> " @@ -427,7 +427,7 @@ msgid "" "Files will be installed into subdirectories of :data:`site.USER_BASE` " "(written as :file:`{userbase}` hereafter). This scheme installs pure Python " "modules and extension modules in the same location (also known as :data:" -"`site.USER_SITE`). Here are the values for UNIX, including Mac OS X:" +"`site.USER_SITE`). Here are the values for UNIX, including macOS:" msgstr "" #: ../../install/index.rst:311 ../../install/index.rst:322 @@ -996,8 +996,8 @@ msgstr "" #: ../../install/index.rst:730 msgid "" "The names and locations of the configuration files vary slightly across " -"platforms. On Unix and Mac OS X, the three configuration files (in the " -"order they are processed) are:" +"platforms. On Unix and macOS, the three configuration files (in the order " +"they are processed) are:" msgstr "" #: ../../install/index.rst:735 ../../install/index.rst:747 diff --git a/installing/index.po b/installing/index.po index 0f163b1013..babc94c67b 100644 --- a/installing/index.po +++ b/installing/index.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-20 18:08+0800\n" +"POT-Creation-Date: 2021-10-02 17:19+0000\n" "PO-Revision-Date: 2018-05-23 14:37+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -96,7 +96,7 @@ msgstr "" #: ../../installing/index.rst:47 msgid "" -"The `Python Packaging Index `__ is a public repository of " +"The `Python Package Index `__ is a public repository of " "open source licensed packages made available for use by other Python users." msgstr "" @@ -144,12 +144,12 @@ msgstr "" #: ../../installing/index.rst:80 msgid "" "The following command will install the latest version of a module and its " -"dependencies from the Python Packaging Index::" +"dependencies from the Python Package Index::" msgstr "" #: ../../installing/index.rst:87 msgid "" -"For POSIX users (including Mac OS X and Linux users), the examples in this " +"For POSIX users (including macOS and Linux users), the examples in this " "guide assume the use of a :term:`virtual environment`." msgstr "" @@ -254,9 +254,9 @@ msgstr "" #: ../../installing/index.rst:166 msgid "" -"On Linux, Mac OS X, and other POSIX systems, use the versioned Python " -"commands in combination with the ``-m`` switch to run the appropriate copy " -"of ``pip``::" +"On Linux, macOS, and other POSIX systems, use the versioned Python commands " +"in combination with the ``-m`` switch to run the appropriate copy of " +"``pip``::" msgstr "" #: ../../installing/index.rst:175 @@ -323,10 +323,10 @@ msgstr "" #: ../../installing/index.rst:227 msgid "" "With the introduction of support for the binary ``wheel`` format, and the " -"ability to publish wheels for at least Windows and Mac OS X through the " -"Python Packaging Index, this problem is expected to diminish over time, as " -"users are more regularly able to install pre-built extensions rather than " -"needing to build them themselves." +"ability to publish wheels for at least Windows and macOS through the Python " +"Package Index, this problem is expected to diminish over time, as users are " +"more regularly able to install pre-built extensions rather than needing to " +"build them themselves." msgstr "" #: ../../installing/index.rst:233 diff --git a/library/argparse.po b/library/argparse.po index 18995e7fb2..f5e14a89fb 100644 --- a/library/argparse.po +++ b/library/argparse.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-13 00:11+0000\n" +"POT-Creation-Date: 2021-09-29 00:11+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-" @@ -946,7 +946,7 @@ msgstr "" #: ../../library/argparse.rst:1106 msgid "" "For example, JSON or YAML conversions have complex error cases that require " -"better reporting than can be given by the ``type`` keyword. An :exc:`~json." +"better reporting than can be given by the ``type`` keyword. A :exc:`~json." "JSONDecodeError` would not be well formatted and a :exc:`FileNotFound` " "exception would not be handled at all." msgstr "" diff --git a/library/array.po b/library/array.po index eb1db67070..6cb6a5740c 100644 --- a/library/array.po +++ b/library/array.po @@ -1,5 +1,5 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2018, Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # # Translators: @@ -7,9 +7,9 @@ # 周 忠毅 , 2016 msgid "" msgstr "" -"Project-Id-Version: Python 3.7\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-13 00:11+0000\n" +"POT-Creation-Date: 2021-10-07 00:10+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-" @@ -473,17 +473,20 @@ msgstr "" "將 External Data Representation (XDR) 的資料包裝與解開包裝,這用在一些遠端操" "作的系統 ( remote procedure call systems ) 。" -#: ../../library/array.rst:260 -msgid "`The Numerical Python Documentation `_" -msgstr "" +#: ../../library/array.rst:259 +msgid "`NumPy `_" +msgstr "`NumPy `_" #: ../../library/array.rst:260 -msgid "" -"The Numeric Python extension (NumPy) defines another array type; see http://" -"www.numpy.org/ for further information about Numerical Python." -msgstr "" -"Python 數值運算的擴充 (The Numeric Python extension, NumPy) 定義了另一個陣列" -"型態,更多關於 Python 的數值運算參考 http://www.numpy.org/ 。" +msgid "The NumPy package defines another array type." +msgstr "NumPy 套件定義了另一個陣列型態" + +#~ msgid "" +#~ "The Numeric Python extension (NumPy) defines another array type; see " +#~ "http://www.numpy.org/ for further information about Numerical Python." +#~ msgstr "" +#~ "Python 數值運算的擴充 (The Numeric Python extension, NumPy) 定義了另一個陣" +#~ "列型態,更多關於 Python 的數值運算參考 http://www.numpy.org/ 。" #~ msgid "Py_UNICODE" #~ msgstr "Py_UNICODE" diff --git a/library/ast.po b/library/ast.po index 8bb2a3478f..19cca2a213 100644 --- a/library/ast.po +++ b/library/ast.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-13 00:11+0000\n" +"POT-Creation-Date: 2021-10-07 00:10+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-" @@ -818,37 +818,58 @@ msgid "" "version is ``(3, 4)``; the highest is ``sys.version_info[0:2]``." msgstr "" -#: ../../library/ast.rst:1553 ../../library/ast.rst:1592 +#: ../../library/ast.rst:1552 +msgid "" +"If source contains a null character ('\\0'), :exc:`ValueError` is raised." +msgstr "" + +#: ../../library/ast.rst:1555 +msgid "" +"Note that successfully parsing source code into an AST object doesn't " +"guarantee that the source code provided is valid Python code that can be " +"executed as the compilation step can raise further :exc:`SyntaxError` " +"exceptions. For instance, the source ``return 42`` generates a valid AST " +"node for a return statement, but it cannot be compiled alone (it needs to be " +"inside a function node)." +msgstr "" + +#: ../../library/ast.rst:1562 +msgid "" +"In particular, :func:`ast.parse` won't do any scoping checks, which the " +"compilation step does." +msgstr "" + +#: ../../library/ast.rst:1566 ../../library/ast.rst:1605 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." msgstr "" -#: ../../library/ast.rst:1557 +#: ../../library/ast.rst:1570 msgid "Added ``type_comments``, ``mode='func_type'`` and ``feature_version``." msgstr "" -#: ../../library/ast.rst:1563 +#: ../../library/ast.rst:1576 msgid "" "Unparse an :class:`ast.AST` object and generate a string with code that " "would produce an equivalent :class:`ast.AST` object if parsed back with :" "func:`ast.parse`." msgstr "" -#: ../../library/ast.rst:1568 +#: ../../library/ast.rst:1581 msgid "" "The produced code string will not necessarily be equal to the original code " "that generated the :class:`ast.AST` object (without any compiler " "optimizations, such as constant tuples/frozensets)." msgstr "" -#: ../../library/ast.rst:1573 +#: ../../library/ast.rst:1586 msgid "" "Trying to unparse a highly complex expression would result with :exc:" "`RecursionError`." msgstr "" -#: ../../library/ast.rst:1581 +#: ../../library/ast.rst:1594 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 " @@ -856,7 +877,7 @@ msgid "" "dicts, sets, booleans, and ``None``." msgstr "" -#: ../../library/ast.rst:1586 +#: ../../library/ast.rst:1599 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 " @@ -864,15 +885,15 @@ msgid "" "operators or indexing." msgstr "" -#: ../../library/ast.rst:1596 +#: ../../library/ast.rst:1609 msgid "Now allows bytes and set literals." msgstr "" -#: ../../library/ast.rst:1599 +#: ../../library/ast.rst:1612 msgid "Now supports creating empty sets with ``'set()'``." msgstr "" -#: ../../library/ast.rst:1605 +#: ../../library/ast.rst:1618 msgid "" "Return the docstring of the given *node* (which must be a :class:" "`FunctionDef`, :class:`AsyncFunctionDef`, :class:`ClassDef`, or :class:" @@ -880,24 +901,24 @@ msgid "" "clean up the docstring's indentation with :func:`inspect.cleandoc`." msgstr "" -#: ../../library/ast.rst:1611 +#: ../../library/ast.rst:1624 msgid ":class:`AsyncFunctionDef` is now supported." msgstr "" -#: ../../library/ast.rst:1617 +#: ../../library/ast.rst:1630 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:1621 +#: ../../library/ast.rst:1634 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:1629 +#: ../../library/ast.rst:1642 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 " @@ -906,77 +927,77 @@ msgid "" "the values of the parent node. It works recursively starting at *node*." msgstr "" -#: ../../library/ast.rst:1638 +#: ../../library/ast.rst:1651 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:1645 +#: ../../library/ast.rst:1658 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:1652 +#: ../../library/ast.rst:1665 msgid "" "Yield a tuple of ``(fieldname, value)`` for each field in ``node._fields`` " "that is present on *node*." msgstr "" -#: ../../library/ast.rst:1658 +#: ../../library/ast.rst:1671 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:1664 +#: ../../library/ast.rst:1677 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:1671 +#: ../../library/ast.rst:1684 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:1675 +#: ../../library/ast.rst:1688 msgid "" "This class is meant to be subclassed, with the subclass adding visitor " "methods." msgstr "" -#: ../../library/ast.rst:1680 +#: ../../library/ast.rst:1693 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:1686 +#: ../../library/ast.rst:1699 msgid "This visitor calls :meth:`visit` on all children of the node." msgstr "" -#: ../../library/ast.rst:1688 +#: ../../library/ast.rst:1701 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:1692 +#: ../../library/ast.rst:1705 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:1698 +#: ../../library/ast.rst:1711 msgid "" "Methods :meth:`visit_Num`, :meth:`visit_Str`, :meth:`visit_Bytes`, :meth:" "`visit_NameConstant` and :meth:`visit_Ellipsis` are deprecated now and will " @@ -984,13 +1005,13 @@ msgid "" "method to handle all constant nodes." msgstr "" -#: ../../library/ast.rst:1706 +#: ../../library/ast.rst:1719 msgid "" "A :class:`NodeVisitor` subclass that walks the abstract syntax tree and " "allows modification of nodes." msgstr "" -#: ../../library/ast.rst:1709 +#: ../../library/ast.rst:1722 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 " @@ -999,27 +1020,27 @@ msgid "" "may be the original node in which case no replacement takes place." msgstr "" -#: ../../library/ast.rst:1715 +#: ../../library/ast.rst:1728 msgid "" "Here is an example transformer that rewrites all occurrences of name lookups " "(``foo``) to ``data['foo']``::" msgstr "" -#: ../../library/ast.rst:1727 +#: ../../library/ast.rst:1740 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:1731 +#: ../../library/ast.rst:1744 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:1735 +#: ../../library/ast.rst:1748 msgid "" "If :class:`NodeTransformer` introduces new nodes (that weren't part of " "original tree) without giving them location information (such as :attr:" @@ -1027,11 +1048,11 @@ msgid "" "tree to recalculate the location information::" msgstr "" -#: ../../library/ast.rst:1743 +#: ../../library/ast.rst:1756 msgid "Usually you use the transformer like this::" msgstr "" -#: ../../library/ast.rst:1750 +#: ../../library/ast.rst:1763 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 " @@ -1042,7 +1063,7 @@ msgid "" "true." msgstr "" -#: ../../library/ast.rst:1758 +#: ../../library/ast.rst:1771 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 ``" @@ -1052,87 +1073,87 @@ msgid "" "string is used to indent each level." msgstr "" -#: ../../library/ast.rst:1765 +#: ../../library/ast.rst:1778 msgid "Added the *indent* option." msgstr "" -#: ../../library/ast.rst:1772 +#: ../../library/ast.rst:1785 msgid "Compiler Flags" msgstr "" -#: ../../library/ast.rst:1774 +#: ../../library/ast.rst:1787 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:1779 +#: ../../library/ast.rst:1792 msgid "" "Enables support for top-level ``await``, ``async for``, ``async with`` and " "async comprehensions." msgstr "" -#: ../../library/ast.rst:1786 +#: ../../library/ast.rst:1799 msgid "" "Generates and returns an abstract syntax tree instead of returning a " "compiled code object." msgstr "" -#: ../../library/ast.rst:1791 +#: ../../library/ast.rst:1804 msgid "" "Enables support for :pep:`484` and :pep:`526` style type comments (``# type: " "``, ``# type: ignore ``)." msgstr "" -#: ../../library/ast.rst:1800 +#: ../../library/ast.rst:1813 msgid "Command-Line Usage" msgstr "" -#: ../../library/ast.rst:1804 +#: ../../library/ast.rst:1817 msgid "" "The :mod:`ast` module can be executed as a script from the command line. It " "is as simple as:" msgstr "" -#: ../../library/ast.rst:1811 +#: ../../library/ast.rst:1824 msgid "The following options are accepted:" msgstr "" -#: ../../library/ast.rst:1817 +#: ../../library/ast.rst:1830 msgid "Show the help message and exit." msgstr "" -#: ../../library/ast.rst:1822 +#: ../../library/ast.rst:1835 msgid "" "Specify what kind of code must be compiled, like the *mode* argument in :" "func:`parse`." msgstr "" -#: ../../library/ast.rst:1827 +#: ../../library/ast.rst:1840 msgid "Don't parse type comments." msgstr "" -#: ../../library/ast.rst:1831 +#: ../../library/ast.rst:1844 msgid "Include attributes such as line numbers and column offsets." msgstr "" -#: ../../library/ast.rst:1836 +#: ../../library/ast.rst:1849 msgid "Indentation of nodes in AST (number of spaces)." msgstr "" -#: ../../library/ast.rst:1838 +#: ../../library/ast.rst:1851 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:1844 +#: ../../library/ast.rst:1857 msgid "" "`Green Tree Snakes `_, an external " "documentation resource, has good details on working with Python ASTs." msgstr "" -#: ../../library/ast.rst:1847 +#: ../../library/ast.rst:1860 msgid "" "`ASTTokens `_ " "annotates Python ASTs with the positions of tokens and text in the source " @@ -1140,21 +1161,21 @@ msgid "" "transformations." msgstr "" -#: ../../library/ast.rst:1852 +#: ../../library/ast.rst:1865 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:1856 +#: ../../library/ast.rst:1869 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:1861 +#: ../../library/ast.rst:1874 msgid "" "`Parso `_ is a Python parser that supports " "error recovery and round-trip parsing for different Python versions (in " diff --git a/library/cgi.po b/library/cgi.po index 25079855ff..f86998b0af 100644 --- a/library/cgi.po +++ b/library/cgi.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-13 00:11+0000\n" +"POT-Creation-Date: 2021-09-23 00:12+0000\n" "PO-Revision-Date: 2018-05-23 14:40+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -115,7 +115,7 @@ msgid "" "form contains non-ASCII characters, use the *encoding* keyword parameter set " "to the value of the encoding defined for the document. It is usually " "contained in the META tag in the HEAD section of the HTML document or by " -"the :mailheader:`Content-Type` header). This reads the form contents from " +"the :mailheader:`Content-Type` header. This reads the form contents from " "the standard input or the environment (depending on the value of various " "environment variables set according to the CGI standard). Since it may " "consume standard input, it should be instantiated only once." diff --git a/library/codecs.po b/library/codecs.po index 7740ec6387..7482963470 100644 --- a/library/codecs.po +++ b/library/codecs.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-13 00:11+0000\n" +"POT-Creation-Date: 2021-09-25 06:00+0000\n" "PO-Revision-Date: 2018-05-23 14:40+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1170,7 +1170,7 @@ msgstr "" #: ../../library/codecs.rst:923 msgid "" -"There's another encoding that is able to encoding the full range of Unicode " +"There's another encoding that is able to encode the full range of Unicode " "characters: UTF-8. UTF-8 is an 8-bit encoding, which means there are no " "issues with byte order in UTF-8. Each byte in a UTF-8 byte sequence consists " "of two parts: marker bits (the most significant bits) and payload bits. The " diff --git a/library/configparser.po b/library/configparser.po index d996812c8d..0af54e3004 100644 --- a/library/configparser.po +++ b/library/configparser.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-13 00:11+0000\n" +"POT-Creation-Date: 2021-09-18 00:10+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-" @@ -172,35 +172,36 @@ msgid "" "header, followed by key/value entries separated by a specific string (``=`` " "or ``:`` by default [1]_). By default, section names are case sensitive but " "keys are not [1]_. Leading and trailing whitespace is removed from keys and " -"values. Values can be omitted, in which case the key/value delimiter may " -"also be left out. Values can also span multiple lines, as long as they are " -"indented deeper than the first line of the value. Depending on the parser's " -"mode, blank lines may be treated as parts of multiline values or ignored." +"values. Values can be omitted if the parser is configured to allow it [1]_, " +"in which case the key/value delimiter may also be left out. Values can also " +"span multiple lines, as long as they are indented deeper than the first line " +"of the value. Depending on the parser's mode, blank lines may be treated as " +"parts of multiline values or ignored." msgstr "" -#: ../../library/configparser.rst:245 +#: ../../library/configparser.rst:246 msgid "" "Configuration files may include comments, prefixed by specific characters " "(``#`` and ``;`` by default [1]_). Comments may appear on their own on an " "otherwise empty line, possibly indented. [1]_" msgstr "" -#: ../../library/configparser.rst:249 ../../library/configparser.rst:312 +#: ../../library/configparser.rst:250 ../../library/configparser.rst:313 msgid "For example:" msgstr "" -#: ../../library/configparser.rst:297 +#: ../../library/configparser.rst:298 msgid "Interpolation of values" msgstr "" -#: ../../library/configparser.rst:299 +#: ../../library/configparser.rst:300 msgid "" "On top of the core functionality, :class:`ConfigParser` supports " "interpolation. This means values can be preprocessed before returning them " "from ``get()`` calls." msgstr "" -#: ../../library/configparser.rst:307 +#: ../../library/configparser.rst:308 msgid "" "The default implementation used by :class:`ConfigParser`. It enables values " "to contain format strings which refer to other values in the same section, " @@ -208,7 +209,7 @@ msgid "" "can be provided on initialization." msgstr "" -#: ../../library/configparser.rst:324 +#: ../../library/configparser.rst:325 msgid "" "In the example above, :class:`ConfigParser` with *interpolation* set to " "``BasicInterpolation()`` would resolve ``%(home_dir)s`` to the value of " @@ -218,14 +219,14 @@ msgid "" "specific order in the configuration file." msgstr "" -#: ../../library/configparser.rst:331 +#: ../../library/configparser.rst:332 msgid "" "With ``interpolation`` set to ``None``, the parser would simply return ``" "%(my_dir)s/Pictures`` as the value of ``my_pictures`` and ``%(home_dir)s/" "lumberjack`` as the value of ``my_dir``." msgstr "" -#: ../../library/configparser.rst:339 +#: ../../library/configparser.rst:340 msgid "" "An alternative handler for interpolation which implements a more advanced " "syntax, used for instance in ``zc.buildout``. Extended interpolation is " @@ -235,21 +236,21 @@ msgid "" "possibly the default values from the special section)." msgstr "" -#: ../../library/configparser.rst:346 +#: ../../library/configparser.rst:347 msgid "" "For example, the configuration specified above with basic interpolation, " "would look like this with extended interpolation:" msgstr "" -#: ../../library/configparser.rst:359 +#: ../../library/configparser.rst:360 msgid "Values from other sections can be fetched as well:" msgstr "" -#: ../../library/configparser.rst:381 +#: ../../library/configparser.rst:382 msgid "Mapping Protocol Access" msgstr "" -#: ../../library/configparser.rst:385 +#: ../../library/configparser.rst:386 msgid "" "Mapping protocol access is a generic name for functionality that enables " "using custom objects as if they were dictionaries. In case of :mod:" @@ -257,7 +258,7 @@ msgid "" "``parser['section']['option']`` notation." msgstr "" -#: ../../library/configparser.rst:390 +#: ../../library/configparser.rst:391 msgid "" "``parser['section']`` in particular returns a proxy for the section's data " "in the parser. This means that the values are not copied but they are taken " @@ -266,7 +267,7 @@ msgid "" "original parser." msgstr "" -#: ../../library/configparser.rst:396 +#: ../../library/configparser.rst:397 msgid "" ":mod:`configparser` objects behave as close to actual dictionaries as " "possible. The mapping interface is complete and adheres to the :class:" @@ -274,7 +275,7 @@ msgid "" "that should be taken into account:" msgstr "" -#: ../../library/configparser.rst:401 +#: ../../library/configparser.rst:402 msgid "" "By default, all keys in sections are accessible in a case-insensitive manner " "[1]_. E.g. ``for option in parser[\"section\"]`` yields only " @@ -283,7 +284,7 @@ msgid "" "expressions return ``True``::" msgstr "" -#: ../../library/configparser.rst:409 +#: ../../library/configparser.rst:410 msgid "" "All sections include ``DEFAULTSECT`` values as well which means that ``." "clear()`` on a section may not leave the section visibly empty. This is " @@ -293,30 +294,30 @@ msgid "" "default value causes a :exc:`KeyError`." msgstr "" -#: ../../library/configparser.rst:416 +#: ../../library/configparser.rst:417 msgid "``DEFAULTSECT`` cannot be removed from the parser:" msgstr "" -#: ../../library/configparser.rst:418 +#: ../../library/configparser.rst:419 msgid "trying to delete it raises :exc:`ValueError`," msgstr "" -#: ../../library/configparser.rst:420 +#: ../../library/configparser.rst:421 msgid "``parser.clear()`` leaves it intact," msgstr "" -#: ../../library/configparser.rst:422 +#: ../../library/configparser.rst:423 msgid "``parser.popitem()`` never returns it." msgstr "" -#: ../../library/configparser.rst:424 +#: ../../library/configparser.rst:425 msgid "" "``parser.get(section, option, **kwargs)`` - the second argument is **not** a " "fallback value. Note however that the section-level ``get()`` methods are " "compatible both with the mapping protocol and the classic configparser API." msgstr "" -#: ../../library/configparser.rst:428 +#: ../../library/configparser.rst:429 msgid "" "``parser.items()`` is compatible with the mapping protocol (returns a list " "of *section_name*, *section_proxy* pairs including the DEFAULTSECT). " @@ -326,18 +327,18 @@ msgid "" "(unless ``raw=True`` is provided)." msgstr "" -#: ../../library/configparser.rst:435 +#: ../../library/configparser.rst:436 msgid "" "The mapping protocol is implemented on top of the existing legacy API so " "that subclasses overriding the original interface still should have mappings " "working as expected." msgstr "" -#: ../../library/configparser.rst:441 +#: ../../library/configparser.rst:442 msgid "Customizing Parser Behaviour" msgstr "" -#: ../../library/configparser.rst:443 +#: ../../library/configparser.rst:444 msgid "" "There are nearly as many INI format variants as there are applications using " "it. :mod:`configparser` goes a long way to provide support for the largest " @@ -346,17 +347,17 @@ msgid "" "customize some of the features." msgstr "" -#: ../../library/configparser.rst:449 +#: ../../library/configparser.rst:450 msgid "" "The most common way to change the way a specific config parser works is to " "use the :meth:`__init__` options:" msgstr "" -#: ../../library/configparser.rst:452 +#: ../../library/configparser.rst:453 msgid "*defaults*, default value: ``None``" msgstr "" -#: ../../library/configparser.rst:454 +#: ../../library/configparser.rst:455 msgid "" "This option accepts a dictionary of key-value pairs which will be initially " "put in the ``DEFAULT`` section. This makes for an elegant way to support " @@ -364,17 +365,17 @@ msgid "" "the documented default." msgstr "" -#: ../../library/configparser.rst:459 +#: ../../library/configparser.rst:460 msgid "" "Hint: if you want to specify default values for a specific section, use :" "meth:`read_dict` before you read the actual file." msgstr "" -#: ../../library/configparser.rst:462 +#: ../../library/configparser.rst:463 msgid "*dict_type*, default value: :class:`dict`" msgstr "" -#: ../../library/configparser.rst:464 +#: ../../library/configparser.rst:465 msgid "" "This option has a major impact on how the mapping protocol will behave and " "how the written configuration files look. With the standard dictionary, " @@ -382,24 +383,24 @@ msgid "" "goes for options within sections." msgstr "" -#: ../../library/configparser.rst:469 +#: ../../library/configparser.rst:470 msgid "" "An alternative dictionary type can be used for example to sort sections and " "options on write-back." msgstr "" -#: ../../library/configparser.rst:472 +#: ../../library/configparser.rst:473 msgid "" "Please note: there are ways to add a set of key-value pairs in a single " "operation. When you use a regular dictionary in those operations, the order " "of the keys will be ordered. For example:" msgstr "" -#: ../../library/configparser.rst:494 +#: ../../library/configparser.rst:495 msgid "*allow_no_value*, default value: ``False``" msgstr "" -#: ../../library/configparser.rst:496 +#: ../../library/configparser.rst:497 msgid "" "Some configuration files are known to include settings without values, but " "which otherwise conform to the syntax supported by :mod:`configparser`. The " @@ -407,32 +408,32 @@ msgid "" "such values should be accepted:" msgstr "" -#: ../../library/configparser.rst:531 +#: ../../library/configparser.rst:532 msgid "*delimiters*, default value: ``('=', ':')``" msgstr "" -#: ../../library/configparser.rst:533 +#: ../../library/configparser.rst:534 msgid "" "Delimiters are substrings that delimit keys from values within a section. " "The first occurrence of a delimiting substring on a line is considered a " "delimiter. This means values (but not keys) can contain the delimiters." msgstr "" -#: ../../library/configparser.rst:537 +#: ../../library/configparser.rst:538 msgid "" "See also the *space_around_delimiters* argument to :meth:`ConfigParser." "write`." msgstr "" -#: ../../library/configparser.rst:540 +#: ../../library/configparser.rst:541 msgid "*comment_prefixes*, default value: ``('#', ';')``" msgstr "" -#: ../../library/configparser.rst:542 +#: ../../library/configparser.rst:543 msgid "*inline_comment_prefixes*, default value: ``None``" msgstr "" -#: ../../library/configparser.rst:544 +#: ../../library/configparser.rst:545 msgid "" "Comment prefixes are strings that indicate the start of a valid comment " "within a config file. *comment_prefixes* are used only on otherwise empty " @@ -442,13 +443,13 @@ msgid "" "used as prefixes for whole line comments." msgstr "" -#: ../../library/configparser.rst:551 +#: ../../library/configparser.rst:552 msgid "" "In previous versions of :mod:`configparser` behaviour matched " "``comment_prefixes=('#',';')`` and ``inline_comment_prefixes=(';',)``." msgstr "" -#: ../../library/configparser.rst:555 +#: ../../library/configparser.rst:556 msgid "" "Please note that config parsers don't support escaping of comment prefixes " "so using *inline_comment_prefixes* may prevent users from specifying option " @@ -458,11 +459,11 @@ msgid "" "values is to interpolate the prefix, for example::" msgstr "" -#: ../../library/configparser.rst:601 +#: ../../library/configparser.rst:602 msgid "*strict*, default value: ``True``" msgstr "" -#: ../../library/configparser.rst:603 +#: ../../library/configparser.rst:604 msgid "" "When set to ``True``, the parser will not allow for any section or option " "duplicates while reading from a single source (using :meth:`read_file`, :" @@ -470,17 +471,17 @@ msgid "" "parsers in new applications." msgstr "" -#: ../../library/configparser.rst:608 +#: ../../library/configparser.rst:609 msgid "" "In previous versions of :mod:`configparser` behaviour matched " "``strict=False``." msgstr "" -#: ../../library/configparser.rst:612 +#: ../../library/configparser.rst:613 msgid "*empty_lines_in_values*, default value: ``True``" msgstr "" -#: ../../library/configparser.rst:614 +#: ../../library/configparser.rst:615 msgid "" "In config parsers, values can span multiple lines as long as they are " "indented more than the key that holds them. By default parsers also let " @@ -490,7 +491,7 @@ msgid "" "lose track of the file structure. Take for instance:" msgstr "" -#: ../../library/configparser.rst:629 +#: ../../library/configparser.rst:630 msgid "" "This can be especially problematic for the user to see if she's using a " "proportional font to edit the file. That is why when your application does " @@ -499,13 +500,13 @@ msgid "" "would produce two keys, ``key`` and ``this``." msgstr "" -#: ../../library/configparser.rst:635 +#: ../../library/configparser.rst:636 msgid "" "*default_section*, default value: ``configparser.DEFAULTSECT`` (that is: ``" "\"DEFAULT\"``)" msgstr "" -#: ../../library/configparser.rst:638 +#: ../../library/configparser.rst:639 msgid "" "The convention of allowing a special section of default values for other " "sections or interpolation purposes is a powerful concept of this library, " @@ -519,11 +520,11 @@ msgid "" "files from one format to another)." msgstr "" -#: ../../library/configparser.rst:649 +#: ../../library/configparser.rst:650 msgid "*interpolation*, default value: ``configparser.BasicInterpolation``" msgstr "" -#: ../../library/configparser.rst:651 +#: ../../library/configparser.rst:652 msgid "" "Interpolation behaviour may be customized by providing a custom handler " "through the *interpolation* argument. ``None`` can be used to turn off " @@ -533,11 +534,11 @@ msgid "" "`RawConfigParser` has a default value of ``None``." msgstr "" -#: ../../library/configparser.rst:658 +#: ../../library/configparser.rst:659 msgid "*converters*, default value: not set" msgstr "" -#: ../../library/configparser.rst:660 +#: ../../library/configparser.rst:661 msgid "" "Config parsers provide option value getters that perform type conversion. " "By default :meth:`~ConfigParser.getint`, :meth:`~ConfigParser.getfloat`, " @@ -551,7 +552,7 @@ msgid "" "``parser_instance['section'].getdecimal('key', 0)``." msgstr "" -#: ../../library/configparser.rst:671 +#: ../../library/configparser.rst:672 msgid "" "If the converter needs to access the state of the parser, it can be " "implemented as a method on a config parser subclass. If the name of this " @@ -559,14 +560,14 @@ msgid "" "the dict-compatible form (see the ``getdecimal()`` example above)." msgstr "" -#: ../../library/configparser.rst:676 +#: ../../library/configparser.rst:677 msgid "" "More advanced customization may be achieved by overriding default values of " "these parser attributes. The defaults are defined on the classes, so they " "may be overridden by subclasses or by attribute assignment." msgstr "" -#: ../../library/configparser.rst:682 +#: ../../library/configparser.rst:683 msgid "" "By default when using :meth:`~ConfigParser.getboolean`, config parsers " "consider the following values ``True``: ``'1'``, ``'yes'``, ``'true'``, " @@ -575,13 +576,13 @@ msgid "" "strings and their Boolean outcomes. For example:" msgstr "" -#: ../../library/configparser.rst:700 +#: ../../library/configparser.rst:701 msgid "" "Other typical Boolean pairs include ``accept``/``reject`` or ``enabled``/" "``disabled``." msgstr "" -#: ../../library/configparser.rst:706 +#: ../../library/configparser.rst:707 msgid "" "This method transforms option names on every read, get, or set operation. " "The default converts the name to lowercase. This also means that when a " @@ -589,14 +590,14 @@ msgid "" "method if that's unsuitable. For example:" msgstr "" -#: ../../library/configparser.rst:736 +#: ../../library/configparser.rst:737 msgid "" "The optionxform function transforms option names to a canonical form. This " "should be an idempotent function: if the name is already in canonical form, " "it should be returned unchanged." msgstr "" -#: ../../library/configparser.rst:743 +#: ../../library/configparser.rst:744 msgid "" "A compiled regular expression used to parse section headers. The default " "matches ``[section]`` to the name ``\"section\"``. Whitespace is considered " @@ -605,18 +606,18 @@ msgid "" "example:" msgstr "" -#: ../../library/configparser.rst:771 +#: ../../library/configparser.rst:772 msgid "" "While ConfigParser objects also use an ``OPTCRE`` attribute for recognizing " "option lines, it's not recommended to override it because that would " "interfere with constructor options *allow_no_value* and *delimiters*." msgstr "" -#: ../../library/configparser.rst:777 +#: ../../library/configparser.rst:778 msgid "Legacy API Examples" msgstr "" -#: ../../library/configparser.rst:779 +#: ../../library/configparser.rst:780 msgid "" "Mainly because of backwards compatibility concerns, :mod:`configparser` " "provides also a legacy API with explicit ``get``/``set`` methods. While " @@ -625,29 +626,29 @@ msgid "" "advanced, low-level and downright counterintuitive." msgstr "" -#: ../../library/configparser.rst:785 +#: ../../library/configparser.rst:786 msgid "An example of writing to a configuration file::" msgstr "" -#: ../../library/configparser.rst:808 +#: ../../library/configparser.rst:809 msgid "An example of reading the configuration file again::" msgstr "" -#: ../../library/configparser.rst:826 +#: ../../library/configparser.rst:827 msgid "To get interpolation, use :class:`ConfigParser`::" msgstr "" -#: ../../library/configparser.rst:859 +#: ../../library/configparser.rst:860 msgid "" "Default values are available in both types of ConfigParsers. They are used " "in interpolation if an option used is not defined elsewhere. ::" msgstr "" -#: ../../library/configparser.rst:877 +#: ../../library/configparser.rst:878 msgid "ConfigParser Objects" msgstr "" -#: ../../library/configparser.rst:881 +#: ../../library/configparser.rst:882 msgid "" "The main configuration parser. When *defaults* is given, it is initialized " "into the dictionary of intrinsic defaults. When *dict_type* is given, it " @@ -655,7 +656,7 @@ msgid "" "the options within a section, and for the default values." msgstr "" -#: ../../library/configparser.rst:886 +#: ../../library/configparser.rst:887 msgid "" "When *delimiters* is given, it is used as the set of substrings that divide " "keys from values. When *comment_prefixes* is given, it will be used as the " @@ -664,7 +665,7 @@ msgid "" "as the set of substrings that prefix comments in non-empty lines." msgstr "" -#: ../../library/configparser.rst:892 +#: ../../library/configparser.rst:893 msgid "" "When *strict* is ``True`` (the default), the parser won't allow for any " "section or option duplicates while reading from a single source (file, " @@ -677,7 +678,7 @@ msgid "" "without the trailing delimiter." msgstr "" -#: ../../library/configparser.rst:902 +#: ../../library/configparser.rst:903 msgid "" "When *default_section* is given, it specifies the name for the special " "section holding default values for other sections and interpolation purposes " @@ -685,7 +686,7 @@ msgid "" "on runtime using the ``default_section`` instance attribute." msgstr "" -#: ../../library/configparser.rst:907 +#: ../../library/configparser.rst:908 msgid "" "Interpolation behaviour may be customized by providing a custom handler " "through the *interpolation* argument. ``None`` can be used to turn off " @@ -694,7 +695,7 @@ msgid "" "`dedicated documentation section <#interpolation-of-values>`_." msgstr "" -#: ../../library/configparser.rst:913 +#: ../../library/configparser.rst:914 msgid "" "All option names used in interpolation will be passed through the :meth:" "`optionxform` method just like any other option name reference. For " @@ -703,7 +704,7 @@ msgid "" "%(BAR)s`` are equivalent." msgstr "" -#: ../../library/configparser.rst:919 +#: ../../library/configparser.rst:920 msgid "" "When *converters* is given, it should be a dictionary where each key " "represents the name of a type converter and each value is a callable " @@ -712,44 +713,44 @@ msgid "" "object and section proxies." msgstr "" -#: ../../library/configparser.rst:925 +#: ../../library/configparser.rst:926 msgid "The default *dict_type* is :class:`collections.OrderedDict`." msgstr "" -#: ../../library/configparser.rst:928 +#: ../../library/configparser.rst:929 msgid "" "*allow_no_value*, *delimiters*, *comment_prefixes*, *strict*, " "*empty_lines_in_values*, *default_section* and *interpolation* were added." msgstr "" -#: ../../library/configparser.rst:933 +#: ../../library/configparser.rst:934 msgid "The *converters* argument was added." msgstr "" -#: ../../library/configparser.rst:936 +#: ../../library/configparser.rst:937 msgid "" "The *defaults* argument is read with :meth:`read_dict()`, providing " "consistent behavior across the parser: non-string keys and values are " "implicitly converted to strings." msgstr "" -#: ../../library/configparser.rst:941 ../../library/configparser.rst:1226 +#: ../../library/configparser.rst:942 ../../library/configparser.rst:1227 msgid "" "The default *dict_type* is :class:`dict`, since it now preserves insertion " "order." msgstr "" -#: ../../library/configparser.rst:947 +#: ../../library/configparser.rst:948 msgid "Return a dictionary containing the instance-wide defaults." msgstr "" -#: ../../library/configparser.rst:952 +#: ../../library/configparser.rst:953 msgid "" "Return a list of the sections available; the *default section* is not " "included in the list." msgstr "" -#: ../../library/configparser.rst:958 +#: ../../library/configparser.rst:959 msgid "" "Add a section named *section* to the instance. If a section by the given " "name already exists, :exc:`DuplicateSectionError` is raised. If the " @@ -757,34 +758,34 @@ msgid "" "the section must be a string; if not, :exc:`TypeError` is raised." msgstr "" -#: ../../library/configparser.rst:963 +#: ../../library/configparser.rst:964 msgid "Non-string section names raise :exc:`TypeError`." msgstr "" -#: ../../library/configparser.rst:969 +#: ../../library/configparser.rst:970 msgid "" "Indicates whether the named *section* is present in the configuration. The " "*default section* is not acknowledged." msgstr "" -#: ../../library/configparser.rst:975 +#: ../../library/configparser.rst:976 msgid "Return a list of options available in the specified *section*." msgstr "" -#: ../../library/configparser.rst:980 +#: ../../library/configparser.rst:981 msgid "" "If the given *section* exists, and contains the given *option*, return :" "const:`True`; otherwise return :const:`False`. If the specified *section* " "is :const:`None` or an empty string, DEFAULT is assumed." msgstr "" -#: ../../library/configparser.rst:987 +#: ../../library/configparser.rst:988 msgid "" "Attempt to read and parse an iterable of filenames, returning a list of " "filenames which were successfully parsed." msgstr "" -#: ../../library/configparser.rst:990 +#: ../../library/configparser.rst:991 msgid "" "If *filenames* is a string, a :class:`bytes` object or a :term:`path-like " "object`, it is treated as a single filename. If a file named in *filenames* " @@ -795,7 +796,7 @@ msgid "" "be read." msgstr "" -#: ../../library/configparser.rst:999 +#: ../../library/configparser.rst:1000 msgid "" "If none of the named files exist, the :class:`ConfigParser` instance will " "contain an empty dataset. An application which requires initial values to " @@ -803,49 +804,49 @@ msgid "" "`read_file` before calling :meth:`read` for any optional files::" msgstr "" -#: ../../library/configparser.rst:1012 +#: ../../library/configparser.rst:1013 msgid "" "The *encoding* parameter. Previously, all files were read using the default " "encoding for :func:`open`." msgstr "" -#: ../../library/configparser.rst:1016 +#: ../../library/configparser.rst:1017 msgid "The *filenames* parameter accepts a :term:`path-like object`." msgstr "" -#: ../../library/configparser.rst:1019 +#: ../../library/configparser.rst:1020 msgid "The *filenames* parameter accepts a :class:`bytes` object." msgstr "" -#: ../../library/configparser.rst:1025 +#: ../../library/configparser.rst:1026 msgid "" "Read and parse configuration data from *f* which must be an iterable " "yielding Unicode strings (for example files opened in text mode)." msgstr "" -#: ../../library/configparser.rst:1028 +#: ../../library/configparser.rst:1029 msgid "" "Optional argument *source* specifies the name of the file being read. If " "not given and *f* has a :attr:`name` attribute, that is used for *source*; " "the default is ``''``." msgstr "" -#: ../../library/configparser.rst:1032 +#: ../../library/configparser.rst:1033 msgid "Replaces :meth:`readfp`." msgstr "" -#: ../../library/configparser.rst:1037 +#: ../../library/configparser.rst:1038 msgid "Parse configuration data from a string." msgstr "" -#: ../../library/configparser.rst:1039 +#: ../../library/configparser.rst:1040 msgid "" "Optional argument *source* specifies a context-specific name of the string " "passed. If not given, ``''`` is used. This should commonly be a " "filesystem path or a URL." msgstr "" -#: ../../library/configparser.rst:1048 +#: ../../library/configparser.rst:1049 msgid "" "Load configuration from any object that provides a dict-like ``items()`` " "method. Keys are section names, values are dictionaries with keys and " @@ -854,17 +855,17 @@ msgid "" "automatically converted to strings." msgstr "" -#: ../../library/configparser.rst:1054 +#: ../../library/configparser.rst:1055 msgid "" "Optional argument *source* specifies a context-specific name of the " "dictionary passed. If not given, ```` is used." msgstr "" -#: ../../library/configparser.rst:1057 +#: ../../library/configparser.rst:1058 msgid "This method can be used to copy state between parsers." msgstr "" -#: ../../library/configparser.rst:1064 +#: ../../library/configparser.rst:1065 msgid "" "Get an *option* value for the named *section*. If *vars* is provided, it " "must be a dictionary. The *option* is looked up in *vars* (if provided), " @@ -873,35 +874,35 @@ msgid "" "provided as a *fallback* value." msgstr "" -#: ../../library/configparser.rst:1070 +#: ../../library/configparser.rst:1071 msgid "" "All the ``'%'`` interpolations are expanded in the return values, unless the " "*raw* argument is true. Values for interpolation keys are looked up in the " "same manner as the option." msgstr "" -#: ../../library/configparser.rst:1074 +#: ../../library/configparser.rst:1075 msgid "" "Arguments *raw*, *vars* and *fallback* are keyword only to protect users " "from trying to use the third argument as the *fallback* fallback (especially " "when using the mapping protocol)." msgstr "" -#: ../../library/configparser.rst:1082 +#: ../../library/configparser.rst:1083 msgid "" "A convenience method which coerces the *option* in the specified *section* " "to an integer. See :meth:`get` for explanation of *raw*, *vars* and " "*fallback*." msgstr "" -#: ../../library/configparser.rst:1089 +#: ../../library/configparser.rst:1090 msgid "" "A convenience method which coerces the *option* in the specified *section* " "to a floating point number. See :meth:`get` for explanation of *raw*, " "*vars* and *fallback*." msgstr "" -#: ../../library/configparser.rst:1096 +#: ../../library/configparser.rst:1097 msgid "" "A convenience method which coerces the *option* in the specified *section* " "to a Boolean value. Note that the accepted values for the option are " @@ -913,34 +914,34 @@ msgid "" "*fallback*." msgstr "" -#: ../../library/configparser.rst:1109 +#: ../../library/configparser.rst:1110 msgid "" "When *section* is not given, return a list of *section_name*, " "*section_proxy* pairs, including DEFAULTSECT." msgstr "" -#: ../../library/configparser.rst:1112 +#: ../../library/configparser.rst:1113 msgid "" "Otherwise, return a list of *name*, *value* pairs for the options in the " "given *section*. Optional arguments have the same meaning as for the :meth:" "`get` method." msgstr "" -#: ../../library/configparser.rst:1116 +#: ../../library/configparser.rst:1117 msgid "" "Items present in *vars* no longer appear in the result. The previous " "behaviour mixed actual parser options with variables provided for " "interpolation." msgstr "" -#: ../../library/configparser.rst:1124 +#: ../../library/configparser.rst:1125 msgid "" "If the given section exists, set the given option to the specified value; " "otherwise raise :exc:`NoSectionError`. *option* and *value* must be " "strings; if not, :exc:`TypeError` is raised." msgstr "" -#: ../../library/configparser.rst:1131 +#: ../../library/configparser.rst:1132 msgid "" "Write a representation of the configuration to the specified :term:`file " "object`, which must be opened in text mode (accepting strings). This " @@ -949,27 +950,27 @@ msgid "" "surrounded by spaces." msgstr "" -#: ../../library/configparser.rst:1139 +#: ../../library/configparser.rst:1140 msgid "" "Comments in the original configuration file are not preserved when writing " "the configuration back. What is considered a comment, depends on the given " "values for *comment_prefix* and *inline_comment_prefix*." msgstr "" -#: ../../library/configparser.rst:1147 +#: ../../library/configparser.rst:1148 msgid "" "Remove the specified *option* from the specified *section*. If the section " "does not exist, raise :exc:`NoSectionError`. If the option existed to be " "removed, return :const:`True`; otherwise return :const:`False`." msgstr "" -#: ../../library/configparser.rst:1155 +#: ../../library/configparser.rst:1156 msgid "" "Remove the specified *section* from the configuration. If the section in " "fact existed, return ``True``. Otherwise return ``False``." msgstr "" -#: ../../library/configparser.rst:1161 +#: ../../library/configparser.rst:1162 msgid "" "Transforms the option name *option* as found in an input file or as passed " "in by client code to the form that should be used in the internal " @@ -978,7 +979,7 @@ msgid "" "of this name on instances to affect this behavior." msgstr "" -#: ../../library/configparser.rst:1167 +#: ../../library/configparser.rst:1168 msgid "" "You don't need to subclass the parser to use this method, you can also set " "it on an instance, to a function that takes a string argument and returns a " @@ -986,46 +987,46 @@ msgid "" "sensitive::" msgstr "" -#: ../../library/configparser.rst:1175 +#: ../../library/configparser.rst:1176 msgid "" "Note that when reading configuration files, whitespace around the option " "names is stripped before :meth:`optionxform` is called." msgstr "" -#: ../../library/configparser.rst:1181 +#: ../../library/configparser.rst:1182 msgid "Use :meth:`read_file` instead." msgstr "" -#: ../../library/configparser.rst:1184 +#: ../../library/configparser.rst:1185 msgid "" ":meth:`readfp` now iterates on *fp* instead of calling ``fp.readline()``." msgstr "" -#: ../../library/configparser.rst:1187 +#: ../../library/configparser.rst:1188 msgid "" "For existing code calling :meth:`readfp` with arguments which don't support " "iteration, the following generator may be used as a wrapper around the file-" "like object::" msgstr "" -#: ../../library/configparser.rst:1197 +#: ../../library/configparser.rst:1198 msgid "" "Instead of ``parser.readfp(fp)`` use ``parser." "read_file(readline_generator(fp))``." msgstr "" -#: ../../library/configparser.rst:1203 +#: ../../library/configparser.rst:1204 msgid "" "The maximum depth for recursive interpolation for :meth:`get` when the *raw* " "parameter is false. This is relevant only when the default *interpolation* " "is used." msgstr "" -#: ../../library/configparser.rst:1211 +#: ../../library/configparser.rst:1212 msgid "RawConfigParser Objects" msgstr "" -#: ../../library/configparser.rst:1221 +#: ../../library/configparser.rst:1222 msgid "" "Legacy variant of the :class:`ConfigParser`. It has interpolation disabled " "by default and allows for non-string section names, option names, and values " @@ -1033,27 +1034,27 @@ msgid "" "``defaults=`` keyword argument handling." msgstr "" -#: ../../library/configparser.rst:1231 +#: ../../library/configparser.rst:1232 msgid "" "Consider using :class:`ConfigParser` instead which checks types of the " "values to be stored internally. If you don't want interpolation, you can " "use ``ConfigParser(interpolation=None)``." msgstr "" -#: ../../library/configparser.rst:1238 +#: ../../library/configparser.rst:1239 msgid "" "Add a section named *section* to the instance. If a section by the given " "name already exists, :exc:`DuplicateSectionError` is raised. If the " "*default section* name is passed, :exc:`ValueError` is raised." msgstr "" -#: ../../library/configparser.rst:1242 +#: ../../library/configparser.rst:1243 msgid "" "Type of *section* is not checked which lets users create non-string named " "sections. This behaviour is unsupported and may cause internal errors." msgstr "" -#: ../../library/configparser.rst:1248 +#: ../../library/configparser.rst:1249 msgid "" "If the given section exists, set the given option to the specified value; " "otherwise raise :exc:`NoSectionError`. While it is possible to use :class:" @@ -1063,7 +1064,7 @@ msgid "" "string values." msgstr "" -#: ../../library/configparser.rst:1255 +#: ../../library/configparser.rst:1256 msgid "" "This method lets users assign non-string values to keys internally. This " "behaviour is unsupported and will cause errors when attempting to write to a " @@ -1071,32 +1072,32 @@ msgid "" "not allow such assignments to take place." msgstr "" -#: ../../library/configparser.rst:1262 +#: ../../library/configparser.rst:1263 msgid "Exceptions" msgstr "" -#: ../../library/configparser.rst:1266 +#: ../../library/configparser.rst:1267 msgid "Base class for all other :mod:`configparser` exceptions." msgstr "" -#: ../../library/configparser.rst:1271 +#: ../../library/configparser.rst:1272 msgid "Exception raised when a specified section is not found." msgstr "" -#: ../../library/configparser.rst:1276 +#: ../../library/configparser.rst:1277 msgid "" "Exception raised if :meth:`add_section` is called with the name of a section " "that is already present or in strict parsers when a section if found more " "than once in a single input file, string or dictionary." msgstr "" -#: ../../library/configparser.rst:1280 +#: ../../library/configparser.rst:1281 msgid "" "Optional ``source`` and ``lineno`` attributes and arguments to :meth:" "`__init__` were added." msgstr "" -#: ../../library/configparser.rst:1287 +#: ../../library/configparser.rst:1288 msgid "" "Exception raised by strict parsers if a single option appears twice during " "reading from a single file, string or dictionary. This catches misspellings " @@ -1104,58 +1105,58 @@ msgid "" "representing the same case-insensitive configuration key." msgstr "" -#: ../../library/configparser.rst:1295 +#: ../../library/configparser.rst:1296 msgid "" "Exception raised when a specified option is not found in the specified " "section." msgstr "" -#: ../../library/configparser.rst:1301 +#: ../../library/configparser.rst:1302 msgid "" "Base class for exceptions raised when problems occur performing string " "interpolation." msgstr "" -#: ../../library/configparser.rst:1307 +#: ../../library/configparser.rst:1308 msgid "" "Exception raised when string interpolation cannot be completed because the " "number of iterations exceeds :const:`MAX_INTERPOLATION_DEPTH`. Subclass of :" "exc:`InterpolationError`." msgstr "" -#: ../../library/configparser.rst:1314 +#: ../../library/configparser.rst:1315 msgid "" "Exception raised when an option referenced from a value does not exist. " "Subclass of :exc:`InterpolationError`." msgstr "" -#: ../../library/configparser.rst:1320 +#: ../../library/configparser.rst:1321 msgid "" "Exception raised when the source text into which substitutions are made does " "not conform to the required syntax. Subclass of :exc:`InterpolationError`." msgstr "" -#: ../../library/configparser.rst:1326 +#: ../../library/configparser.rst:1327 msgid "" "Exception raised when attempting to parse a file which has no section " "headers." msgstr "" -#: ../../library/configparser.rst:1332 +#: ../../library/configparser.rst:1333 msgid "Exception raised when errors occur attempting to parse a file." msgstr "" -#: ../../library/configparser.rst:1334 +#: ../../library/configparser.rst:1335 msgid "" "The ``filename`` attribute and :meth:`__init__` argument were renamed to " "``source`` for consistency." msgstr "" -#: ../../library/configparser.rst:1340 +#: ../../library/configparser.rst:1341 msgid "Footnotes" msgstr "註解" -#: ../../library/configparser.rst:1341 +#: ../../library/configparser.rst:1342 msgid "" "Config parsers allow for heavy customization. If you are interested in " "changing the behaviour outlined by the footnote reference, consult the " diff --git a/library/ctypes.po b/library/ctypes.po index 2beb80ecfd..fbb836c00a 100644 --- a/library/ctypes.po +++ b/library/ctypes.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-13 00:11+0000\n" +"POT-Creation-Date: 2021-09-24 00:11+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-" @@ -37,7 +37,7 @@ msgstr "" msgid "" "Note: The code samples in this tutorial use :mod:`doctest` to make sure that " "they actually work. Since some code samples behave differently under Linux, " -"Windows, or Mac OS X, they contain doctest directives in comments." +"Windows, or macOS, they contain doctest directives in comments." msgstr "" #: ../../library/ctypes.rst:25 @@ -1209,7 +1209,7 @@ msgstr "" #: ../../library/ctypes.rst:1291 msgid "" -"On OS X, :func:`find_library` tries several predefined naming schemes and " +"On macOS, :func:`find_library` tries several predefined naming schemes and " "paths to locate the library, and returns a full pathname if successful::" msgstr "" diff --git a/library/functions.po b/library/functions.po index e633106ad3..fbe892253d 100644 --- a/library/functions.po +++ b/library/functions.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-13 00:11+0000\n" +"POT-Creation-Date: 2021-10-07 00:10+0000\n" "PO-Revision-Date: 2018-11-10 18:27+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -2243,8 +2243,8 @@ msgid "" "coercion rules for binary arithmetic operators apply. For :class:`int` " "operands, the result has the same type as the operands (after coercion) " "unless the second argument is negative; in that case, all arguments are " -"converted to float and a float result is delivered. For example, ``10**2`` " -"returns ``100``, but ``10**-2`` returns ``0.01``." +"converted to float and a float result is delivered. For example, ``pow(10, " +"2)`` returns ``100``, but ``pow(10, -2)`` returns ``0.01``." msgstr "" #: ../../library/functions.rst:1304 @@ -2456,49 +2456,48 @@ msgid "" "with two leading underscores) name in order to set it with :func:`setattr`." msgstr "" -#: ../../library/functions.rst:1518 +#: ../../library/functions.rst:1516 msgid "" "Return a :term:`slice` object representing the set of indices specified by " "``range(start, stop, step)``. The *start* and *step* arguments default to " "``None``. Slice objects have read-only data attributes :attr:`~slice." "start`, :attr:`~slice.stop` and :attr:`~slice.step` which merely return the " "argument values (or their default). They have no other explicit " -"functionality; however they are used by Numerical Python and other third " -"party extensions. Slice objects are also generated when extended indexing " -"syntax is used. For example: ``a[start:stop:step]`` or ``a[start:stop, " -"i]``. See :func:`itertools.islice` for an alternate version that returns an " -"iterator." +"functionality; however they are used by NumPy and other third party " +"packages. Slice objects are also generated when extended indexing syntax is " +"used. For example: ``a[start:stop:step]`` or ``a[start:stop, i]``. See :" +"func:`itertools.islice` for an alternate version that returns an iterator." msgstr "" -#: ../../library/functions.rst:1531 +#: ../../library/functions.rst:1529 msgid "Return a new sorted list from the items in *iterable*." msgstr "" -#: ../../library/functions.rst:1533 +#: ../../library/functions.rst:1531 msgid "" "Has two optional arguments which must be specified as keyword arguments." msgstr "有兩個選擇性參數,只能使用關鍵字參數指定。" -#: ../../library/functions.rst:1535 +#: ../../library/functions.rst:1533 msgid "" "*key* specifies a function of one argument that is used to extract a " "comparison key from each element in *iterable* (for example, ``key=str." "lower``). The default value is ``None`` (compare the elements directly)." msgstr "" -#: ../../library/functions.rst:1539 +#: ../../library/functions.rst:1537 msgid "" "*reverse* is a boolean value. If set to ``True``, then the list elements " "are sorted as if each comparison were reversed." msgstr "" -#: ../../library/functions.rst:1542 +#: ../../library/functions.rst:1540 msgid "" "Use :func:`functools.cmp_to_key` to convert an old-style *cmp* function to a " "*key* function." msgstr "" -#: ../../library/functions.rst:1545 +#: ../../library/functions.rst:1543 msgid "" "The built-in :func:`sorted` function is guaranteed to be stable. A sort is " "stable if it guarantees not to change the relative order of elements that " @@ -2506,22 +2505,34 @@ msgid "" "example, sort by department, then by salary grade)." msgstr "" -#: ../../library/functions.rst:1550 +#: ../../library/functions.rst:1548 +msgid "" +"The sort algorithm uses only ``<`` comparisons between items. While " +"defining an :meth:`~object.__lt__` method will suffice for sorting, :PEP:`8` " +"recommends that all six :ref:`rich comparisons ` be " +"implemented. This will help avoid bugs when using the same data with other " +"ordering tools such as :func:`max` that rely on a different underlying " +"method. Implementing all six comparisons also helps avoid confusion for " +"mixed type comparisons which can call reflected the :meth:`~object.__gt__` " +"method." +msgstr "" + +#: ../../library/functions.rst:1557 msgid "" "For sorting examples and a brief sorting tutorial, see :ref:`sortinghowto`." msgstr "" -#: ../../library/functions.rst:1554 +#: ../../library/functions.rst:1561 msgid "Transform a method into a static method." msgstr "" -#: ../../library/functions.rst:1556 +#: ../../library/functions.rst:1563 msgid "" "A static method does not receive an implicit first argument. To declare a " "static method, use this idiom::" msgstr "" -#: ../../library/functions.rst:1563 +#: ../../library/functions.rst:1570 #, fuzzy msgid "" "The ``@staticmethod`` form is a function :term:`decorator` -- see :ref:" @@ -2530,20 +2541,20 @@ msgstr "" "``@classmethod`` 形式是一個函式 :term:`decorator` - 參見 :ref:`function` 中關" "於函式定義的詳細介紹。" -#: ../../library/functions.rst:1566 +#: ../../library/functions.rst:1573 msgid "" "A static method can be called either on the class (such as ``C.f()``) or on " "an instance (such as ``C().f()``)." msgstr "" -#: ../../library/functions.rst:1569 +#: ../../library/functions.rst:1576 msgid "" "Static methods in Python are similar to those found in Java or C++. Also " "see :func:`classmethod` for a variant that is useful for creating alternate " "class constructors." msgstr "" -#: ../../library/functions.rst:1573 +#: ../../library/functions.rst:1580 msgid "" "Like all decorators, it is also possible to call ``staticmethod`` as a " "regular function and do something with its result. This is needed in some " @@ -2552,30 +2563,30 @@ msgid "" "cases, use this idiom::" msgstr "" -#: ../../library/functions.rst:1582 +#: ../../library/functions.rst:1589 #, fuzzy msgid "For more information on static methods, see :ref:`types`." msgstr "關於類方法的更多資訊,請參考文件 :ref:`types` 中的標準型別的層次。" -#: ../../library/functions.rst:1593 +#: ../../library/functions.rst:1600 msgid "" "Return a :class:`str` version of *object*. See :func:`str` for details." msgstr "" -#: ../../library/functions.rst:1595 +#: ../../library/functions.rst:1602 msgid "" "``str`` is the built-in string :term:`class`. For general information about " "strings, see :ref:`textseq`." msgstr "" -#: ../../library/functions.rst:1601 +#: ../../library/functions.rst:1608 msgid "" "Sums *start* and the items of an *iterable* from left to right and returns " "the total. The *iterable*'s items are normally numbers, and the start value " "is not allowed to be a string." msgstr "" -#: ../../library/functions.rst:1605 +#: ../../library/functions.rst:1612 msgid "" "For some use cases, there are good alternatives to :func:`sum`. The " "preferred, fast way to concatenate a sequence of strings is by calling ``''." @@ -2584,32 +2595,32 @@ msgid "" "using :func:`itertools.chain`." msgstr "" -#: ../../library/functions.rst:1611 +#: ../../library/functions.rst:1618 #, fuzzy msgid "The *start* parameter can be specified as a keyword argument." msgstr "有兩個選擇性參數,只能使用關鍵字參數指定。" -#: ../../library/functions.rst:1616 +#: ../../library/functions.rst:1623 msgid "" "Return a proxy object that delegates method calls to a parent or sibling " "class of *type*. This is useful for accessing inherited methods that have " "been overridden in a class." msgstr "" -#: ../../library/functions.rst:1620 +#: ../../library/functions.rst:1627 msgid "" "The *object-or-type* determines the :term:`method resolution order` to be " "searched. The search starts from the class right after the *type*." msgstr "" -#: ../../library/functions.rst:1624 +#: ../../library/functions.rst:1631 msgid "" "For example, if :attr:`~class.__mro__` of *object-or-type* is ``D -> B -> C -" "> A -> object`` and the value of *type* is ``B``, then :func:`super` " "searches ``C -> A -> object``." msgstr "" -#: ../../library/functions.rst:1628 +#: ../../library/functions.rst:1635 msgid "" "The :attr:`~class.__mro__` attribute of the *object-or-type* lists the " "method resolution search order used by both :func:`getattr` and :func:" @@ -2617,7 +2628,7 @@ msgid "" "hierarchy is updated." msgstr "" -#: ../../library/functions.rst:1633 +#: ../../library/functions.rst:1640 msgid "" "If the second argument is omitted, the super object returned is unbound. If " "the second argument is an object, ``isinstance(obj, type)`` must be true. " @@ -2625,7 +2636,7 @@ msgid "" "(this is useful for classmethods)." msgstr "" -#: ../../library/functions.rst:1638 +#: ../../library/functions.rst:1645 msgid "" "There are two typical use cases for *super*. In a class hierarchy with " "single inheritance, *super* can be used to refer to parent classes without " @@ -2633,7 +2644,7 @@ msgid "" "closely parallels the use of *super* in other programming languages." msgstr "" -#: ../../library/functions.rst:1643 +#: ../../library/functions.rst:1650 msgid "" "The second use case is to support cooperative multiple inheritance in a " "dynamic execution environment. This use case is unique to Python and is not " @@ -2646,18 +2657,18 @@ msgid "" "classes that are unknown prior to runtime)." msgstr "" -#: ../../library/functions.rst:1653 +#: ../../library/functions.rst:1660 msgid "For both use cases, a typical superclass call looks like this::" msgstr "" -#: ../../library/functions.rst:1660 +#: ../../library/functions.rst:1667 msgid "" "In addition to method lookups, :func:`super` also works for attribute " "lookups. One possible use case for this is calling :term:`descriptors " "` in a parent or sibling class." msgstr "" -#: ../../library/functions.rst:1664 +#: ../../library/functions.rst:1671 msgid "" "Note that :func:`super` is implemented as part of the binding process for " "explicit dotted attribute lookups such as ``super().__getitem__(name)``. It " @@ -2667,7 +2678,7 @@ msgid "" "using statements or operators such as ``super()[name]``." msgstr "" -#: ../../library/functions.rst:1671 +#: ../../library/functions.rst:1678 msgid "" "Also note that, aside from the zero argument form, :func:`super` is not " "limited to use inside methods. The two argument form specifies the " @@ -2677,33 +2688,33 @@ msgid "" "accessing the current instance for ordinary methods." msgstr "" -#: ../../library/functions.rst:1678 +#: ../../library/functions.rst:1685 msgid "" "For practical suggestions on how to design cooperative classes using :func:" "`super`, see `guide to using super() `_." msgstr "" -#: ../../library/functions.rst:1687 +#: ../../library/functions.rst:1694 msgid "" "Rather than being a function, :class:`tuple` is actually an immutable " "sequence type, as documented in :ref:`typesseq-tuple` and :ref:`typesseq`." msgstr "" -#: ../../library/functions.rst:1696 +#: ../../library/functions.rst:1703 msgid "" "With one argument, return the type of an *object*. The return value is a " "type object and generally the same object as returned by :attr:`object." "__class__ `." msgstr "" -#: ../../library/functions.rst:1700 +#: ../../library/functions.rst:1707 msgid "" "The :func:`isinstance` built-in function is recommended for testing the type " "of an object, because it takes subclasses into account." msgstr "" -#: ../../library/functions.rst:1704 +#: ../../library/functions.rst:1711 msgid "" "With three arguments, return a new type object. This is essentially a " "dynamic form of the :keyword:`class` statement. The *name* string is the " @@ -2716,11 +2727,11 @@ msgid "" "identical :class:`type` objects:" msgstr "" -#: ../../library/functions.rst:1719 +#: ../../library/functions.rst:1726 msgid "See also :ref:`bltin-type-objects`." msgstr "" -#: ../../library/functions.rst:1721 +#: ../../library/functions.rst:1728 msgid "" "Keyword arguments provided to the three argument form are passed to the " "appropriate metaclass machinery (usually :meth:`~object.__init_subclass__`) " @@ -2728,24 +2739,24 @@ msgid "" "would." msgstr "" -#: ../../library/functions.rst:1726 +#: ../../library/functions.rst:1733 #, fuzzy msgid "See also :ref:`class-customization`." msgstr "另請參閱 :ref:`typeiter`。" -#: ../../library/functions.rst:1728 +#: ../../library/functions.rst:1735 msgid "" "Subclasses of :class:`type` which don't override ``type.__new__`` may no " "longer use the one-argument form to get the type of an object." msgstr "" -#: ../../library/functions.rst:1734 +#: ../../library/functions.rst:1741 msgid "" "Return the :attr:`~object.__dict__` attribute for a module, class, instance, " "or any other object with a :attr:`~object.__dict__` attribute." msgstr "" -#: ../../library/functions.rst:1737 +#: ../../library/functions.rst:1744 msgid "" "Objects such as modules and instances have an updateable :attr:`~object." "__dict__` attribute; however, other objects may have write restrictions on " @@ -2753,25 +2764,25 @@ msgid "" "`types.MappingProxyType` to prevent direct dictionary updates)." msgstr "" -#: ../../library/functions.rst:1742 +#: ../../library/functions.rst:1749 msgid "" "Without an argument, :func:`vars` acts like :func:`locals`. Note, the " "locals dictionary is only useful for reads since updates to the locals " "dictionary are ignored." msgstr "" -#: ../../library/functions.rst:1746 +#: ../../library/functions.rst:1753 msgid "" "A :exc:`TypeError` exception is raised if an object is specified but it " "doesn't have a :attr:`~object.__dict__` attribute (for example, if its class " "defines the :attr:`~object.__slots__` attribute)." msgstr "" -#: ../../library/functions.rst:1752 +#: ../../library/functions.rst:1759 msgid "Make an iterator that aggregates elements from each of the iterables." msgstr "" -#: ../../library/functions.rst:1754 +#: ../../library/functions.rst:1761 msgid "" "Returns an iterator of tuples, where the *i*-th tuple contains the *i*-th " "element from each of the argument sequences or iterables. The iterator " @@ -2780,7 +2791,7 @@ msgid "" "an empty iterator. Equivalent to::" msgstr "" -#: ../../library/functions.rst:1773 +#: ../../library/functions.rst:1780 msgid "" "The left-to-right evaluation order of the iterables is guaranteed. This " "makes possible an idiom for clustering a data series into n-length groups " @@ -2789,26 +2800,26 @@ msgid "" "This has the effect of dividing the input into n-length chunks." msgstr "" -#: ../../library/functions.rst:1779 +#: ../../library/functions.rst:1786 msgid "" ":func:`zip` should only be used with unequal length inputs when you don't " "care about trailing, unmatched values from the longer iterables. If those " "values are important, use :func:`itertools.zip_longest` instead." msgstr "" -#: ../../library/functions.rst:1783 +#: ../../library/functions.rst:1790 msgid "" ":func:`zip` in conjunction with the ``*`` operator can be used to unzip a " "list::" msgstr "" -#: ../../library/functions.rst:1804 +#: ../../library/functions.rst:1811 msgid "" "This is an advanced function that is not needed in everyday Python " "programming, unlike :func:`importlib.import_module`." msgstr "" -#: ../../library/functions.rst:1807 +#: ../../library/functions.rst:1814 msgid "" "This function is invoked by the :keyword:`import` statement. It can be " "replaced (by importing the :mod:`builtins` module and assigning to " @@ -2820,7 +2831,7 @@ msgid "" "discouraged in favor of :func:`importlib.import_module`." msgstr "" -#: ../../library/functions.rst:1816 +#: ../../library/functions.rst:1823 msgid "" "The function imports the module *name*, potentially using the given " "*globals* and *locals* to determine how to interpret the name in a package " @@ -2830,7 +2841,7 @@ msgid "" "determine the package context of the :keyword:`import` statement." msgstr "" -#: ../../library/functions.rst:1823 +#: ../../library/functions.rst:1830 msgid "" "*level* specifies whether to use absolute or relative imports. ``0`` (the " "default) means only perform absolute imports. Positive values for *level* " @@ -2839,7 +2850,7 @@ msgid "" "details)." msgstr "" -#: ../../library/functions.rst:1829 +#: ../../library/functions.rst:1836 msgid "" "When the *name* variable is of the form ``package.module``, normally, the " "top-level package (the name up till the first dot) is returned, *not* the " @@ -2847,58 +2858,58 @@ msgid "" "given, the module named by *name* is returned." msgstr "" -#: ../../library/functions.rst:1834 +#: ../../library/functions.rst:1841 msgid "" "For example, the statement ``import spam`` results in bytecode resembling " "the following code::" msgstr "" -#: ../../library/functions.rst:1839 +#: ../../library/functions.rst:1846 msgid "The statement ``import spam.ham`` results in this call::" msgstr "" -#: ../../library/functions.rst:1843 +#: ../../library/functions.rst:1850 msgid "" "Note how :func:`__import__` returns the toplevel module here because this is " "the object that is bound to a name by the :keyword:`import` statement." msgstr "" -#: ../../library/functions.rst:1846 +#: ../../library/functions.rst:1853 msgid "" "On the other hand, the statement ``from spam.ham import eggs, sausage as " "saus`` results in ::" msgstr "" -#: ../../library/functions.rst:1853 +#: ../../library/functions.rst:1860 msgid "" "Here, the ``spam.ham`` module is returned from :func:`__import__`. From " "this object, the names to import are retrieved and assigned to their " "respective names." msgstr "" -#: ../../library/functions.rst:1857 +#: ../../library/functions.rst:1864 msgid "" "If you simply want to import a module (potentially within a package) by " "name, use :func:`importlib.import_module`." msgstr "" -#: ../../library/functions.rst:1860 +#: ../../library/functions.rst:1867 msgid "" "Negative values for *level* are no longer supported (which also changes the " "default value to 0)." msgstr "" -#: ../../library/functions.rst:1864 +#: ../../library/functions.rst:1871 msgid "" "When the command line options :option:`-E` or :option:`-I` are being used, " "the environment variable :envvar:`PYTHONCASEOK` is now ignored." msgstr "" -#: ../../library/functions.rst:1869 +#: ../../library/functions.rst:1876 msgid "Footnotes" msgstr "註解" -#: ../../library/functions.rst:1870 +#: ../../library/functions.rst:1877 #, fuzzy msgid "" "Note that the parser only accepts the Unix-style end of line convention. If " diff --git a/library/hashlib.po b/library/hashlib.po index 512e359afd..64c7992fd6 100644 --- a/library/hashlib.po +++ b/library/hashlib.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-13 00:11+0000\n" +"POT-Creation-Date: 2021-09-29 00:11+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-" @@ -471,14 +471,14 @@ msgstr "" #: ../../library/hashlib.rst:375 msgid "" -"*leaf_size*: maximal byte length of leaf (0 to 2**32-1, 0 if unlimited or in " -"sequential mode)." +"*leaf_size*: maximal byte length of leaf (0 to ``2**32-1``, 0 if unlimited " +"or in sequential mode)." msgstr "" #: ../../library/hashlib.rst:378 msgid "" -"*node_offset*: node offset (0 to 2**64-1 for BLAKE2b, 0 to 2**48-1 for " -"BLAKE2s, 0 for the first, leftmost, leaf, or in sequential mode)." +"*node_offset*: node offset (0 to ``2**64-1`` for BLAKE2b, 0 to ``2**48-1`` " +"for BLAKE2s, 0 for the first, leftmost, leaf, or in sequential mode)." msgstr "" #: ../../library/hashlib.rst:381 diff --git a/library/intro.po b/library/intro.po index ad1bb7074d..532eebbbae 100644 --- a/library/intro.po +++ b/library/intro.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-10-19 17:24+0800\n" +"POT-Creation-Date: 2021-09-24 00:11+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-" @@ -100,5 +100,5 @@ msgstr "" #: ../../library/intro.rst:60 msgid "" "If not separately noted, all functions that claim \"Availability: Unix\" are " -"supported on Mac OS X, which builds on a Unix core." +"supported on macOS, which builds on a Unix core." msgstr "" diff --git a/library/ipaddress.po b/library/ipaddress.po index e87e31f0f5..735c7bb159 100644 --- a/library/ipaddress.po +++ b/library/ipaddress.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-13 00:11+0000\n" +"POT-Creation-Date: 2021-09-29 00:11+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-" @@ -61,9 +61,9 @@ msgstr "" msgid "" "Return an :class:`IPv4Address` or :class:`IPv6Address` object depending on " "the IP address passed as argument. Either IPv4 or IPv6 addresses may be " -"supplied; integers less than 2**32 will be considered to be IPv4 by default. " -"A :exc:`ValueError` is raised if *address* does not represent a valid IPv4 " -"or IPv6 address." +"supplied; integers less than ``2**32`` will be considered to be IPv4 by " +"default. A :exc:`ValueError` is raised if *address* does not represent a " +"valid IPv4 or IPv6 address." msgstr "" #: ../../library/ipaddress.rst:56 @@ -71,10 +71,10 @@ msgid "" "Return an :class:`IPv4Network` or :class:`IPv6Network` object depending on " "the IP address passed as argument. *address* is a string or integer " "representing the IP network. Either IPv4 or IPv6 networks may be supplied; " -"integers less than 2**32 will be considered to be IPv4 by default. *strict* " -"is passed to :class:`IPv4Network` or :class:`IPv6Network` constructor. A :" -"exc:`ValueError` is raised if *address* does not represent a valid IPv4 or " -"IPv6 address, or if the network has host bits set." +"integers less than ``2**32`` will be considered to be IPv4 by default. " +"*strict* is passed to :class:`IPv4Network` or :class:`IPv6Network` " +"constructor. A :exc:`ValueError` is raised if *address* does not represent " +"a valid IPv4 or IPv6 address, or if the network has host bits set." msgstr "" #: ../../library/ipaddress.rst:70 @@ -82,9 +82,9 @@ msgid "" "Return an :class:`IPv4Interface` or :class:`IPv6Interface` object depending " "on the IP address passed as argument. *address* is a string or integer " "representing the IP address. Either IPv4 or IPv6 addresses may be supplied; " -"integers less than 2**32 will be considered to be IPv4 by default. A :exc:" -"`ValueError` is raised if *address* does not represent a valid IPv4 or IPv6 " -"address." +"integers less than ``2**32`` will be considered to be IPv4 by default. A :" +"exc:`ValueError` is raised if *address* does not represent a valid IPv4 or " +"IPv6 address." msgstr "" #: ../../library/ipaddress.rst:77 diff --git a/library/logging.config.po b/library/logging.config.po index 1ec8d849b6..87c72391b0 100644 --- a/library/logging.config.po +++ b/library/logging.config.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-13 00:11+0000\n" +"POT-Creation-Date: 2021-09-23 00:12+0000\n" "PO-Revision-Date: 2018-05-23 16:05+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -232,7 +232,7 @@ msgid "" "to the victim's :func:`listen` socket and sending a configuration which runs " "whatever code the attacker wants to have executed in the victim's process. " "This is especially easy to do if the default port is used, but not hard even " -"if a different port is used). To avoid the risk of this happening, use the " +"if a different port is used. To avoid the risk of this happening, use the " "``verify`` argument to :func:`listen` to prevent unrecognised configurations " "from being applied." msgstr "" diff --git a/library/logging.po b/library/logging.po index c691c38162..cd57fcd1e7 100644 --- a/library/logging.po +++ b/library/logging.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-13 00:11+0000\n" +"POT-Creation-Date: 2021-09-24 00:11+0000\n" "PO-Revision-Date: 2018-05-23 16:05+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1953,7 +1953,7 @@ msgstr "" #: ../../library/logging.rst:1354 msgid "" -"`Original Python logging package `_" msgstr "" diff --git a/library/mmap.po b/library/mmap.po index 96d708d287..7c23cae1ca 100644 --- a/library/mmap.po +++ b/library/mmap.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-13 00:11+0000\n" +"POT-Creation-Date: 2021-09-24 00:11+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-" @@ -159,7 +159,7 @@ msgstr "" msgid "" "To ensure validity of the created memory mapping the file specified by the " "descriptor *fileno* is internally automatically synchronized with physical " -"backing store on Mac OS X and OpenVMS." +"backing store on macOS and OpenVMS." msgstr "" #: ../../library/mmap.rst:105 diff --git a/library/multiprocessing.po b/library/multiprocessing.po index 027af8f94e..5a723f0271 100644 --- a/library/multiprocessing.po +++ b/library/multiprocessing.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-13 00:11+0000\n" +"POT-Creation-Date: 2021-09-24 00:11+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-" @@ -144,7 +144,7 @@ msgid "" "pipes." msgstr "" -#: ../../library/multiprocessing.rst:130 +#: ../../library/multiprocessing.rst:130 ../../library/multiprocessing.rst:1037 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 " @@ -805,7 +805,7 @@ msgstr "" #: ../../library/multiprocessing.rst:785 msgid "" "Note that this may raise :exc:`NotImplementedError` on Unix platforms like " -"Mac OS X where ``sem_getvalue()`` is not implemented." +"macOS where ``sem_getvalue()`` is not implemented." msgstr "" #: ../../library/multiprocessing.rst:790 @@ -1009,49 +1009,51 @@ msgid "" msgstr "" #: ../../library/multiprocessing.rst:954 -msgid "May raise :exc:`NotImplementedError`." +msgid "" +"When the number of CPUs cannot be determined a :exc:`NotImplementedError` is " +"raised." msgstr "" -#: ../../library/multiprocessing.rst:957 +#: ../../library/multiprocessing.rst:958 msgid ":func:`os.cpu_count`" msgstr "" -#: ../../library/multiprocessing.rst:961 +#: ../../library/multiprocessing.rst:962 msgid "" "Return the :class:`Process` object corresponding to the current process." msgstr "" -#: ../../library/multiprocessing.rst:963 +#: ../../library/multiprocessing.rst:964 msgid "An analogue of :func:`threading.current_thread`." msgstr "" -#: ../../library/multiprocessing.rst:967 +#: ../../library/multiprocessing.rst:968 msgid "" "Return the :class:`Process` object corresponding to the parent process of " "the :func:`current_process`. For the main process, ``parent_process`` will " "be ``None``." msgstr "" -#: ../../library/multiprocessing.rst:975 +#: ../../library/multiprocessing.rst:976 msgid "" "Add support for when a program which uses :mod:`multiprocessing` has been " "frozen to produce a Windows executable. (Has been tested with **py2exe**, " "**PyInstaller** and **cx_Freeze**.)" msgstr "" -#: ../../library/multiprocessing.rst:979 +#: ../../library/multiprocessing.rst:980 msgid "" "One needs to call this function straight after the ``if __name__ == " "'__main__'`` line of the main module. For example::" msgstr "" -#: ../../library/multiprocessing.rst:991 +#: ../../library/multiprocessing.rst:992 msgid "" "If the ``freeze_support()`` line is omitted then trying to run the frozen " "executable will raise :exc:`RuntimeError`." msgstr "" -#: ../../library/multiprocessing.rst:994 +#: ../../library/multiprocessing.rst:995 msgid "" "Calling ``freeze_support()`` has no effect when invoked on any operating " "system other than Windows. In addition, if the module is being run normally " @@ -1059,7 +1061,7 @@ msgid "" "``freeze_support()`` has no effect." msgstr "" -#: ../../library/multiprocessing.rst:1001 +#: ../../library/multiprocessing.rst:1002 msgid "" "Returns a list of the supported start methods, the first of which is the " "default. The possible start methods are ``'fork'``, ``'spawn'`` and " @@ -1068,65 +1070,65 @@ msgid "" "default." msgstr "" -#: ../../library/multiprocessing.rst:1011 +#: ../../library/multiprocessing.rst:1012 msgid "" "Return a context object which has the same attributes as the :mod:" "`multiprocessing` module." msgstr "" -#: ../../library/multiprocessing.rst:1014 +#: ../../library/multiprocessing.rst:1015 msgid "" "If *method* is ``None`` then the default context is returned. Otherwise " "*method* should be ``'fork'``, ``'spawn'``, ``'forkserver'``. :exc:" "`ValueError` is raised if the specified start method is not available." msgstr "" -#: ../../library/multiprocessing.rst:1023 +#: ../../library/multiprocessing.rst:1024 msgid "Return the name of start method used for starting processes." msgstr "" -#: ../../library/multiprocessing.rst:1025 +#: ../../library/multiprocessing.rst:1026 msgid "" "If the start method has not been fixed and *allow_none* is false, then the " "start method is fixed to the default and the name is returned. If the start " "method has not been fixed and *allow_none* is true then ``None`` is returned." msgstr "" -#: ../../library/multiprocessing.rst:1030 +#: ../../library/multiprocessing.rst:1031 msgid "" "The return value can be ``'fork'``, ``'spawn'``, ``'forkserver'`` or " "``None``. ``'fork'`` is the default on Unix, while ``'spawn'`` is the " -"default on Windows." +"default on Windows and macOS." msgstr "" -#: ../../library/multiprocessing.rst:1038 +#: ../../library/multiprocessing.rst:1045 msgid "" "Sets the path of the Python interpreter to use when starting a child " "process. (By default :data:`sys.executable` is used). Embedders will " "probably need to do some thing like ::" msgstr "" -#: ../../library/multiprocessing.rst:1044 +#: ../../library/multiprocessing.rst:1051 msgid "before they can create child processes." msgstr "" -#: ../../library/multiprocessing.rst:1046 +#: ../../library/multiprocessing.rst:1053 msgid "Now supported on Unix when the ``'spawn'`` start method is used." msgstr "" -#: ../../library/multiprocessing.rst:1051 +#: ../../library/multiprocessing.rst:1058 msgid "" "Set the method which should be used to start child processes. *method* can " "be ``'fork'``, ``'spawn'`` or ``'forkserver'``." msgstr "" -#: ../../library/multiprocessing.rst:1054 +#: ../../library/multiprocessing.rst:1061 msgid "" "Note that this should be called at most once, and it should be protected " "inside the ``if __name__ == '__main__'`` clause of the main module." msgstr "" -#: ../../library/multiprocessing.rst:1062 +#: ../../library/multiprocessing.rst:1069 msgid "" ":mod:`multiprocessing` contains no analogues of :func:`threading." "active_count`, :func:`threading.enumerate`, :func:`threading.settrace`, :" @@ -1134,75 +1136,75 @@ msgid "" "local`." msgstr "" -#: ../../library/multiprocessing.rst:1069 +#: ../../library/multiprocessing.rst:1076 msgid "Connection Objects" msgstr "" -#: ../../library/multiprocessing.rst:1073 +#: ../../library/multiprocessing.rst:1080 msgid "" "Connection objects allow the sending and receiving of picklable objects or " "strings. They can be thought of as message oriented connected sockets." msgstr "" -#: ../../library/multiprocessing.rst:1076 +#: ../../library/multiprocessing.rst:1083 msgid "" "Connection objects are usually created using :func:`Pipe ` -- see also :ref:`multiprocessing-listeners-clients`." msgstr "" -#: ../../library/multiprocessing.rst:1084 +#: ../../library/multiprocessing.rst:1091 msgid "" "Send an object to the other end of the connection which should be read " "using :meth:`recv`." msgstr "" -#: ../../library/multiprocessing.rst:1087 +#: ../../library/multiprocessing.rst:1094 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:1092 +#: ../../library/multiprocessing.rst:1099 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:1099 +#: ../../library/multiprocessing.rst:1106 msgid "Return the file descriptor or handle used by the connection." msgstr "" -#: ../../library/multiprocessing.rst:1103 +#: ../../library/multiprocessing.rst:1110 msgid "Close the connection." msgstr "" -#: ../../library/multiprocessing.rst:1105 +#: ../../library/multiprocessing.rst:1112 msgid "This is called automatically when the connection is garbage collected." msgstr "" -#: ../../library/multiprocessing.rst:1109 +#: ../../library/multiprocessing.rst:1116 msgid "Return whether there is any data available to be read." msgstr "" -#: ../../library/multiprocessing.rst:1111 +#: ../../library/multiprocessing.rst:1118 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:1115 +#: ../../library/multiprocessing.rst:1122 msgid "" "Note that multiple connection objects may be polled at once by using :func:" "`multiprocessing.connection.wait`." msgstr "" -#: ../../library/multiprocessing.rst:1120 +#: ../../library/multiprocessing.rst:1127 msgid "Send byte data from a :term:`bytes-like object` as a complete message." msgstr "" -#: ../../library/multiprocessing.rst:1122 +#: ../../library/multiprocessing.rst:1129 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 " @@ -1210,7 +1212,7 @@ msgid "" "exc:`ValueError` exception" msgstr "" -#: ../../library/multiprocessing.rst:1129 +#: ../../library/multiprocessing.rst:1136 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 :" @@ -1218,19 +1220,19 @@ msgid "" "closed." msgstr "" -#: ../../library/multiprocessing.rst:1134 +#: ../../library/multiprocessing.rst:1141 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:1138 +#: ../../library/multiprocessing.rst:1145 msgid "" "This function used to raise :exc:`IOError`, which is now an alias of :exc:" "`OSError`." msgstr "" -#: ../../library/multiprocessing.rst:1145 +#: ../../library/multiprocessing.rst:1152 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 " @@ -1238,45 +1240,45 @@ msgid "" "nothing left to receive and the other end was closed." msgstr "" -#: ../../library/multiprocessing.rst:1151 +#: ../../library/multiprocessing.rst:1158 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:1156 +#: ../../library/multiprocessing.rst:1163 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:1160 +#: ../../library/multiprocessing.rst:1167 msgid "" "Connection objects themselves can now be transferred between processes " "using :meth:`Connection.send` and :meth:`Connection.recv`." msgstr "" -#: ../../library/multiprocessing.rst:1164 +#: ../../library/multiprocessing.rst:1171 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:1169 +#: ../../library/multiprocessing.rst:1176 msgid "For example:" msgstr "" -#: ../../library/multiprocessing.rst:1194 +#: ../../library/multiprocessing.rst:1201 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:1198 +#: ../../library/multiprocessing.rst:1205 msgid "" "Therefore, unless the connection object was produced using :func:`Pipe` you " "should only use the :meth:`~Connection.recv` and :meth:`~Connection.send` " @@ -1284,73 +1286,73 @@ msgid "" "`multiprocessing-auth-keys`." msgstr "" -#: ../../library/multiprocessing.rst:1205 +#: ../../library/multiprocessing.rst:1212 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:1211 +#: ../../library/multiprocessing.rst:1218 msgid "Synchronization primitives" msgstr "" -#: ../../library/multiprocessing.rst:1215 +#: ../../library/multiprocessing.rst:1222 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:1219 +#: ../../library/multiprocessing.rst:1226 msgid "" "Note that one can also create synchronization primitives by using a manager " "object -- see :ref:`multiprocessing-managers`." msgstr "" -#: ../../library/multiprocessing.rst:1224 +#: ../../library/multiprocessing.rst:1231 msgid "A barrier object: a clone of :class:`threading.Barrier`." msgstr "" -#: ../../library/multiprocessing.rst:1230 +#: ../../library/multiprocessing.rst:1237 msgid "" "A bounded semaphore object: a close analog of :class:`threading." "BoundedSemaphore`." msgstr "" -#: ../../library/multiprocessing.rst:1233 -#: ../../library/multiprocessing.rst:1371 +#: ../../library/multiprocessing.rst:1240 +#: ../../library/multiprocessing.rst:1378 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:1237 +#: ../../library/multiprocessing.rst:1244 msgid "" -"On Mac OS X, this is indistinguishable from :class:`Semaphore` because " +"On macOS, this is indistinguishable from :class:`Semaphore` because " "``sem_getvalue()`` is not implemented on that platform." msgstr "" -#: ../../library/multiprocessing.rst:1242 +#: ../../library/multiprocessing.rst:1249 msgid "A condition variable: an alias for :class:`threading.Condition`." msgstr "" -#: ../../library/multiprocessing.rst:1244 +#: ../../library/multiprocessing.rst:1251 msgid "" "If *lock* is specified then it should be a :class:`Lock` or :class:`RLock` " "object from :mod:`multiprocessing`." msgstr "" -#: ../../library/multiprocessing.rst:1247 -#: ../../library/multiprocessing.rst:1781 +#: ../../library/multiprocessing.rst:1254 +#: ../../library/multiprocessing.rst:1788 msgid "The :meth:`~threading.Condition.wait_for` method was added." msgstr "" -#: ../../library/multiprocessing.rst:1252 +#: ../../library/multiprocessing.rst:1259 msgid "A clone of :class:`threading.Event`." msgstr "" -#: ../../library/multiprocessing.rst:1257 +#: ../../library/multiprocessing.rst:1264 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 " @@ -1361,25 +1363,25 @@ msgid "" "as noted." msgstr "" -#: ../../library/multiprocessing.rst:1265 +#: ../../library/multiprocessing.rst:1272 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:1269 +#: ../../library/multiprocessing.rst:1276 msgid "" ":class:`Lock` supports the :term:`context manager` protocol and thus may be " "used in :keyword:`with` statements." msgstr "" -#: ../../library/multiprocessing.rst:1274 -#: ../../library/multiprocessing.rst:1325 +#: ../../library/multiprocessing.rst:1281 +#: ../../library/multiprocessing.rst:1332 msgid "Acquire a lock, blocking or non-blocking." msgstr "" -#: ../../library/multiprocessing.rst:1276 +#: ../../library/multiprocessing.rst:1283 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 " @@ -1387,14 +1389,14 @@ msgid "" "that in :meth:`threading.Lock.acquire`." msgstr "" -#: ../../library/multiprocessing.rst:1281 +#: ../../library/multiprocessing.rst:1288 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:1285 +#: ../../library/multiprocessing.rst:1292 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 " @@ -1408,19 +1410,19 @@ msgid "" "acquired or ``False`` if the timeout period has elapsed." msgstr "" -#: ../../library/multiprocessing.rst:1300 +#: ../../library/multiprocessing.rst:1307 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:1303 +#: ../../library/multiprocessing.rst:1310 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:1309 +#: ../../library/multiprocessing.rst:1316 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. " @@ -1429,20 +1431,20 @@ msgid "" "release it once for each time it has been acquired." msgstr "" -#: ../../library/multiprocessing.rst:1315 +#: ../../library/multiprocessing.rst:1322 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:1319 +#: ../../library/multiprocessing.rst:1326 msgid "" ":class:`RLock` supports the :term:`context manager` protocol and thus may be " "used in :keyword:`with` statements." msgstr "" -#: ../../library/multiprocessing.rst:1327 +#: ../../library/multiprocessing.rst:1334 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 " @@ -1455,7 +1457,7 @@ msgid "" "itself." msgstr "" -#: ../../library/multiprocessing.rst:1337 +#: ../../library/multiprocessing.rst:1344 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 " @@ -1466,14 +1468,14 @@ msgid "" "a return value of ``True``." msgstr "" -#: ../../library/multiprocessing.rst:1345 +#: ../../library/multiprocessing.rst:1352 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:1352 +#: ../../library/multiprocessing.rst:1359 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 " @@ -1483,7 +1485,7 @@ msgid "" "locked and owned by the calling process or thread." msgstr "" -#: ../../library/multiprocessing.rst:1360 +#: ../../library/multiprocessing.rst:1367 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 " @@ -1492,17 +1494,17 @@ msgid "" "from the implemented behavior in :meth:`threading.RLock.release`." msgstr "" -#: ../../library/multiprocessing.rst:1369 +#: ../../library/multiprocessing.rst:1376 msgid "A semaphore object: a close analog of :class:`threading.Semaphore`." msgstr "" -#: ../../library/multiprocessing.rst:1376 +#: ../../library/multiprocessing.rst:1383 msgid "" -"On Mac OS X, ``sem_timedwait`` is unsupported, so calling ``acquire()`` with " -"a timeout will emulate that function's behavior using a sleeping loop." +"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:1381 +#: ../../library/multiprocessing.rst:1388 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." @@ -1511,13 +1513,13 @@ msgid "" "interrupted and :exc:`KeyboardInterrupt` will be raised." msgstr "" -#: ../../library/multiprocessing.rst:1387 +#: ../../library/multiprocessing.rst:1394 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:1392 +#: ../../library/multiprocessing.rst:1399 msgid "" "Some of this package's functionality requires a functioning shared semaphore " "implementation on the host operating system. Without one, the :mod:" @@ -1526,32 +1528,32 @@ msgid "" "additional information." msgstr "" -#: ../../library/multiprocessing.rst:1400 +#: ../../library/multiprocessing.rst:1407 msgid "Shared :mod:`ctypes` Objects" msgstr "" -#: ../../library/multiprocessing.rst:1402 +#: ../../library/multiprocessing.rst:1409 msgid "" "It is possible to create shared objects using shared memory which can be " "inherited by child processes." msgstr "" -#: ../../library/multiprocessing.rst:1407 +#: ../../library/multiprocessing.rst:1414 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:1411 -#: ../../library/multiprocessing.rst:1498 +#: ../../library/multiprocessing.rst:1418 +#: ../../library/multiprocessing.rst:1505 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:1415 +#: ../../library/multiprocessing.rst:1422 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` " @@ -1561,32 +1563,32 @@ msgid "" "\"process-safe\"." msgstr "" -#: ../../library/multiprocessing.rst:1422 +#: ../../library/multiprocessing.rst:1429 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:1428 +#: ../../library/multiprocessing.rst:1435 msgid "" "Assuming the associated lock is recursive (which it is by default) you can " "instead do ::" msgstr "" -#: ../../library/multiprocessing.rst:1434 -#: ../../library/multiprocessing.rst:1524 -#: ../../library/multiprocessing.rst:1539 +#: ../../library/multiprocessing.rst:1441 +#: ../../library/multiprocessing.rst:1531 +#: ../../library/multiprocessing.rst:1546 msgid "Note that *lock* is a keyword-only argument." msgstr "" -#: ../../library/multiprocessing.rst:1438 +#: ../../library/multiprocessing.rst:1445 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:1441 +#: ../../library/multiprocessing.rst:1448 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 " @@ -1596,7 +1598,7 @@ msgid "" "initialize the array and whose length determines the length of the array." msgstr "" -#: ../../library/multiprocessing.rst:1448 +#: ../../library/multiprocessing.rst:1455 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:" @@ -1606,28 +1608,28 @@ msgid "" "safe\"." msgstr "" -#: ../../library/multiprocessing.rst:1455 +#: ../../library/multiprocessing.rst:1462 msgid "Note that *lock* is a keyword only argument." msgstr "" -#: ../../library/multiprocessing.rst:1457 +#: ../../library/multiprocessing.rst:1464 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:1462 +#: ../../library/multiprocessing.rst:1469 msgid "The :mod:`multiprocessing.sharedctypes` module" msgstr "" -#: ../../library/multiprocessing.rst:1467 +#: ../../library/multiprocessing.rst:1474 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:1473 +#: ../../library/multiprocessing.rst:1480 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. " @@ -1636,11 +1638,11 @@ msgid "" "may cause a crash." msgstr "" -#: ../../library/multiprocessing.rst:1481 +#: ../../library/multiprocessing.rst:1488 msgid "Return a ctypes array allocated from shared memory." msgstr "" -#: ../../library/multiprocessing.rst:1483 +#: ../../library/multiprocessing.rst:1490 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 " @@ -1650,40 +1652,40 @@ msgid "" "initialize the array and whose length determines the length of the array." msgstr "" -#: ../../library/multiprocessing.rst:1490 +#: ../../library/multiprocessing.rst:1497 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:1496 +#: ../../library/multiprocessing.rst:1503 msgid "Return a ctypes object allocated from shared memory." msgstr "" -#: ../../library/multiprocessing.rst:1502 +#: ../../library/multiprocessing.rst:1509 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:1506 +#: ../../library/multiprocessing.rst:1513 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:1512 +#: ../../library/multiprocessing.rst:1519 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:1516 -#: ../../library/multiprocessing.rst:1532 +#: ../../library/multiprocessing.rst:1523 +#: ../../library/multiprocessing.rst:1539 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." @@ -1693,121 +1695,121 @@ msgid "" "not necessarily be \"process-safe\"." msgstr "" -#: ../../library/multiprocessing.rst:1528 +#: ../../library/multiprocessing.rst:1535 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:1543 +#: ../../library/multiprocessing.rst:1550 msgid "" "Return a ctypes object allocated from shared memory which is a copy of the " "ctypes object *obj*." msgstr "" -#: ../../library/multiprocessing.rst:1548 +#: ../../library/multiprocessing.rst:1555 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:1552 +#: ../../library/multiprocessing.rst:1559 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:1556 +#: ../../library/multiprocessing.rst:1563 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:1559 +#: ../../library/multiprocessing.rst:1566 msgid "Synchronized objects support the :term:`context manager` protocol." msgstr "" -#: ../../library/multiprocessing.rst:1563 +#: ../../library/multiprocessing.rst:1570 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:1568 +#: ../../library/multiprocessing.rst:1575 msgid "ctypes" msgstr "" -#: ../../library/multiprocessing.rst:1568 +#: ../../library/multiprocessing.rst:1575 msgid "sharedctypes using type" msgstr "" -#: ../../library/multiprocessing.rst:1568 +#: ../../library/multiprocessing.rst:1575 msgid "sharedctypes using typecode" msgstr "" -#: ../../library/multiprocessing.rst:1570 +#: ../../library/multiprocessing.rst:1577 msgid "c_double(2.4)" msgstr "" -#: ../../library/multiprocessing.rst:1570 +#: ../../library/multiprocessing.rst:1577 msgid "RawValue(c_double, 2.4)" msgstr "" -#: ../../library/multiprocessing.rst:1570 +#: ../../library/multiprocessing.rst:1577 msgid "RawValue('d', 2.4)" msgstr "" -#: ../../library/multiprocessing.rst:1571 +#: ../../library/multiprocessing.rst:1578 msgid "MyStruct(4, 6)" msgstr "" -#: ../../library/multiprocessing.rst:1571 +#: ../../library/multiprocessing.rst:1578 msgid "RawValue(MyStruct, 4, 6)" msgstr "" -#: ../../library/multiprocessing.rst:1572 +#: ../../library/multiprocessing.rst:1579 msgid "(c_short * 7)()" msgstr "" -#: ../../library/multiprocessing.rst:1572 +#: ../../library/multiprocessing.rst:1579 msgid "RawArray(c_short, 7)" msgstr "" -#: ../../library/multiprocessing.rst:1572 +#: ../../library/multiprocessing.rst:1579 msgid "RawArray('h', 7)" msgstr "" -#: ../../library/multiprocessing.rst:1573 +#: ../../library/multiprocessing.rst:1580 msgid "(c_int * 3)(9, 2, 8)" msgstr "" -#: ../../library/multiprocessing.rst:1573 +#: ../../library/multiprocessing.rst:1580 msgid "RawArray(c_int, (9, 2, 8))" msgstr "" -#: ../../library/multiprocessing.rst:1573 +#: ../../library/multiprocessing.rst:1580 msgid "RawArray('i', (9, 2, 8))" msgstr "" -#: ../../library/multiprocessing.rst:1577 +#: ../../library/multiprocessing.rst:1584 msgid "" "Below is an example where a number of ctypes objects are modified by a child " "process::" msgstr "" -#: ../../library/multiprocessing.rst:1615 +#: ../../library/multiprocessing.rst:1622 msgid "The results printed are ::" msgstr "" -#: ../../library/multiprocessing.rst:1628 +#: ../../library/multiprocessing.rst:1635 msgid "Managers" msgstr "" -#: ../../library/multiprocessing.rst:1630 +#: ../../library/multiprocessing.rst:1637 msgid "" "Managers provide a way to create data which can be shared between different " "processes, including sharing over a network between processes running on " @@ -1816,7 +1818,7 @@ msgid "" "proxies." msgstr "" -#: ../../library/multiprocessing.rst:1638 +#: ../../library/multiprocessing.rst:1645 msgid "" "Returns a started :class:`~multiprocessing.managers.SyncManager` object " "which can be used for sharing objects between processes. The returned " @@ -1824,31 +1826,31 @@ msgid "" "will create shared objects and return corresponding proxies." msgstr "" -#: ../../library/multiprocessing.rst:1646 +#: ../../library/multiprocessing.rst:1653 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:1652 +#: ../../library/multiprocessing.rst:1659 msgid "Create a BaseManager object." msgstr "" -#: ../../library/multiprocessing.rst:1654 +#: ../../library/multiprocessing.rst:1661 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:1657 +#: ../../library/multiprocessing.rst:1664 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:1660 +#: ../../library/multiprocessing.rst:1667 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`` " @@ -1856,50 +1858,50 @@ msgid "" "it must be a byte string." msgstr "" -#: ../../library/multiprocessing.rst:1667 +#: ../../library/multiprocessing.rst:1674 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:1672 +#: ../../library/multiprocessing.rst:1679 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:1681 +#: ../../library/multiprocessing.rst:1688 msgid ":class:`Server` additionally has an :attr:`address` attribute." msgstr "" -#: ../../library/multiprocessing.rst:1685 +#: ../../library/multiprocessing.rst:1692 msgid "Connect a local manager object to a remote manager process::" msgstr "" -#: ../../library/multiprocessing.rst:1693 +#: ../../library/multiprocessing.rst:1700 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:1696 +#: ../../library/multiprocessing.rst:1703 msgid "This can be called multiple times." msgstr "" -#: ../../library/multiprocessing.rst:1700 +#: ../../library/multiprocessing.rst:1707 msgid "" "A classmethod which can be used for registering a type or callable with the " "manager class." msgstr "" -#: ../../library/multiprocessing.rst:1703 +#: ../../library/multiprocessing.rst:1710 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:1706 +#: ../../library/multiprocessing.rst:1713 msgid "" "*callable* is a callable used for creating objects for this type " "identifier. If a manager instance will be connected to the server using " @@ -1907,14 +1909,14 @@ msgid "" "then this can be left as ``None``." msgstr "" -#: ../../library/multiprocessing.rst:1712 +#: ../../library/multiprocessing.rst:1719 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:1716 +#: ../../library/multiprocessing.rst:1723 msgid "" "*exposed* is used to specify a sequence of method names which proxies for " "this typeid should be allowed to access using :meth:`BaseProxy." @@ -1925,7 +1927,7 @@ msgid "" "method and whose name does not begin with ``'_'``.)" msgstr "" -#: ../../library/multiprocessing.rst:1725 +#: ../../library/multiprocessing.rst:1732 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 " @@ -1935,22 +1937,22 @@ msgid "" "returned by the method will be copied by value." msgstr "" -#: ../../library/multiprocessing.rst:1732 +#: ../../library/multiprocessing.rst:1739 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:1736 +#: ../../library/multiprocessing.rst:1743 msgid ":class:`BaseManager` instances also have one read-only property:" msgstr "" -#: ../../library/multiprocessing.rst:1740 +#: ../../library/multiprocessing.rst:1747 msgid "The address used by the manager." msgstr "" -#: ../../library/multiprocessing.rst:1742 +#: ../../library/multiprocessing.rst:1749 msgid "" "Manager objects support the context management protocol -- see :ref:" "`typecontextmanager`. :meth:`~contextmanager.__enter__` starts the server " @@ -1958,173 +1960,173 @@ msgid "" "object. :meth:`~contextmanager.__exit__` calls :meth:`shutdown`." msgstr "" -#: ../../library/multiprocessing.rst:1748 +#: ../../library/multiprocessing.rst:1755 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:1753 +#: ../../library/multiprocessing.rst:1760 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:1757 +#: ../../library/multiprocessing.rst:1764 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:1763 +#: ../../library/multiprocessing.rst:1770 msgid "" "Create a shared :class:`threading.Barrier` object and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:1770 +#: ../../library/multiprocessing.rst:1777 msgid "" "Create a shared :class:`threading.BoundedSemaphore` object and return a " "proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:1775 +#: ../../library/multiprocessing.rst:1782 msgid "" "Create a shared :class:`threading.Condition` object and return a proxy for " "it." msgstr "" -#: ../../library/multiprocessing.rst:1778 +#: ../../library/multiprocessing.rst:1785 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:1786 +#: ../../library/multiprocessing.rst:1793 msgid "" "Create a shared :class:`threading.Event` object and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:1790 +#: ../../library/multiprocessing.rst:1797 msgid "" "Create a shared :class:`threading.Lock` object and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:1794 +#: ../../library/multiprocessing.rst:1801 msgid "Create a shared :class:`Namespace` object and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:1798 +#: ../../library/multiprocessing.rst:1805 msgid "Create a shared :class:`queue.Queue` object and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:1802 +#: ../../library/multiprocessing.rst:1809 msgid "" "Create a shared :class:`threading.RLock` object and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:1806 +#: ../../library/multiprocessing.rst:1813 msgid "" "Create a shared :class:`threading.Semaphore` object and return a proxy for " "it." msgstr "" -#: ../../library/multiprocessing.rst:1811 +#: ../../library/multiprocessing.rst:1818 msgid "Create an array and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:1815 +#: ../../library/multiprocessing.rst:1822 msgid "" "Create an object with a writable ``value`` attribute and return a proxy for " "it." msgstr "" -#: ../../library/multiprocessing.rst:1822 +#: ../../library/multiprocessing.rst:1829 msgid "Create a shared :class:`dict` object and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:1827 +#: ../../library/multiprocessing.rst:1834 msgid "Create a shared :class:`list` object and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:1829 +#: ../../library/multiprocessing.rst:1836 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:1836 +#: ../../library/multiprocessing.rst:1843 msgid "A type that can register with :class:`SyncManager`." msgstr "" -#: ../../library/multiprocessing.rst:1838 +#: ../../library/multiprocessing.rst:1845 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:1841 +#: ../../library/multiprocessing.rst:1848 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:1857 +#: ../../library/multiprocessing.rst:1864 msgid "Customized managers" msgstr "" -#: ../../library/multiprocessing.rst:1859 +#: ../../library/multiprocessing.rst:1866 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:1884 +#: ../../library/multiprocessing.rst:1891 msgid "Using a remote manager" msgstr "" -#: ../../library/multiprocessing.rst:1886 +#: ../../library/multiprocessing.rst:1893 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:1889 +#: ../../library/multiprocessing.rst:1896 msgid "" "Running the following commands creates a server for a single shared queue " "which remote clients can access::" msgstr "" -#: ../../library/multiprocessing.rst:1901 +#: ../../library/multiprocessing.rst:1908 msgid "One client can access the server as follows::" msgstr "" -#: ../../library/multiprocessing.rst:1911 +#: ../../library/multiprocessing.rst:1918 msgid "Another client can also use it::" msgstr "" -#: ../../library/multiprocessing.rst:1922 +#: ../../library/multiprocessing.rst:1929 msgid "" "Local processes can also access that queue, using the code from above on the " "client to access it remotely::" msgstr "" -#: ../../library/multiprocessing.rst:1947 +#: ../../library/multiprocessing.rst:1954 msgid "Proxy Objects" msgstr "" -#: ../../library/multiprocessing.rst:1949 +#: ../../library/multiprocessing.rst:1956 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:1953 +#: ../../library/multiprocessing.rst:1960 msgid "" "A proxy object has methods which invoke corresponding methods of its " "referent (although not every method of the referent will necessarily be " @@ -2132,14 +2134,14 @@ msgid "" "its referent can:" msgstr "" -#: ../../library/multiprocessing.rst:1971 +#: ../../library/multiprocessing.rst:1978 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:1975 +#: ../../library/multiprocessing.rst:1982 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:" @@ -2147,11 +2149,11 @@ msgid "" "lists, dicts, and other :ref:`multiprocessing-proxy_objects`:" msgstr "" -#: ../../library/multiprocessing.rst:1991 +#: ../../library/multiprocessing.rst:1998 msgid "Similarly, dict and list proxies may be nested inside one another::" msgstr "" -#: ../../library/multiprocessing.rst:2004 +#: ../../library/multiprocessing.rst:2011 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 " @@ -2162,53 +2164,53 @@ msgid "" "assign the modified value to the container proxy::" msgstr "" -#: ../../library/multiprocessing.rst:2023 +#: ../../library/multiprocessing.rst:2030 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:2029 +#: ../../library/multiprocessing.rst:2036 msgid "" "The proxy types in :mod:`multiprocessing` do nothing to support comparisons " "by value. So, for instance, we have:" msgstr "" -#: ../../library/multiprocessing.rst:2037 +#: ../../library/multiprocessing.rst:2044 msgid "" "One should just use a copy of the referent instead when making comparisons." msgstr "" -#: ../../library/multiprocessing.rst:2041 +#: ../../library/multiprocessing.rst:2048 msgid "Proxy objects are instances of subclasses of :class:`BaseProxy`." msgstr "" -#: ../../library/multiprocessing.rst:2045 +#: ../../library/multiprocessing.rst:2052 msgid "Call and return the result of a method of the proxy's referent." msgstr "" -#: ../../library/multiprocessing.rst:2047 +#: ../../library/multiprocessing.rst:2054 msgid "" "If ``proxy`` is a proxy whose referent is ``obj`` then the expression ::" msgstr "" -#: ../../library/multiprocessing.rst:2051 +#: ../../library/multiprocessing.rst:2058 msgid "will evaluate the expression ::" msgstr "" -#: ../../library/multiprocessing.rst:2055 +#: ../../library/multiprocessing.rst:2062 msgid "in the manager's process." msgstr "" -#: ../../library/multiprocessing.rst:2057 +#: ../../library/multiprocessing.rst:2064 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:2061 +#: ../../library/multiprocessing.rst:2068 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 " @@ -2216,79 +2218,79 @@ msgid "" "meth:`_callmethod`." msgstr "" -#: ../../library/multiprocessing.rst:2066 +#: ../../library/multiprocessing.rst:2073 msgid "" "Note in particular that an exception will be raised if *methodname* has not " "been *exposed*." msgstr "" -#: ../../library/multiprocessing.rst:2069 +#: ../../library/multiprocessing.rst:2076 msgid "An example of the usage of :meth:`_callmethod`:" msgstr "" -#: ../../library/multiprocessing.rst:2085 +#: ../../library/multiprocessing.rst:2092 msgid "Return a copy of the referent." msgstr "" -#: ../../library/multiprocessing.rst:2087 +#: ../../library/multiprocessing.rst:2094 msgid "If the referent is unpicklable then this will raise an exception." msgstr "" -#: ../../library/multiprocessing.rst:2091 +#: ../../library/multiprocessing.rst:2098 msgid "Return a representation of the proxy object." msgstr "" -#: ../../library/multiprocessing.rst:2095 +#: ../../library/multiprocessing.rst:2102 msgid "Return the representation of the referent." msgstr "" -#: ../../library/multiprocessing.rst:2099 +#: ../../library/multiprocessing.rst:2106 msgid "Cleanup" msgstr "" -#: ../../library/multiprocessing.rst:2101 +#: ../../library/multiprocessing.rst:2108 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:2104 +#: ../../library/multiprocessing.rst:2111 msgid "" "A shared object gets deleted from the manager process when there are no " "longer any proxies referring to it." msgstr "" -#: ../../library/multiprocessing.rst:2109 +#: ../../library/multiprocessing.rst:2116 msgid "Process Pools" msgstr "" -#: ../../library/multiprocessing.rst:2114 +#: ../../library/multiprocessing.rst:2121 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:2119 +#: ../../library/multiprocessing.rst:2126 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:2123 +#: ../../library/multiprocessing.rst:2130 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:2126 -#: ../../library/multiprocessing.rst:2685 +#: ../../library/multiprocessing.rst:2133 +#: ../../library/multiprocessing.rst:2692 msgid "" "If *initializer* is not ``None`` then each worker process will call " "``initializer(*initargs)`` when it starts." msgstr "" -#: ../../library/multiprocessing.rst:2129 +#: ../../library/multiprocessing.rst:2136 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 " @@ -2296,7 +2298,7 @@ msgid "" "which means worker processes will live as long as the pool." msgstr "" -#: ../../library/multiprocessing.rst:2134 +#: ../../library/multiprocessing.rst:2141 msgid "" "*context* can be used to specify the context used for starting the worker " "processes. Usually a pool is created using the function :func:" @@ -2304,13 +2306,13 @@ msgid "" "both cases *context* is set appropriately." msgstr "" -#: ../../library/multiprocessing.rst:2140 +#: ../../library/multiprocessing.rst:2147 msgid "" "Note that the methods of the pool object should only be called by the " "process which created the pool." msgstr "" -#: ../../library/multiprocessing.rst:2144 +#: ../../library/multiprocessing.rst:2151 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 " @@ -2318,22 +2320,22 @@ msgid "" "to do this can lead to the process hanging on finalization." msgstr "" -#: ../../library/multiprocessing.rst:2149 +#: ../../library/multiprocessing.rst:2156 msgid "" "Note that is **not correct** to rely on the garbage colletor 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:2153 +#: ../../library/multiprocessing.rst:2160 msgid "*maxtasksperchild*" msgstr "" -#: ../../library/multiprocessing.rst:2156 +#: ../../library/multiprocessing.rst:2163 msgid "*context*" msgstr "" -#: ../../library/multiprocessing.rst:2161 +#: ../../library/multiprocessing.rst:2168 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 " @@ -2344,7 +2346,7 @@ msgid "" "ability to the end user." msgstr "" -#: ../../library/multiprocessing.rst:2171 +#: ../../library/multiprocessing.rst:2178 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 " @@ -2352,14 +2354,14 @@ msgid "" "executed in one of the workers of the pool." msgstr "" -#: ../../library/multiprocessing.rst:2178 +#: ../../library/multiprocessing.rst:2185 msgid "" "A variant of the :meth:`apply` method which returns a :class:" "`~multiprocessing.pool.AsyncResult` object." msgstr "" -#: ../../library/multiprocessing.rst:2181 -#: ../../library/multiprocessing.rst:2212 +#: ../../library/multiprocessing.rst:2188 +#: ../../library/multiprocessing.rst:2219 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, " @@ -2367,60 +2369,60 @@ msgid "" "applied instead." msgstr "" -#: ../../library/multiprocessing.rst:2186 -#: ../../library/multiprocessing.rst:2217 +#: ../../library/multiprocessing.rst:2193 +#: ../../library/multiprocessing.rst:2224 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:2190 -#: ../../library/multiprocessing.rst:2221 +#: ../../library/multiprocessing.rst:2197 +#: ../../library/multiprocessing.rst:2228 msgid "" "Callbacks should complete immediately since otherwise the thread which " "handles the results will get blocked." msgstr "" -#: ../../library/multiprocessing.rst:2195 +#: ../../library/multiprocessing.rst:2202 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:2199 +#: ../../library/multiprocessing.rst:2206 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:2203 +#: ../../library/multiprocessing.rst:2210 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:2209 +#: ../../library/multiprocessing.rst:2216 msgid "" "A variant of the :meth:`.map` method which returns a :class:" "`~multiprocessing.pool.AsyncResult` object." msgstr "" -#: ../../library/multiprocessing.rst:2226 +#: ../../library/multiprocessing.rst:2233 msgid "A lazier version of :meth:`.map`." msgstr "" -#: ../../library/multiprocessing.rst:2228 +#: ../../library/multiprocessing.rst:2235 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:2233 +#: ../../library/multiprocessing.rst:2240 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: " @@ -2428,65 +2430,65 @@ msgid "" "result cannot be returned within *timeout* seconds." msgstr "" -#: ../../library/multiprocessing.rst:2240 +#: ../../library/multiprocessing.rst:2247 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:2246 +#: ../../library/multiprocessing.rst:2253 msgid "" "Like :meth:`map` except that the elements of the *iterable* are expected to " "be iterables that are unpacked as arguments." msgstr "" -#: ../../library/multiprocessing.rst:2249 +#: ../../library/multiprocessing.rst:2256 msgid "" "Hence an *iterable* of ``[(1,2), (3, 4)]`` results in ``[func(1,2), " "func(3,4)]``." msgstr "" -#: ../../library/multiprocessing.rst:2256 +#: ../../library/multiprocessing.rst:2263 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:2264 +#: ../../library/multiprocessing.rst:2271 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:2269 +#: ../../library/multiprocessing.rst:2276 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:2275 +#: ../../library/multiprocessing.rst:2282 msgid "" "Wait for the worker processes to exit. One must call :meth:`close` or :meth:" "`terminate` before using :meth:`join`." msgstr "" -#: ../../library/multiprocessing.rst:2278 +#: ../../library/multiprocessing.rst:2285 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:2286 +#: ../../library/multiprocessing.rst:2293 msgid "" "The class of the result returned by :meth:`Pool.apply_async` and :meth:`Pool." "map_async`." msgstr "" -#: ../../library/multiprocessing.rst:2291 +#: ../../library/multiprocessing.rst:2298 msgid "" "Return the result when it arrives. If *timeout* is not ``None`` and the " "result does not arrive within *timeout* seconds then :exc:`multiprocessing." @@ -2494,41 +2496,41 @@ msgid "" "exception will be reraised by :meth:`get`." msgstr "" -#: ../../library/multiprocessing.rst:2298 +#: ../../library/multiprocessing.rst:2305 msgid "Wait until the result is available or until *timeout* seconds pass." msgstr "" -#: ../../library/multiprocessing.rst:2302 +#: ../../library/multiprocessing.rst:2309 msgid "Return whether the call has completed." msgstr "" -#: ../../library/multiprocessing.rst:2306 +#: ../../library/multiprocessing.rst:2313 msgid "" "Return whether the call completed without raising an exception. Will raise :" "exc:`ValueError` if the result is not ready." msgstr "" -#: ../../library/multiprocessing.rst:2309 +#: ../../library/multiprocessing.rst:2316 msgid "" "If the result is not ready, :exc:`ValueError` is raised instead of :exc:" "`AssertionError`." msgstr "" -#: ../../library/multiprocessing.rst:2313 +#: ../../library/multiprocessing.rst:2320 msgid "The following example demonstrates the use of a pool::" msgstr "" -#: ../../library/multiprocessing.rst:2340 +#: ../../library/multiprocessing.rst:2347 msgid "Listeners and Clients" msgstr "" -#: ../../library/multiprocessing.rst:2345 +#: ../../library/multiprocessing.rst:2352 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:2349 +#: ../../library/multiprocessing.rst:2356 msgid "" "However, the :mod:`multiprocessing.connection` module allows some extra " "flexibility. It basically gives a high level message oriented API for " @@ -2537,46 +2539,46 @@ msgid "" "multiple connections at the same time." msgstr "" -#: ../../library/multiprocessing.rst:2358 +#: ../../library/multiprocessing.rst:2365 msgid "" "Send a randomly generated message to the other end of the connection and " "wait for a reply." msgstr "" -#: ../../library/multiprocessing.rst:2361 +#: ../../library/multiprocessing.rst:2368 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:2367 +#: ../../library/multiprocessing.rst:2374 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:2370 +#: ../../library/multiprocessing.rst:2377 msgid "" "If a welcome message is not received, then :exc:`~multiprocessing." "AuthenticationError` is raised." msgstr "" -#: ../../library/multiprocessing.rst:2375 +#: ../../library/multiprocessing.rst:2382 msgid "" "Attempt to set up a connection to the listener which is using address " "*address*, returning a :class:`~Connection`." msgstr "" -#: ../../library/multiprocessing.rst:2378 +#: ../../library/multiprocessing.rst:2385 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:2382 -#: ../../library/multiprocessing.rst:2417 +#: ../../library/multiprocessing.rst:2389 +#: ../../library/multiprocessing.rst:2424 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 " @@ -2585,26 +2587,26 @@ msgid "" "`multiprocessing-auth-keys`." msgstr "" -#: ../../library/multiprocessing.rst:2390 +#: ../../library/multiprocessing.rst:2397 msgid "" "A wrapper for a bound socket or Windows named pipe which is 'listening' for " "connections." msgstr "" -#: ../../library/multiprocessing.rst:2393 +#: ../../library/multiprocessing.rst:2400 msgid "" "*address* is the address to be used by the bound socket or named pipe of the " "listener object." msgstr "" -#: ../../library/multiprocessing.rst:2398 +#: ../../library/multiprocessing.rst:2405 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:2402 +#: ../../library/multiprocessing.rst:2409 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 " @@ -2618,49 +2620,49 @@ msgid "" "using :func:`tempfile.mkstemp`." msgstr "" -#: ../../library/multiprocessing.rst:2413 +#: ../../library/multiprocessing.rst:2420 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:2425 +#: ../../library/multiprocessing.rst:2432 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:2432 +#: ../../library/multiprocessing.rst:2439 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:2436 +#: ../../library/multiprocessing.rst:2443 msgid "Listener objects have the following read-only properties:" msgstr "" -#: ../../library/multiprocessing.rst:2440 +#: ../../library/multiprocessing.rst:2447 msgid "The address which is being used by the Listener object." msgstr "" -#: ../../library/multiprocessing.rst:2444 +#: ../../library/multiprocessing.rst:2451 msgid "" "The address from which the last accepted connection came. If this is " "unavailable then it is ``None``." msgstr "" -#: ../../library/multiprocessing.rst:2447 +#: ../../library/multiprocessing.rst:2454 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:2454 +#: ../../library/multiprocessing.rst:2461 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 " @@ -2669,32 +2671,32 @@ msgid "" "zero timeout." msgstr "" -#: ../../library/multiprocessing.rst:2460 +#: ../../library/multiprocessing.rst:2467 msgid "" "For both Unix and Windows, an object can appear in *object_list* if it is" msgstr "" -#: ../../library/multiprocessing.rst:2463 +#: ../../library/multiprocessing.rst:2470 msgid "a readable :class:`~multiprocessing.connection.Connection` object;" msgstr "" -#: ../../library/multiprocessing.rst:2464 +#: ../../library/multiprocessing.rst:2471 msgid "a connected and readable :class:`socket.socket` object; or" msgstr "" -#: ../../library/multiprocessing.rst:2465 +#: ../../library/multiprocessing.rst:2472 msgid "" "the :attr:`~multiprocessing.Process.sentinel` attribute of a :class:" "`~multiprocessing.Process` object." msgstr "" -#: ../../library/multiprocessing.rst:2468 +#: ../../library/multiprocessing.rst:2475 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:2471 +#: ../../library/multiprocessing.rst:2478 msgid "" "**Unix**: ``wait(object_list, timeout)`` almost equivalent ``select." "select(object_list, [], [], timeout)``. The difference is that, if :func:" @@ -2702,7 +2704,7 @@ msgid "" "an error number of ``EINTR``, whereas :func:`wait` will not." msgstr "" -#: ../../library/multiprocessing.rst:2477 +#: ../../library/multiprocessing.rst:2484 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 " @@ -2711,46 +2713,46 @@ msgid "" "that pipe handles and socket handles are **not** waitable handles.)" msgstr "" -#: ../../library/multiprocessing.rst:2487 +#: ../../library/multiprocessing.rst:2494 msgid "**Examples**" msgstr "" -#: ../../library/multiprocessing.rst:2489 +#: ../../library/multiprocessing.rst:2496 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:2508 +#: ../../library/multiprocessing.rst:2515 msgid "" "The following code connects to the server and receives some data from the " "server::" msgstr "" -#: ../../library/multiprocessing.rst:2525 +#: ../../library/multiprocessing.rst:2532 msgid "" "The following code uses :func:`~multiprocessing.connection.wait` to wait for " "messages from multiple processes at once::" msgstr "" -#: ../../library/multiprocessing.rst:2564 +#: ../../library/multiprocessing.rst:2571 msgid "Address Formats" msgstr "" -#: ../../library/multiprocessing.rst:2566 +#: ../../library/multiprocessing.rst:2573 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:2569 +#: ../../library/multiprocessing.rst:2576 msgid "" "An ``'AF_UNIX'`` address is a string representing a filename on the " "filesystem." msgstr "" -#: ../../library/multiprocessing.rst:2572 +#: ../../library/multiprocessing.rst:2579 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 " @@ -2758,17 +2760,17 @@ msgid "" "samp:`r'\\\\\\\\{ServerName}\\\\pipe\\\\{PipeName}'` instead." msgstr "" -#: ../../library/multiprocessing.rst:2577 +#: ../../library/multiprocessing.rst:2584 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:2584 +#: ../../library/multiprocessing.rst:2591 msgid "Authentication keys" msgstr "" -#: ../../library/multiprocessing.rst:2586 +#: ../../library/multiprocessing.rst:2593 msgid "" "When one uses :meth:`Connection.recv `, the data received " "is automatically unpickled. Unfortunately unpickling data from an untrusted " @@ -2776,7 +2778,7 @@ msgid "" "use the :mod:`hmac` module to provide digest authentication." msgstr "" -#: ../../library/multiprocessing.rst:2592 +#: ../../library/multiprocessing.rst:2599 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 " @@ -2784,7 +2786,7 @@ msgid "" "using the same key does **not** involve sending the key over the connection.)" msgstr "" -#: ../../library/multiprocessing.rst:2598 +#: ../../library/multiprocessing.rst:2605 msgid "" "If authentication is requested but no authentication key is specified then " "the return value of ``current_process().authkey`` is used (see :class:" @@ -2795,17 +2797,17 @@ msgid "" "setting up connections between themselves." msgstr "" -#: ../../library/multiprocessing.rst:2606 +#: ../../library/multiprocessing.rst:2613 msgid "" "Suitable authentication keys can also be generated by using :func:`os." "urandom`." msgstr "" -#: ../../library/multiprocessing.rst:2610 +#: ../../library/multiprocessing.rst:2617 msgid "Logging" msgstr "" -#: ../../library/multiprocessing.rst:2612 +#: ../../library/multiprocessing.rst:2619 msgid "" "Some support for logging is available. Note, however, that the :mod:" "`logging` package does not use process shared locks so it is possible " @@ -2813,27 +2815,27 @@ msgid "" "mixed up." msgstr "" -#: ../../library/multiprocessing.rst:2619 +#: ../../library/multiprocessing.rst:2626 msgid "" "Returns the logger used by :mod:`multiprocessing`. If necessary, a new one " "will be created." msgstr "" -#: ../../library/multiprocessing.rst:2622 +#: ../../library/multiprocessing.rst:2629 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:2626 +#: ../../library/multiprocessing.rst:2633 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:2633 +#: ../../library/multiprocessing.rst:2640 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 " @@ -2841,25 +2843,25 @@ msgid "" "%(message)s'``." msgstr "" -#: ../../library/multiprocessing.rst:2638 +#: ../../library/multiprocessing.rst:2645 msgid "Below is an example session with logging turned on::" msgstr "" -#: ../../library/multiprocessing.rst:2653 +#: ../../library/multiprocessing.rst:2660 msgid "For a full table of logging levels, see the :mod:`logging` module." msgstr "" -#: ../../library/multiprocessing.rst:2657 +#: ../../library/multiprocessing.rst:2664 msgid "The :mod:`multiprocessing.dummy` module" msgstr "" -#: ../../library/multiprocessing.rst:2662 +#: ../../library/multiprocessing.rst:2669 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:2667 +#: ../../library/multiprocessing.rst:2674 msgid "" "In particular, the ``Pool`` function provided by :mod:`multiprocessing." "dummy` returns an instance of :class:`ThreadPool`, which is a subclass of :" @@ -2867,7 +2869,7 @@ msgid "" "worker threads rather than worker processes." msgstr "" -#: ../../library/multiprocessing.rst:2675 +#: ../../library/multiprocessing.rst:2682 msgid "" "A thread pool object which controls a pool of worker threads to which jobs " "can be submitted. :class:`ThreadPool` instances are fully interface " @@ -2877,18 +2879,18 @@ msgid "" "pool.Pool.terminate` manually." msgstr "" -#: ../../library/multiprocessing.rst:2682 +#: ../../library/multiprocessing.rst:2689 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:2688 +#: ../../library/multiprocessing.rst:2695 msgid "" "Unlike :class:`Pool`, *maxtasksperchild* and *context* cannot be provided." msgstr "" -#: ../../library/multiprocessing.rst:2692 +#: ../../library/multiprocessing.rst:2699 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 :" @@ -2898,7 +2900,7 @@ msgid "" "is not understood by any other libraries." msgstr "" -#: ../../library/multiprocessing.rst:2699 +#: ../../library/multiprocessing.rst:2706 msgid "" "Users should generally prefer to use :class:`concurrent.futures." "ThreadPoolExecutor`, which has a simpler interface that was designed around " @@ -2907,69 +2909,69 @@ msgid "" "`asyncio`." msgstr "" -#: ../../library/multiprocessing.rst:2709 +#: ../../library/multiprocessing.rst:2716 msgid "Programming guidelines" msgstr "" -#: ../../library/multiprocessing.rst:2711 +#: ../../library/multiprocessing.rst:2718 msgid "" "There are certain guidelines and idioms which should be adhered to when " "using :mod:`multiprocessing`." msgstr "" -#: ../../library/multiprocessing.rst:2716 +#: ../../library/multiprocessing.rst:2723 msgid "All start methods" msgstr "" -#: ../../library/multiprocessing.rst:2718 +#: ../../library/multiprocessing.rst:2725 msgid "The following applies to all start methods." msgstr "" -#: ../../library/multiprocessing.rst:2720 +#: ../../library/multiprocessing.rst:2727 msgid "Avoid shared state" msgstr "" -#: ../../library/multiprocessing.rst:2722 +#: ../../library/multiprocessing.rst:2729 msgid "" "As far as possible one should try to avoid shifting large amounts of data " "between processes." msgstr "" -#: ../../library/multiprocessing.rst:2725 +#: ../../library/multiprocessing.rst:2732 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:2729 +#: ../../library/multiprocessing.rst:2736 msgid "Picklability" msgstr "" -#: ../../library/multiprocessing.rst:2731 +#: ../../library/multiprocessing.rst:2738 msgid "Ensure that the arguments to the methods of proxies are picklable." msgstr "" -#: ../../library/multiprocessing.rst:2733 +#: ../../library/multiprocessing.rst:2740 msgid "Thread safety of proxies" msgstr "" -#: ../../library/multiprocessing.rst:2735 +#: ../../library/multiprocessing.rst:2742 msgid "" "Do not use a proxy object from more than one thread unless you protect it " "with a lock." msgstr "" -#: ../../library/multiprocessing.rst:2738 +#: ../../library/multiprocessing.rst:2745 msgid "" "(There is never a problem with different processes using the *same* proxy.)" msgstr "" -#: ../../library/multiprocessing.rst:2740 +#: ../../library/multiprocessing.rst:2747 msgid "Joining zombie processes" msgstr "" -#: ../../library/multiprocessing.rst:2742 +#: ../../library/multiprocessing.rst:2749 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 :" @@ -2980,11 +2982,11 @@ msgid "" "all the processes that you start." msgstr "" -#: ../../library/multiprocessing.rst:2750 +#: ../../library/multiprocessing.rst:2757 msgid "Better to inherit than pickle/unpickle" msgstr "" -#: ../../library/multiprocessing.rst:2752 +#: ../../library/multiprocessing.rst:2759 msgid "" "When using the *spawn* or *forkserver* start methods many types from :mod:" "`multiprocessing` need to be picklable so that child processes can use " @@ -2994,11 +2996,11 @@ msgid "" "inherit it from an ancestor process." msgstr "" -#: ../../library/multiprocessing.rst:2760 +#: ../../library/multiprocessing.rst:2767 msgid "Avoid terminating processes" msgstr "" -#: ../../library/multiprocessing.rst:2762 +#: ../../library/multiprocessing.rst:2769 msgid "" "Using the :meth:`Process.terminate ` " "method to stop a process is liable to cause any shared resources (such as " @@ -3006,18 +3008,18 @@ msgid "" "become broken or unavailable to other processes." msgstr "" -#: ../../library/multiprocessing.rst:2768 +#: ../../library/multiprocessing.rst:2775 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:2772 +#: ../../library/multiprocessing.rst:2779 msgid "Joining processes that use queues" msgstr "" -#: ../../library/multiprocessing.rst:2774 +#: ../../library/multiprocessing.rst:2781 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 " @@ -3026,7 +3028,7 @@ msgid "" "queue to avoid this behaviour.)" msgstr "" -#: ../../library/multiprocessing.rst:2780 +#: ../../library/multiprocessing.rst:2787 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 " @@ -3035,21 +3037,21 @@ msgid "" "processes will be joined automatically." msgstr "" -#: ../../library/multiprocessing.rst:2786 +#: ../../library/multiprocessing.rst:2793 msgid "An example which will deadlock is the following::" msgstr "" -#: ../../library/multiprocessing.rst:2800 +#: ../../library/multiprocessing.rst:2807 msgid "" "A fix here would be to swap the last two lines (or simply remove the ``p." "join()`` line)." msgstr "" -#: ../../library/multiprocessing.rst:2803 +#: ../../library/multiprocessing.rst:2810 msgid "Explicitly pass resources to child processes" msgstr "" -#: ../../library/multiprocessing.rst:2805 +#: ../../library/multiprocessing.rst:2812 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. " @@ -3057,7 +3059,7 @@ msgid "" "for the child process." msgstr "" -#: ../../library/multiprocessing.rst:2810 +#: ../../library/multiprocessing.rst:2817 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 " @@ -3066,29 +3068,29 @@ msgid "" "collected in the parent process." msgstr "" -#: ../../library/multiprocessing.rst:2817 +#: ../../library/multiprocessing.rst:2824 msgid "So for instance ::" msgstr "" -#: ../../library/multiprocessing.rst:2829 +#: ../../library/multiprocessing.rst:2836 msgid "should be rewritten as ::" msgstr "" -#: ../../library/multiprocessing.rst:2841 +#: ../../library/multiprocessing.rst:2848 msgid "Beware of replacing :data:`sys.stdin` with a \"file like object\"" msgstr "" -#: ../../library/multiprocessing.rst:2843 +#: ../../library/multiprocessing.rst:2850 msgid ":mod:`multiprocessing` originally unconditionally called::" msgstr "" -#: ../../library/multiprocessing.rst:2847 +#: ../../library/multiprocessing.rst:2854 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:2853 +#: ../../library/multiprocessing.rst:2860 msgid "" "Which solves the fundamental issue of processes colliding with each other " "resulting in a bad file descriptor error, but introduces a potential danger " @@ -3098,33 +3100,33 @@ msgid "" "data being flushed to the object multiple times, resulting in corruption." msgstr "" -#: ../../library/multiprocessing.rst:2860 +#: ../../library/multiprocessing.rst:2867 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:2872 +#: ../../library/multiprocessing.rst:2879 msgid "" "For more information, see :issue:`5155`, :issue:`5313` and :issue:`5331`" msgstr "" -#: ../../library/multiprocessing.rst:2875 +#: ../../library/multiprocessing.rst:2882 msgid "The *spawn* and *forkserver* start methods" msgstr "" -#: ../../library/multiprocessing.rst:2877 +#: ../../library/multiprocessing.rst:2884 msgid "" "There are a few extra restriction which don't apply to the *fork* start " "method." msgstr "" -#: ../../library/multiprocessing.rst:2880 +#: ../../library/multiprocessing.rst:2887 msgid "More picklability" msgstr "" -#: ../../library/multiprocessing.rst:2882 +#: ../../library/multiprocessing.rst:2889 msgid "" "Ensure that all arguments to :meth:`Process.__init__` are picklable. Also, " "if you subclass :class:`~multiprocessing.Process` then make sure that " @@ -3132,11 +3134,11 @@ msgid "" "Process.start>` method is called." msgstr "" -#: ../../library/multiprocessing.rst:2887 +#: ../../library/multiprocessing.rst:2894 msgid "Global variables" msgstr "" -#: ../../library/multiprocessing.rst:2889 +#: ../../library/multiprocessing.rst:2896 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 " @@ -3144,66 +3146,66 @@ msgid "" "Process.start>` was called." msgstr "" -#: ../../library/multiprocessing.rst:2894 +#: ../../library/multiprocessing.rst:2901 msgid "" "However, global variables which are just module level constants cause no " "problems." msgstr "" -#: ../../library/multiprocessing.rst:2897 +#: ../../library/multiprocessing.rst:2904 msgid "Safe importing of main module" msgstr "" -#: ../../library/multiprocessing.rst:2899 +#: ../../library/multiprocessing.rst:2906 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:2903 +#: ../../library/multiprocessing.rst:2910 msgid "" "For example, using the *spawn* or *forkserver* start method running the " "following module would fail with a :exc:`RuntimeError`::" msgstr "" -#: ../../library/multiprocessing.rst:2915 +#: ../../library/multiprocessing.rst:2922 msgid "" "Instead one should protect the \"entry point\" of the program by using ``if " "__name__ == '__main__':`` as follows::" msgstr "" -#: ../../library/multiprocessing.rst:2929 +#: ../../library/multiprocessing.rst:2936 msgid "" "(The ``freeze_support()`` line can be omitted if the program will be run " "normally instead of frozen.)" msgstr "" -#: ../../library/multiprocessing.rst:2932 +#: ../../library/multiprocessing.rst:2939 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:2935 +#: ../../library/multiprocessing.rst:2942 msgid "" "Similar restrictions apply if a pool or manager is created in the main " "module." msgstr "" -#: ../../library/multiprocessing.rst:2942 +#: ../../library/multiprocessing.rst:2949 msgid "Examples" msgstr "" -#: ../../library/multiprocessing.rst:2944 +#: ../../library/multiprocessing.rst:2951 msgid "Demonstration of how to create and use customized managers and proxies:" msgstr "" -#: ../../library/multiprocessing.rst:2950 +#: ../../library/multiprocessing.rst:2957 msgid "Using :class:`~multiprocessing.pool.Pool`:" msgstr "" -#: ../../library/multiprocessing.rst:2956 +#: ../../library/multiprocessing.rst:2963 msgid "" "An example showing how to use queues to feed tasks to a collection of worker " "processes and collect the results:" diff --git a/library/os.po b/library/os.po index b83f697931..0d028209a1 100644 --- a/library/os.po +++ b/library/os.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-13 00:11+0000\n" +"POT-Creation-Date: 2021-09-24 00:11+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-" @@ -2883,7 +2883,7 @@ msgid "" msgstr "" #: ../../library/os.rst:2660 -msgid "On Mac OS systems, the following attributes may also be available:" +msgid "On macOS systems, the following attributes may also be available:" msgstr "" #: ../../library/os.rst:2664 diff --git a/library/platform.po b/library/platform.po index 8c2b48f5a2..240d43ae26 100644 --- a/library/platform.po +++ b/library/platform.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-13 00:11+0000\n" +"POT-Creation-Date: 2021-09-24 00:11+0000\n" "PO-Revision-Date: 2018-05-23 16:08+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -276,12 +276,12 @@ msgid "" msgstr "" #: ../../library/platform.rst:229 -msgid "Mac OS Platform" +msgid "macOS Platform" msgstr "" #: ../../library/platform.rst:234 msgid "" -"Get Mac OS version information and return it as tuple ``(release, " +"Get macOS version information and return it as tuple ``(release, " "versioninfo, machine)`` with *versioninfo* being a tuple ``(version, " "dev_stage, non_release_version)``." msgstr "" diff --git a/library/plistlib.po b/library/plistlib.po index a0bcbbb5b5..c75c00b7f4 100644 --- a/library/plistlib.po +++ b/library/plistlib.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-20 18:08+0800\n" +"POT-Creation-Date: 2021-09-29 00:11+0000\n" "PO-Revision-Date: 2016-01-31 07:27+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -198,7 +198,7 @@ msgstr "" #: ../../library/plistlib.rst:135 msgid "" "It has one attribute, :attr:`data`, which can be used to retrieve the int " -"value of the UID. :attr:`data` must be in the range `0 <= data < 2**64`." +"value of the UID. :attr:`data` must be in the range ``0 <= data < 2**64``." msgstr "" #: ../../library/plistlib.rst:141 diff --git a/library/profile.po b/library/profile.po index 0ea0d6b81d..67a1b27cd1 100644 --- a/library/profile.po +++ b/library/profile.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-20 18:08+0800\n" +"POT-Creation-Date: 2021-09-24 00:11+0000\n" "PO-Revision-Date: 2018-05-23 16:08+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -869,7 +869,7 @@ msgid "" "The method executes the number of Python calls given by the argument, " "directly and again under the profiler, measuring the time for both. It then " "computes the hidden overhead per profiler event, and returns that as a " -"float. For example, on a 1.8Ghz Intel Core i5 running Mac OS X, and using " +"float. For example, on a 1.8Ghz Intel Core i5 running macOS, and using " "Python's time.process_time() as the timer, the magical number is about " "4.04e-6." msgstr "" diff --git a/library/select.po b/library/select.po index 5720292c19..6ce03730b1 100644 --- a/library/select.po +++ b/library/select.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-20 18:08+0800\n" +"POT-Creation-Date: 2021-09-24 00:11+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-" @@ -714,7 +714,7 @@ msgid ":const:`KQ_FILTER_NETDEV`" msgstr "" #: ../../library/select.rst:536 -msgid "Watch for events on a network device [not available on Mac OS X]" +msgid "Watch for events on a network device [not available on macOS]" msgstr "" #: ../../library/select.rst:539 @@ -954,7 +954,7 @@ msgid "unable to attach to a child" msgstr "" #: ../../library/select.rst:629 -msgid ":const:`KQ_FILTER_NETDEV` filter flags (not available on Mac OS X):" +msgid ":const:`KQ_FILTER_NETDEV` filter flags (not available on macOS):" msgstr "" #: ../../library/select.rst:634 diff --git a/library/site.po b/library/site.po index 586ac9c2c9..848226700f 100644 --- a/library/site.po +++ b/library/site.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-13 00:11+0000\n" +"POT-Creation-Date: 2021-09-24 00:11+0000\n" "PO-Revision-Date: 2018-05-23 16:10+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -54,7 +54,7 @@ msgid "" "part. For the head part, it uses ``sys.prefix`` and ``sys.exec_prefix``; " "empty heads are skipped. For the tail part, it uses the empty string and " "then :file:`lib/site-packages` (on Windows) or :file:`lib/python{X.Y}/site-" -"packages` (on Unix and Macintosh). For each of the distinct head-tail " +"packages` (on Unix and macOS). For each of the distinct head-tail " "combinations, it sees if it refers to an existing directory, and if so, adds " "it to ``sys.path`` and also inspects the newly added path for configuration " "files." @@ -201,8 +201,8 @@ msgstr "" msgid "" "Path to the user site-packages for the running Python. Can be ``None`` if :" "func:`getusersitepackages` hasn't been called yet. Default value is :file:" -"`~/.local/lib/python{X.Y}/site-packages` for UNIX and non-framework Mac OS X " -"builds, :file:`~/Library/Python/{X.Y}/lib/python/site-packages` for Mac " +"`~/.local/lib/python{X.Y}/site-packages` for UNIX and non-framework macOS " +"builds, :file:`~/Library/Python/{X.Y}/lib/python/site-packages` for macOS " "framework builds, and :file:`{%APPDATA%}\\\\Python\\\\Python{XY}\\\\site-" "packages` on Windows. This directory is a site directory, which means that :" "file:`.pth` files in it will be processed." @@ -212,8 +212,8 @@ msgstr "" msgid "" "Path to the base directory for the user site-packages. Can be ``None`` if :" "func:`getuserbase` hasn't been called yet. Default value is :file:`~/." -"local` for UNIX and Mac OS X non-framework builds, :file:`~/Library/Python/" -"{X.Y}` for Mac framework builds, and :file:`{%APPDATA%}\\\\Python` for " +"local` for UNIX and macOS non-framework builds, :file:`~/Library/Python/{X.Y}" +"` for macOS framework builds, and :file:`{%APPDATA%}\\\\Python` for " "Windows. This value is used by Distutils to compute the installation " "directories for scripts, data files, Python modules, etc. for the :ref:`user " "installation scheme `. See also :envvar:" diff --git a/library/socket.po b/library/socket.po index 8a8a645d7a..80cae64d48 100644 --- a/library/socket.po +++ b/library/socket.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-13 00:11+0000\n" +"POT-Creation-Date: 2021-10-06 00:11+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 @@ msgid ":ref:`Availability `: Linux >= 4.8." msgstr "" #: ../../library/socket.rst:510 -msgid ":ref:`Availability `: BSD, OSX." +msgid ":ref:`Availability `: BSD, macOS." msgstr "" #: ../../library/socket.rst:515 @@ -972,13 +972,13 @@ msgstr "" #: ../../library/socket.rst:816 msgid "" "Translate a host name to IPv4 address format, extended interface. Return a " -"triple ``(hostname, aliaslist, ipaddrlist)`` where *hostname* is the primary " -"host name responding to the given *ip_address*, *aliaslist* is a (possibly " -"empty) list of alternative host names for the same address, and *ipaddrlist* " -"is a list of IPv4 addresses for the same interface on the same host (often " -"but not always a single address). :func:`gethostbyname_ex` does not support " -"IPv6 name resolution, and :func:`getaddrinfo` should be used instead for " -"IPv4/v6 dual stack support." +"triple ``(hostname, aliaslist, ipaddrlist)`` where *hostname* is the host's " +"primary host name, *aliaslist* is a (possibly empty) list of alternative " +"host names for the same address, and *ipaddrlist* is a list of IPv4 " +"addresses for the same interface on the same host (often but not always a " +"single address). :func:`gethostbyname_ex` does not support IPv6 name " +"resolution, and :func:`getaddrinfo` should be used instead for IPv4/v6 dual " +"stack support." msgstr "" #: ../../library/socket.rst:830 diff --git a/library/sqlite3.po b/library/sqlite3.po index dcf275a506..24224fd3cd 100644 --- a/library/sqlite3.po +++ b/library/sqlite3.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-16 00:12+0000\n" +"POT-Creation-Date: 2021-10-06 00:11+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-" @@ -595,8 +595,8 @@ msgstr "" msgid "" "Using this attribute you can control what objects are returned for the " "``TEXT`` data type. By default, this attribute is set to :class:`str` and " -"the :mod:`sqlite3` module will return Unicode objects for ``TEXT``. If you " -"want to return bytestrings instead, you can set it to :class:`bytes`." +"the :mod:`sqlite3` module will return :class:`str` objects for ``TEXT``. If " +"you want to return :class:`bytes` instead, you can set it to :class:`bytes`." msgstr "" #: ../../library/sqlite3.rst:519 @@ -1276,7 +1276,7 @@ msgstr "註解" #: ../../library/sqlite3.rst:1101 msgid "" "The sqlite3 module is not built with loadable extension support by default, " -"because some platforms (notably Mac OS X) have SQLite libraries which are " +"because some platforms (notably macOS) have SQLite libraries which are " "compiled without this feature. To get loadable extension support, you must " "pass ``--enable-loadable-sqlite-extensions`` to configure." msgstr "" diff --git a/library/ssl.po b/library/ssl.po index 1d72001e3e..613381daf6 100644 --- a/library/ssl.po +++ b/library/ssl.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-13 00:11+0000\n" +"POT-Creation-Date: 2021-09-24 00:11+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-" @@ -31,9 +31,9 @@ msgid "" "This module provides access to Transport Layer Security (often known as " "\"Secure Sockets Layer\") encryption and peer authentication facilities for " "network sockets, both client-side and server-side. This module uses the " -"OpenSSL library. It is available on all modern Unix systems, Windows, Mac OS " -"X, and probably additional platforms, as long as OpenSSL is installed on " -"that platform." +"OpenSSL library. It is available on all modern Unix systems, Windows, macOS, " +"and probably additional platforms, as long as OpenSSL is installed on that " +"platform." msgstr "" #: ../../library/ssl.rst:26 diff --git a/library/stat.po b/library/stat.po index 1e59f3d334..07b590b4f8 100644 --- a/library/stat.po +++ b/library/stat.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-20 18:08+0800\n" +"POT-Creation-Date: 2021-09-24 00:11+0000\n" "PO-Revision-Date: 2016-11-19 00:34+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -372,11 +372,11 @@ msgid "The file may not be renamed or deleted." msgstr "" #: ../../library/stat.rst:375 -msgid "The file is stored compressed (Mac OS X 10.6+)." +msgid "The file is stored compressed (macOS 10.6+)." msgstr "" #: ../../library/stat.rst:379 -msgid "The file should not be displayed in a GUI (Mac OS X 10.5+)." +msgid "The file should not be displayed in a GUI (macOS 10.5+)." msgstr "" #: ../../library/stat.rst:383 @@ -389,7 +389,7 @@ msgstr "" #: ../../library/stat.rst:401 msgid "" -"See the \\*BSD or Mac OS systems man page :manpage:`chflags(2)` for more " +"See the \\*BSD or macOS systems man page :manpage:`chflags(2)` for more " "information." msgstr "" diff --git a/library/sysconfig.po b/library/sysconfig.po index 6ce7436008..388cd8450f 100644 --- a/library/sysconfig.po +++ b/library/sysconfig.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-13 00:11+0000\n" +"POT-Creation-Date: 2021-09-24 00:11+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-" @@ -110,8 +110,8 @@ msgstr "" #: ../../library/sysconfig.rst:77 msgid "" -"*posix_prefix*: scheme for POSIX platforms like Linux or Mac OS X. This is " -"the default scheme used when Python or a component is installed." +"*posix_prefix*: scheme for POSIX platforms like Linux or macOS. This is the " +"default scheme used when Python or a component is installed." msgstr "" #: ../../library/sysconfig.rst:79 @@ -322,7 +322,7 @@ msgid "win32 (all others - specifically, sys.platform is returned)" msgstr "" #: ../../library/sysconfig.rst:191 -msgid "Mac OS X can return:" +msgid "macOS can return:" msgstr "" #: ../../library/sysconfig.rst:193 diff --git a/library/test.po b/library/test.po index 8f6de9b610..6673393959 100644 --- a/library/test.po +++ b/library/test.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-13 00:11+0000\n" +"POT-Creation-Date: 2021-10-07 00:10+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-" @@ -508,7 +508,7 @@ msgstr "" #: ../../library/test.rst:459 msgid "" "Call :func:`os.unlink` on *filename*. On Windows platforms, this is wrapped " -"with a wait loop that checks for the existence fo the file." +"with a wait loop that checks for the existence of the file." msgstr "" #: ../../library/test.rst:465 @@ -973,8 +973,8 @@ msgstr "" #: ../../library/test.rst:928 msgid "" -"Decorator for the minimum version when running test on Mac OS X. If the MAC " -"OS X version is less than the minimum, raise :exc:`unittest.SkipTest`." +"Decorator for the minimum version when running test on macOS. If the macOS " +"version is less than the minimum, raise :exc:`unittest.SkipTest`." msgstr "" #: ../../library/test.rst:934 @@ -1194,7 +1194,7 @@ msgid "" msgstr "" #: ../../library/test.rst:1148 -msgid "Attributes set when an exception is catched:" +msgid "Attributes set when an exception is caught:" msgstr "" #: ../../library/test.rst:1150 diff --git a/library/tkinter.ttk.po b/library/tkinter.ttk.po index 6108206774..bafe8e0116 100644 --- a/library/tkinter.ttk.po +++ b/library/tkinter.ttk.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-20 18:08+0800\n" +"POT-Creation-Date: 2021-09-24 00:11+0000\n" "PO-Revision-Date: 2018-05-23 16:13+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1153,7 +1153,7 @@ msgstr "" #: ../../library/tkinter.ttk.rst:762 msgid "" -"On MacOS X, toplevel windows automatically include a built-in size grip by " +"On macOS, toplevel windows automatically include a built-in size grip by " "default. Adding a :class:`Sizegrip` is harmless, since the built-in grip " "will just mask the widget." msgstr "" diff --git a/library/tracemalloc.po b/library/tracemalloc.po index 74faa4381c..bb8eb18f9e 100644 --- a/library/tracemalloc.po +++ b/library/tracemalloc.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-20 18:08+0800\n" +"POT-Creation-Date: 2021-09-18 00:10+0000\n" "PO-Revision-Date: 2018-05-23 16:13+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -771,12 +771,12 @@ msgstr "" #: ../../library/tracemalloc.rst:743 msgid "" -"Format the traceback as a list of lines with newlines. Use the :mod:" -"`linecache` module to retrieve lines from the source code. If *limit* is " -"set, format the *limit* most recent frames if *limit* is positive. " -"Otherwise, format the ``abs(limit)`` oldest frames. If *most_recent_first* " -"is ``True``, the order of the formatted frames is reversed, returning the " -"most recent frame first instead of last." +"Format the traceback as a list of lines. Use the :mod:`linecache` module to " +"retrieve lines from the source code. If *limit* is set, format the *limit* " +"most recent frames if *limit* is positive. Otherwise, format the " +"``abs(limit)`` oldest frames. If *most_recent_first* is ``True``, the order " +"of the formatted frames is reversed, returning the most recent frame first " +"instead of last." msgstr "" #: ../../library/tracemalloc.rst:750 diff --git a/library/types.po b/library/types.po index fd0530d92a..5c23d21417 100644 --- a/library/types.po +++ b/library/types.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-13 00:11+0000\n" +"POT-Creation-Date: 2021-10-07 00:10+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-" @@ -289,7 +289,7 @@ msgstr "" #: ../../library/types.rst:231 msgid "" "A future version of Python may stop setting this attribute by default. To " -"guard against this potential change, preferrably read from the :attr:" +"guard against this potential change, preferably read from the :attr:" "`__spec__` attribute instead or use ``getattr(module, \"__loader__\", " "None)`` if you explicitly need to use this attribute." msgstr "" @@ -321,7 +321,7 @@ msgstr "" #: ../../library/types.rst:256 msgid "" "A future version of Python may stop setting this attribute by default. To " -"guard against this potential change, preferrably read from the :attr:" +"guard against this potential change, preferably read from the :attr:" "`__spec__` attribute instead or use ``getattr(module, \"__package__\", " "None)`` if you explicitly need to use this attribute." msgstr "" diff --git a/library/urllib.request.po b/library/urllib.request.po index f2e563276b..29cefe43f1 100644 --- a/library/urllib.request.po +++ b/library/urllib.request.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-13 00:11+0000\n" +"POT-Creation-Date: 2021-09-24 00:11+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-" @@ -239,10 +239,9 @@ msgid "" "This helper function returns a dictionary of scheme to proxy server URL " "mappings. It scans the environment for variables named ``_proxy``, " "in a case insensitive approach, for all operating systems first, and when it " -"cannot find it, looks for proxy information from Mac OSX System " -"Configuration for Mac OS X and Windows Systems Registry for Windows. If both " -"lowercase and uppercase environment variables exist (and disagree), " -"lowercase is preferred." +"cannot find it, looks for proxy information from System Configuration for " +"macOS and Windows Systems Registry for Windows. If both lowercase and " +"uppercase environment variables exist (and disagree), lowercase is preferred." msgstr "" #: ../../library/urllib.request.rst:174 @@ -404,7 +403,7 @@ msgid "" "the list of proxies from the environment variables ``_proxy``. If " "no proxy environment variables are set, then in a Windows environment proxy " "settings are obtained from the registry's Internet Settings section, and in " -"a Mac OS X environment proxy information is retrieved from the OS X System " +"a macOS environment proxy information is retrieved from the System " "Configuration Framework." msgstr "" @@ -770,7 +769,7 @@ msgid "" "optional *timeout* parameter specifies a timeout in seconds for blocking " "operations like the connection attempt (if not specified, the global default " "timeout setting will be used). The timeout feature actually works only for " -"HTTP, HTTPS and FTP connections)." +"HTTP, HTTPS and FTP connections." msgstr "" #: ../../library/urllib.request.rst:658 diff --git a/library/weakref.po b/library/weakref.po index 7b6bbcb9da..f6088c9329 100644 --- a/library/weakref.po +++ b/library/weakref.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-20 18:08+0800\n" +"POT-Creation-Date: 2021-10-07 00:10+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-" @@ -129,7 +129,15 @@ msgid "" "`weakref-support`." msgstr "" -#: ../../library/weakref.rst:94 +#: ../../library/weakref.rst:91 +msgid "" +"When ``__slots__`` are defined for a given type, weak reference support is " +"disabled unless a ``'__weakref__'`` string is also present in the sequence " +"of strings in the ``__slots__`` declaration. See :ref:`__slots__ " +"documentation ` for details." +msgstr "" + +#: ../../library/weakref.rst:98 msgid "" "Return a weak reference to *object*. The original object can be retrieved " "by calling the reference object if the referent is still alive; if the " @@ -141,21 +149,21 @@ msgid "" "available." msgstr "" -#: ../../library/weakref.rst:102 +#: ../../library/weakref.rst:106 msgid "" "It is allowable for many weak references to be constructed for the same " "object. Callbacks registered for each weak reference will be called from the " "most recently registered callback to the oldest registered callback." msgstr "" -#: ../../library/weakref.rst:106 +#: ../../library/weakref.rst:110 msgid "" "Exceptions raised by the callback will be noted on the standard error " "output, but cannot be propagated; they are handled in exactly the same way " "as exceptions raised from an object's :meth:`__del__` method." msgstr "" -#: ../../library/weakref.rst:110 +#: ../../library/weakref.rst:114 msgid "" "Weak references are :term:`hashable` if the *object* is hashable. They will " "maintain their hash value even after the *object* was deleted. If :func:" @@ -163,7 +171,7 @@ msgid "" "call will raise :exc:`TypeError`." msgstr "" -#: ../../library/weakref.rst:115 +#: ../../library/weakref.rst:119 msgid "" "Weak references support tests for equality, but not ordering. If the " "referents are still alive, two references have the same equality " @@ -172,22 +180,22 @@ msgid "" "objects are the same object." msgstr "" -#: ../../library/weakref.rst:120 +#: ../../library/weakref.rst:124 msgid "This is a subclassable type rather than a factory function." msgstr "" -#: ../../library/weakref.rst:124 +#: ../../library/weakref.rst:128 msgid "" "This read-only attribute returns the callback currently associated to the " "weakref. If there is no callback or if the referent of the weakref is no " "longer alive then this attribute will have value ``None``." msgstr "" -#: ../../library/weakref.rst:128 +#: ../../library/weakref.rst:132 msgid "Added the :attr:`__callback__` attribute." msgstr "" -#: ../../library/weakref.rst:134 +#: ../../library/weakref.rst:138 msgid "" "Return a proxy to *object* which uses a weak reference. This supports use " "of the proxy in most contexts instead of requiring the explicit " @@ -200,24 +208,24 @@ msgid "" "`ref` function." msgstr "" -#: ../../library/weakref.rst:143 +#: ../../library/weakref.rst:147 msgid "" "Extended the operator support on proxy objects to include the matrix " "multiplication operators ``@`` and ``@=``." msgstr "" -#: ../../library/weakref.rst:150 +#: ../../library/weakref.rst:154 msgid "" "Return the number of weak references and proxies which refer to *object*." msgstr "" -#: ../../library/weakref.rst:155 +#: ../../library/weakref.rst:159 msgid "" "Return a list of all weak reference and proxy objects which refer to " "*object*." msgstr "" -#: ../../library/weakref.rst:160 +#: ../../library/weakref.rst:164 msgid "" "Mapping class that references keys weakly. Entries in the dictionary will " "be discarded when there is no longer a strong reference to the key. This " @@ -226,11 +234,11 @@ msgid "" "especially useful with objects that override attribute accesses." msgstr "" -#: ../../library/weakref.rst:166 +#: ../../library/weakref.rst:170 msgid "Added support for ``|`` and ``|=`` operators, specified in :pep:`584`." msgstr "" -#: ../../library/weakref.rst:169 +#: ../../library/weakref.rst:173 msgid "" ":class:`WeakKeyDictionary` objects have an additional method that exposes " "the internal references directly. The references are not guaranteed to be " @@ -240,39 +248,39 @@ msgid "" "longer than needed." msgstr "" -#: ../../library/weakref.rst:179 +#: ../../library/weakref.rst:183 msgid "Return an iterable of the weak references to the keys." msgstr "" -#: ../../library/weakref.rst:184 +#: ../../library/weakref.rst:188 msgid "" "Mapping class that references values weakly. Entries in the dictionary will " "be discarded when no strong reference to the value exists any more." msgstr "" -#: ../../library/weakref.rst:187 +#: ../../library/weakref.rst:191 msgid "" "Added support for ``|`` and ``|=`` operators, as specified in :pep:`584`." msgstr "" -#: ../../library/weakref.rst:190 +#: ../../library/weakref.rst:194 msgid "" ":class:`WeakValueDictionary` objects have an additional method that has the " "same issues as the :meth:`keyrefs` method of :class:`WeakKeyDictionary` " "objects." msgstr "" -#: ../../library/weakref.rst:197 +#: ../../library/weakref.rst:201 msgid "Return an iterable of the weak references to the values." msgstr "" -#: ../../library/weakref.rst:202 +#: ../../library/weakref.rst:206 msgid "" "Set class that keeps weak references to its elements. An element will be " "discarded when no strong reference to it exists any more." msgstr "" -#: ../../library/weakref.rst:208 +#: ../../library/weakref.rst:212 msgid "" "A custom :class:`ref` subclass which simulates a weak reference to a bound " "method (i.e., a method defined on a class and looked up on an instance). " @@ -281,7 +289,7 @@ msgid "" "method until either the object or the original function dies::" msgstr "" -#: ../../library/weakref.rst:236 +#: ../../library/weakref.rst:240 msgid "" "Return a callable finalizer object which will be called when *obj* is " "garbage collected. Unlike an ordinary weak reference, a finalizer will " @@ -289,7 +297,7 @@ msgid "" "lifecycle management." msgstr "" -#: ../../library/weakref.rst:241 +#: ../../library/weakref.rst:245 msgid "" "A finalizer is considered *alive* until it is called (either explicitly or " "at garbage collection), and after that it is *dead*. Calling a live " @@ -297,7 +305,7 @@ msgid "" "calling a dead finalizer returns :const:`None`." msgstr "" -#: ../../library/weakref.rst:246 +#: ../../library/weakref.rst:250 msgid "" "Exceptions raised by finalizer callbacks during garbage collection will be " "shown on the standard error output, but cannot be propagated. They are " @@ -305,50 +313,50 @@ msgid "" "`__del__` method or a weak reference's callback." msgstr "" -#: ../../library/weakref.rst:252 +#: ../../library/weakref.rst:256 msgid "" "When the program exits, each remaining live finalizer is called unless its :" "attr:`atexit` attribute has been set to false. They are called in reverse " "order of creation." msgstr "" -#: ../../library/weakref.rst:256 +#: ../../library/weakref.rst:260 msgid "" "A finalizer will never invoke its callback during the later part of the :" "term:`interpreter shutdown` when module globals are liable to have been " "replaced by :const:`None`." msgstr "" -#: ../../library/weakref.rst:262 +#: ../../library/weakref.rst:266 msgid "" "If *self* is alive then mark it as dead and return the result of calling " "``func(*args, **kwargs)``. If *self* is dead then return :const:`None`." msgstr "" -#: ../../library/weakref.rst:268 +#: ../../library/weakref.rst:272 msgid "" "If *self* is alive then mark it as dead and return the tuple ``(obj, func, " "args, kwargs)``. If *self* is dead then return :const:`None`." msgstr "" -#: ../../library/weakref.rst:274 +#: ../../library/weakref.rst:278 msgid "" "If *self* is alive then return the tuple ``(obj, func, args, kwargs)``. If " "*self* is dead then return :const:`None`." msgstr "" -#: ../../library/weakref.rst:279 +#: ../../library/weakref.rst:283 msgid "Property which is true if the finalizer is alive, false otherwise." msgstr "" -#: ../../library/weakref.rst:283 +#: ../../library/weakref.rst:287 msgid "" "A writable boolean property which by default is true. When the program " "exits, it calls all remaining live finalizers for which :attr:`.atexit` is " "true. They are called in reverse order of creation." msgstr "" -#: ../../library/weakref.rst:290 +#: ../../library/weakref.rst:294 msgid "" "It is important to ensure that *func*, *args* and *kwargs* do not own any " "references to *obj*, either directly or indirectly, since otherwise *obj* " @@ -356,60 +364,60 @@ msgid "" "bound method of *obj*." msgstr "" -#: ../../library/weakref.rst:300 +#: ../../library/weakref.rst:304 msgid "The type object for weak references objects." msgstr "" -#: ../../library/weakref.rst:305 +#: ../../library/weakref.rst:309 msgid "The type object for proxies of objects which are not callable." msgstr "" -#: ../../library/weakref.rst:310 +#: ../../library/weakref.rst:314 msgid "The type object for proxies of callable objects." msgstr "" -#: ../../library/weakref.rst:315 +#: ../../library/weakref.rst:319 msgid "" "Sequence containing all the type objects for proxies. This can make it " "simpler to test if an object is a proxy without being dependent on naming " "both proxy types." msgstr "" -#: ../../library/weakref.rst:323 +#: ../../library/weakref.rst:327 msgid ":pep:`205` - Weak References" msgstr "" -#: ../../library/weakref.rst:323 +#: ../../library/weakref.rst:327 msgid "" "The proposal and rationale for this feature, including links to earlier " "implementations and information about similar features in other languages." msgstr "" -#: ../../library/weakref.rst:330 +#: ../../library/weakref.rst:334 msgid "Weak Reference Objects" msgstr "" -#: ../../library/weakref.rst:332 +#: ../../library/weakref.rst:336 msgid "" "Weak reference objects have no methods and no attributes besides :attr:`ref." "__callback__`. A weak reference object allows the referent to be obtained, " "if it still exists, by calling it:" msgstr "" -#: ../../library/weakref.rst:346 +#: ../../library/weakref.rst:350 msgid "" "If the referent no longer exists, calling the reference object returns :" "const:`None`:" msgstr "" -#: ../../library/weakref.rst:353 +#: ../../library/weakref.rst:357 msgid "" "Testing that a weak reference object is still live should be done using the " "expression ``ref() is not None``. Normally, application code that needs to " "use a reference object should follow this pattern::" msgstr "" -#: ../../library/weakref.rst:366 +#: ../../library/weakref.rst:370 msgid "" "Using a separate test for \"liveness\" creates race conditions in threaded " "applications; another thread can cause a weak reference to become " @@ -417,7 +425,7 @@ msgid "" "safe in threaded applications as well as single-threaded applications." msgstr "" -#: ../../library/weakref.rst:371 +#: ../../library/weakref.rst:375 msgid "" "Specialized versions of :class:`ref` objects can be created through " "subclassing. This is used in the implementation of the :class:" @@ -427,18 +435,18 @@ msgid "" "to retrieve the referent." msgstr "" -#: ../../library/weakref.rst:377 +#: ../../library/weakref.rst:381 msgid "" "This example shows how a subclass of :class:`ref` can be used to store " "additional information about an object and affect the value that's returned " "when the referent is accessed::" msgstr "" -#: ../../library/weakref.rst:404 +#: ../../library/weakref.rst:408 msgid "Example" msgstr "" -#: ../../library/weakref.rst:406 +#: ../../library/weakref.rst:410 msgid "" "This simple example shows how an application can use object IDs to retrieve " "objects that it has seen before. The IDs of the objects can then be used in " @@ -446,67 +454,67 @@ msgid "" "objects can still be retrieved by ID if they do." msgstr "" -#: ../../library/weakref.rst:431 +#: ../../library/weakref.rst:435 msgid "Finalizer Objects" msgstr "" -#: ../../library/weakref.rst:433 +#: ../../library/weakref.rst:437 msgid "" "The main benefit of using :class:`finalize` is that it makes it simple to " "register a callback without needing to preserve the returned finalizer " "object. For instance" msgstr "" -#: ../../library/weakref.rst:447 +#: ../../library/weakref.rst:451 msgid "" "The finalizer can be called directly as well. However the finalizer will " "invoke the callback at most once." msgstr "" -#: ../../library/weakref.rst:463 +#: ../../library/weakref.rst:467 msgid "" "You can unregister a finalizer using its :meth:`~finalize.detach` method. " "This kills the finalizer and returns the arguments passed to the constructor " "when it was created." msgstr "" -#: ../../library/weakref.rst:477 +#: ../../library/weakref.rst:481 msgid "" "Unless you set the :attr:`~finalize.atexit` attribute to :const:`False`, a " "finalizer will be called when the program exits if it is still alive. For " "instance" msgstr "" -#: ../../library/weakref.rst:492 +#: ../../library/weakref.rst:496 msgid "Comparing finalizers with :meth:`__del__` methods" msgstr "" -#: ../../library/weakref.rst:494 +#: ../../library/weakref.rst:498 msgid "" "Suppose we want to create a class whose instances represent temporary " "directories. The directories should be deleted with their contents when the " "first of the following events occurs:" msgstr "" -#: ../../library/weakref.rst:498 +#: ../../library/weakref.rst:502 msgid "the object is garbage collected," msgstr "" -#: ../../library/weakref.rst:499 +#: ../../library/weakref.rst:503 msgid "the object's :meth:`remove` method is called, or" msgstr "" -#: ../../library/weakref.rst:500 +#: ../../library/weakref.rst:504 msgid "the program exits." msgstr "" -#: ../../library/weakref.rst:502 +#: ../../library/weakref.rst:506 msgid "" "We might try to implement the class using a :meth:`__del__` method as " "follows::" msgstr "" -#: ../../library/weakref.rst:521 +#: ../../library/weakref.rst:525 msgid "" "Starting with Python 3.4, :meth:`__del__` methods no longer prevent " "reference cycles from being garbage collected, and module globals are no " @@ -514,35 +522,35 @@ msgid "" "code should work without any issues on CPython." msgstr "" -#: ../../library/weakref.rst:526 +#: ../../library/weakref.rst:530 msgid "" "However, handling of :meth:`__del__` methods is notoriously implementation " "specific, since it depends on internal details of the interpreter's garbage " "collector implementation." msgstr "" -#: ../../library/weakref.rst:530 +#: ../../library/weakref.rst:534 msgid "" "A more robust alternative can be to define a finalizer which only references " "the specific functions and objects that it needs, rather than having access " "to the full state of the object::" msgstr "" -#: ../../library/weakref.rst:546 +#: ../../library/weakref.rst:550 msgid "" "Defined like this, our finalizer only receives a reference to the details it " "needs to clean up the directory appropriately. If the object never gets " "garbage collected the finalizer will still be called at exit." msgstr "" -#: ../../library/weakref.rst:550 +#: ../../library/weakref.rst:554 msgid "" "The other advantage of weakref based finalizers is that they can be used to " "register finalizers for classes where the definition is controlled by a " "third party, such as running code when a module is unloaded::" msgstr "" -#: ../../library/weakref.rst:562 +#: ../../library/weakref.rst:566 msgid "" "If you create a finalizer object in a daemonic thread just as the program " "exits then there is the possibility that the finalizer does not get called " diff --git a/library/webbrowser.po b/library/webbrowser.po index 444946921f..d224d41cc9 100644 --- a/library/webbrowser.po +++ b/library/webbrowser.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-13 00:11+0000\n" +"POT-Creation-Date: 2021-09-24 00:11+0000\n" "PO-Revision-Date: 2017-09-22 18:27+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -369,7 +369,7 @@ msgid "Only on Windows platforms." msgstr "" #: ../../library/webbrowser.rst:172 -msgid "Only on Mac OS X platform." +msgid "Only on macOS platform." msgstr "" #: ../../library/webbrowser.rst:174 diff --git a/license.po b/license.po index 8b747841a5..7fa1ea3393 100644 --- a/license.po +++ b/license.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-13 00:11+0000\n" +"POT-Creation-Date: 2021-09-24 00:11+0000\n" "PO-Revision-Date: 2018-05-23 14:04+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -385,7 +385,7 @@ msgstr "" msgid "" "The modules :mod:`hashlib`, :mod:`posix`, :mod:`ssl`, :mod:`crypt` use the " "OpenSSL library for added performance if made available by the operating " -"system. Additionally, the Windows and Mac OS X installers for Python may " +"system. Additionally, the Windows and macOS installers for Python may " "include a copy of the OpenSSL libraries, so we include a copy of the OpenSSL " "license here::" msgstr "" diff --git a/reference/compound_stmts.po b/reference/compound_stmts.po index ef858b7772..0a35330ff9 100644 --- a/reference/compound_stmts.po +++ b/reference/compound_stmts.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-13 00:11+0000\n" +"POT-Creation-Date: 2021-09-23 00:12+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-" @@ -408,14 +408,14 @@ msgid "" msgstr "" #: ../../reference/compound_stmts.rst:437 -#: ../../reference/compound_stmts.rst:815 -#: ../../reference/compound_stmts.rst:856 +#: ../../reference/compound_stmts.rst:814 +#: ../../reference/compound_stmts.rst:855 msgid "The following code::" msgstr "" #: ../../reference/compound_stmts.rst:442 #: ../../reference/compound_stmts.rst:467 -#: ../../reference/compound_stmts.rst:861 +#: ../../reference/compound_stmts.rst:860 msgid "is semantically equivalent to::" msgstr "" @@ -439,17 +439,17 @@ msgid "" "statement." msgstr "" -#: ../../reference/compound_stmts.rst:490 +#: ../../reference/compound_stmts.rst:489 msgid "Function definitions" msgstr "" -#: ../../reference/compound_stmts.rst:505 +#: ../../reference/compound_stmts.rst:504 msgid "" "A function definition defines a user-defined function object (see section :" "ref:`types`):" msgstr "" -#: ../../reference/compound_stmts.rst:524 +#: ../../reference/compound_stmts.rst:523 msgid "" "A function definition is an executable statement. Its execution binds the " "function name in the current local namespace to a function object (a wrapper " @@ -458,13 +458,13 @@ msgid "" "used when the function is called." msgstr "" -#: ../../reference/compound_stmts.rst:530 +#: ../../reference/compound_stmts.rst:529 msgid "" "The function definition does not execute the function body; this gets " "executed only when the function is called. [#]_" msgstr "" -#: ../../reference/compound_stmts.rst:536 +#: ../../reference/compound_stmts.rst:535 msgid "" "A function definition may be wrapped by one or more :term:`decorator` " "expressions. Decorator expressions are evaluated when the function is " @@ -475,25 +475,25 @@ msgid "" "example, the following code ::" msgstr "" -#: ../../reference/compound_stmts.rst:547 -#: ../../reference/compound_stmts.rst:724 +#: ../../reference/compound_stmts.rst:546 +#: ../../reference/compound_stmts.rst:723 msgid "is roughly equivalent to ::" msgstr "" -#: ../../reference/compound_stmts.rst:552 +#: ../../reference/compound_stmts.rst:551 msgid "" "except that the original function is not temporarily bound to the name " "``func``." msgstr "" -#: ../../reference/compound_stmts.rst:554 +#: ../../reference/compound_stmts.rst:553 msgid "" "Functions may be decorated with any valid :token:`assignment_expression`. " "Previously, the grammar was much more restrictive; see :pep:`614` for " "details." msgstr "" -#: ../../reference/compound_stmts.rst:564 +#: ../../reference/compound_stmts.rst:563 msgid "" "When one or more :term:`parameters ` have the form *parameter* " "``=`` *expression*, the function is said to have \"default parameter values." @@ -504,7 +504,7 @@ msgid "" "syntactic restriction that is not expressed by the grammar." msgstr "" -#: ../../reference/compound_stmts.rst:572 +#: ../../reference/compound_stmts.rst:571 msgid "" "**Default parameter values are evaluated from left to right when the " "function definition is executed.** This means that the expression is " @@ -517,7 +517,7 @@ msgid "" "explicitly test for it in the body of the function, e.g.::" msgstr "" -#: ../../reference/compound_stmts.rst:593 +#: ../../reference/compound_stmts.rst:592 msgid "" "Function call semantics are described in more detail in section :ref:" "`calls`. A function call always assigns values to all parameters mentioned " @@ -533,13 +533,13 @@ msgid "" "positional arguments." msgstr "" -#: ../../reference/compound_stmts.rst:605 +#: ../../reference/compound_stmts.rst:604 msgid "" "The ``/`` function parameter syntax may be used to indicate positional-only " "parameters. See :pep:`570` for details." msgstr "" -#: ../../reference/compound_stmts.rst:614 +#: ../../reference/compound_stmts.rst:613 msgid "" "Parameters may have an :term:`annotation ` of the form " "\"``: expression``\" following the parameter name. Any parameter may have " @@ -556,7 +556,7 @@ msgid "" "different order than they appear in the source code." msgstr "" -#: ../../reference/compound_stmts.rst:629 +#: ../../reference/compound_stmts.rst:628 msgid "" "It is also possible to create anonymous functions (functions not bound to a " "name), for immediate use in expressions. This uses lambda expressions, " @@ -568,7 +568,7 @@ msgid "" "execution of multiple statements and annotations." msgstr "" -#: ../../reference/compound_stmts.rst:637 +#: ../../reference/compound_stmts.rst:636 msgid "" "**Programmer's note:** Functions are first-class objects. A \"``def``\" " "statement executed inside a function definition defines a local function " @@ -577,51 +577,51 @@ msgid "" "See section :ref:`naming` for details." msgstr "" -#: ../../reference/compound_stmts.rst:646 +#: ../../reference/compound_stmts.rst:645 msgid ":pep:`3107` - Function Annotations" msgstr "" -#: ../../reference/compound_stmts.rst:646 +#: ../../reference/compound_stmts.rst:645 msgid "The original specification for function annotations." msgstr "" -#: ../../reference/compound_stmts.rst:649 +#: ../../reference/compound_stmts.rst:648 msgid ":pep:`484` - Type Hints" msgstr "" -#: ../../reference/compound_stmts.rst:649 +#: ../../reference/compound_stmts.rst:648 msgid "Definition of a standard meaning for annotations: type hints." msgstr "" -#: ../../reference/compound_stmts.rst:653 +#: ../../reference/compound_stmts.rst:652 msgid ":pep:`526` - Syntax for Variable Annotations" msgstr "" -#: ../../reference/compound_stmts.rst:652 +#: ../../reference/compound_stmts.rst:651 msgid "" "Ability to type hint variable declarations, including class variables and " "instance variables" msgstr "" -#: ../../reference/compound_stmts.rst:656 +#: ../../reference/compound_stmts.rst:655 msgid ":pep:`563` - Postponed Evaluation of Annotations" msgstr "" -#: ../../reference/compound_stmts.rst:656 +#: ../../reference/compound_stmts.rst:655 msgid "" "Support for forward references within annotations by preserving annotations " "in a string form at runtime instead of eager evaluation." msgstr "" -#: ../../reference/compound_stmts.rst:663 +#: ../../reference/compound_stmts.rst:662 msgid "Class definitions" msgstr "" -#: ../../reference/compound_stmts.rst:678 +#: ../../reference/compound_stmts.rst:677 msgid "A class definition defines a class object (see section :ref:`types`):" msgstr "" -#: ../../reference/compound_stmts.rst:685 +#: ../../reference/compound_stmts.rst:684 msgid "" "A class definition is an executable statement. The inheritance list usually " "gives a list of base classes (see :ref:`metaclasses` for more advanced " @@ -630,11 +630,11 @@ msgid "" "default, from the base class :class:`object`; hence, ::" msgstr "" -#: ../../reference/compound_stmts.rst:694 +#: ../../reference/compound_stmts.rst:693 msgid "is equivalent to ::" msgstr "" -#: ../../reference/compound_stmts.rst:699 +#: ../../reference/compound_stmts.rst:698 msgid "" "The class's suite is then executed in a new execution frame (see :ref:" "`naming`), using a newly created local namespace and the original global " @@ -646,7 +646,7 @@ msgid "" "original local namespace." msgstr "" -#: ../../reference/compound_stmts.rst:708 +#: ../../reference/compound_stmts.rst:707 msgid "" "The order in which attributes are defined in the class body is preserved in " "the new class's ``__dict__``. Note that this is reliable only right after " @@ -654,30 +654,30 @@ msgid "" "definition syntax." msgstr "" -#: ../../reference/compound_stmts.rst:713 +#: ../../reference/compound_stmts.rst:712 msgid "" "Class creation can be customized heavily using :ref:`metaclasses " "`." msgstr "" -#: ../../reference/compound_stmts.rst:718 +#: ../../reference/compound_stmts.rst:717 msgid "Classes can also be decorated: just like when decorating functions, ::" msgstr "" -#: ../../reference/compound_stmts.rst:729 +#: ../../reference/compound_stmts.rst:728 msgid "" "The evaluation rules for the decorator expressions are the same as for " "function decorators. The result is then bound to the class name." msgstr "" -#: ../../reference/compound_stmts.rst:732 +#: ../../reference/compound_stmts.rst:731 msgid "" "Classes may be decorated with any valid :token:`assignment_expression`. " "Previously, the grammar was much more restrictive; see :pep:`614` for " "details." msgstr "" -#: ../../reference/compound_stmts.rst:737 +#: ../../reference/compound_stmts.rst:736 msgid "" "**Programmer's note:** Variables defined in the class definition are class " "attributes; they are shared by instances. Instance attributes can be set in " @@ -690,35 +690,35 @@ msgid "" "implementation details." msgstr "" -#: ../../reference/compound_stmts.rst:752 +#: ../../reference/compound_stmts.rst:751 msgid ":pep:`3115` - Metaclasses in Python 3000" msgstr "" -#: ../../reference/compound_stmts.rst:750 +#: ../../reference/compound_stmts.rst:749 msgid "" "The proposal that changed the declaration of metaclasses to the current " "syntax, and the semantics for how classes with metaclasses are constructed." msgstr "" -#: ../../reference/compound_stmts.rst:755 +#: ../../reference/compound_stmts.rst:754 msgid ":pep:`3129` - Class Decorators" msgstr "" -#: ../../reference/compound_stmts.rst:755 +#: ../../reference/compound_stmts.rst:754 msgid "" "The proposal that added class decorators. Function and method decorators " "were introduced in :pep:`318`." msgstr "" -#: ../../reference/compound_stmts.rst:762 +#: ../../reference/compound_stmts.rst:761 msgid "Coroutines" msgstr "" -#: ../../reference/compound_stmts.rst:770 +#: ../../reference/compound_stmts.rst:769 msgid "Coroutine function definition" msgstr "" -#: ../../reference/compound_stmts.rst:780 +#: ../../reference/compound_stmts.rst:779 msgid "" "Execution of Python coroutines can be suspended and resumed at many points " "(see :term:`coroutine`). Inside the body of a coroutine function, ``await`` " @@ -727,102 +727,102 @@ msgid "" "in coroutine function bodies." msgstr "" -#: ../../reference/compound_stmts.rst:786 +#: ../../reference/compound_stmts.rst:785 msgid "" "Functions defined with ``async def`` syntax are always coroutine functions, " "even if they do not contain ``await`` or ``async`` keywords." msgstr "" -#: ../../reference/compound_stmts.rst:789 +#: ../../reference/compound_stmts.rst:788 msgid "" "It is a :exc:`SyntaxError` to use a ``yield from`` expression inside the " "body of a coroutine function." msgstr "" -#: ../../reference/compound_stmts.rst:792 +#: ../../reference/compound_stmts.rst:791 msgid "An example of a coroutine function::" msgstr "" -#: ../../reference/compound_stmts.rst:803 +#: ../../reference/compound_stmts.rst:802 msgid "The :keyword:`!async for` statement" msgstr "" -#: ../../reference/compound_stmts.rst:808 +#: ../../reference/compound_stmts.rst:807 msgid "" "An :term:`asynchronous iterable` provides an ``__aiter__`` method that " "directly returns an :term:`asynchronous iterator`, which can call " "asynchronous code in its ``__anext__`` method." msgstr "" -#: ../../reference/compound_stmts.rst:812 +#: ../../reference/compound_stmts.rst:811 msgid "" "The ``async for`` statement allows convenient iteration over asynchronous " "iterables." msgstr "" -#: ../../reference/compound_stmts.rst:822 +#: ../../reference/compound_stmts.rst:821 msgid "Is semantically equivalent to::" msgstr "" -#: ../../reference/compound_stmts.rst:838 +#: ../../reference/compound_stmts.rst:837 msgid "See also :meth:`__aiter__` and :meth:`__anext__` for details." msgstr "" -#: ../../reference/compound_stmts.rst:840 +#: ../../reference/compound_stmts.rst:839 msgid "" "It is a :exc:`SyntaxError` to use an ``async for`` statement outside the " "body of a coroutine function." msgstr "" -#: ../../reference/compound_stmts.rst:848 +#: ../../reference/compound_stmts.rst:847 msgid "The :keyword:`!async with` statement" msgstr "" -#: ../../reference/compound_stmts.rst:853 +#: ../../reference/compound_stmts.rst:852 msgid "" "An :term:`asynchronous context manager` is a :term:`context manager` that is " "able to suspend execution in its *enter* and *exit* methods." msgstr "" -#: ../../reference/compound_stmts.rst:880 +#: ../../reference/compound_stmts.rst:879 msgid "See also :meth:`__aenter__` and :meth:`__aexit__` for details." msgstr "" -#: ../../reference/compound_stmts.rst:882 +#: ../../reference/compound_stmts.rst:881 msgid "" "It is a :exc:`SyntaxError` to use an ``async with`` statement outside the " "body of a coroutine function." msgstr "" -#: ../../reference/compound_stmts.rst:888 +#: ../../reference/compound_stmts.rst:887 msgid ":pep:`492` - Coroutines with async and await syntax" msgstr "" -#: ../../reference/compound_stmts.rst:888 +#: ../../reference/compound_stmts.rst:887 msgid "" "The proposal that made coroutines a proper standalone concept in Python, and " "added supporting syntax." msgstr "" -#: ../../reference/compound_stmts.rst:893 +#: ../../reference/compound_stmts.rst:892 msgid "Footnotes" msgstr "註解" -#: ../../reference/compound_stmts.rst:894 +#: ../../reference/compound_stmts.rst:893 msgid "" "The exception is propagated to the invocation stack unless there is a :" "keyword:`finally` clause which happens to raise another exception. That new " "exception causes the old one to be lost." msgstr "" -#: ../../reference/compound_stmts.rst:898 +#: ../../reference/compound_stmts.rst:897 msgid "" "A string literal appearing as the first statement in the function body is " "transformed into the function's ``__doc__`` attribute and therefore the " "function's :term:`docstring`." msgstr "" -#: ../../reference/compound_stmts.rst:902 +#: ../../reference/compound_stmts.rst:901 msgid "" "A string literal appearing as the first statement in the class body is " "transformed into the namespace's ``__doc__`` item and therefore the class's :" diff --git a/reference/datamodel.po b/reference/datamodel.po index 4a28a96426..109e426954 100644 --- a/reference/datamodel.po +++ b/reference/datamodel.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-13 00:11+0000\n" +"POT-Creation-Date: 2021-09-29 00:11+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-" @@ -1745,7 +1745,7 @@ msgstr "" msgid "" "This is intended to provide protection against a denial-of-service caused by " "carefully-chosen inputs that exploit the worst case performance of a dict " -"insertion, O(n^2) complexity. See http://www.ocert.org/advisories/" +"insertion, O(n\\ :sup:`2`) complexity. See http://www.ocert.org/advisories/" "ocert-2011-003.html for details." msgstr "" diff --git a/tutorial/appetite.po b/tutorial/appetite.po index 55aceab567..443b50121d 100644 --- a/tutorial/appetite.po +++ b/tutorial/appetite.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-06-26 18:54+0800\n" +"POT-Creation-Date: 2021-09-24 00:11+0000\n" "PO-Revision-Date: 2021-06-06 13:25+0800\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -61,13 +61,13 @@ msgid "" "tasks, but shell scripts are best at moving around files and changing text " "data, not well-suited for GUI applications or games. You could write a C/C++/" "Java program, but it can take a lot of development time to get even a first-" -"draft program. Python is simpler to use, available on Windows, Mac OS X, " -"and Unix operating systems, and will help you get the job done more quickly." +"draft program. Python is simpler to use, available on Windows, macOS, and " +"Unix operating systems, and will help you get the job done more quickly." msgstr "" "也許你可以為了某些任務而寫個 Unix shell 腳本或者 Windows 批次檔來處理,但 " "shell 腳本最適合於搬動檔案或更動文字內容,而不適於圖形應用程式或遊戲。你可以" "為此寫個 C/C++/Java 程式,但僅僅是完成個草稿也需要很長的開發時間。相較而言," -"Python 更易於使用,並能在 Windows、Mac OSX、Unix 作業系統上執行,且能更快速地" +"Python 更易於使用,並能在 Windows、macOS、Unix 作業系統上執行,且能更快速地" "幫助你完成工作。" #: ../../tutorial/appetite.rst:29 diff --git a/tutorial/classes.po b/tutorial/classes.po index 521ea35004..3255027d6a 100644 --- a/tutorial/classes.po +++ b/tutorial/classes.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-06-26 18:54+0800\n" +"POT-Creation-Date: 2021-10-08 06:07+0000\n" "PO-Revision-Date: 2021-06-06 02:14+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -29,10 +29,10 @@ msgstr "Class(類別)" #: ../../tutorial/classes.rst:7 msgid "" "Classes provide a means of bundling data and functionality together. " -"Creating a new class creates a new *type* of object, allowing new *instances* " -"of that type to be made. Each class instance can have attributes attached to " -"it for maintaining its state. Class instances can also have methods (defined " -"by its class) for modifying its state." +"Creating a new class creates a new *type* of object, allowing new " +"*instances* of that type to be made. Each class instance can have " +"attributes attached to it for maintaining its state. Class instances can " +"also have methods (defined by its class) for modifying its state." msgstr "" "Class 提供了一種結合資料與功能的手段。建立一個 class 將會新增一個物件的\\ *型" "別 (type)*\\ ,並且允許建立該型別的新\\ *實例 (instance)*\\ 。每一個 class 實" @@ -48,13 +48,13 @@ msgid "" "mechanism allows multiple base classes, a derived class can override any " "methods of its base class or classes, and a method can call the method of a " "base class with the same name. Objects can contain arbitrary amounts and " -"kinds of data. As is true for modules, classes partake of the dynamic nature " -"of Python: they are created at runtime, and can be modified further after " -"creation." +"kinds of data. As is true for modules, classes partake of the dynamic " +"nature of Python: they are created at runtime, and can be modified further " +"after creation." msgstr "" "與其他程式語言相比,Python 的 class 機制為 class 增加了最少的新語法跟語意。他" -"混合了 C++ 和 Modula-3 的 class 機制。Python 的 class 提供了所有物件導向程式設" -"計 (Object Oriented Programming) 的標準特色:class 繼承機制允許多個 base " +"混合了 C++ 和 Modula-3 的 class 機制。Python 的 class 提供了所有物件導向程式" +"設計 (Object Oriented Programming) 的標準特色:class 繼承機制允許多個 base " "class(基底類別),一個 derived class(衍生類別)可以覆寫 (override) 其 base " "class 的任何 method,且一個 method 可以用相同的名稱呼叫其 base class 的 " "method。物件可以包含任意數量及任意種類的資料。如同模組一樣,class 也具有 " @@ -66,18 +66,19 @@ msgid "" "*public* (except see below :ref:`tut-private`), and all member functions are " "*virtual*. As in Modula-3, there are no shorthands for referencing the " "object's members from its methods: the method function is declared with an " -"explicit first argument representing the object, which is provided implicitly " -"by the call. As in Smalltalk, classes themselves are objects. This provides " -"semantics for importing and renaming. Unlike C++ and Modula-3, built-in " -"types can be used as base classes for extension by the user. Also, like in C+" -"+, most built-in operators with special syntax (arithmetic operators, " -"subscripting etc.) can be redefined for class instances." +"explicit first argument representing the object, which is provided " +"implicitly by the call. As in Smalltalk, classes themselves are objects. " +"This provides semantics for importing and renaming. Unlike C++ and " +"Modula-3, built-in types can be used as base classes for extension by the " +"user. Also, like in C++, most built-in operators with special syntax " +"(arithmetic operators, subscripting etc.) can be redefined for class " +"instances." msgstr "" "在 C++ 的術語中,class 成員(包含資料成員)通常都是\\ *公開*\\ 的(除了以下內" "容:\\ :ref:`tut-private`\\ ),而所有的成員函式都是\\ *虛擬*\\ 的。如同在 " "Modula-3 中一樣,Python 並沒有提供簡寫可以從物件的 method 裡參照其成員:" -"method 函式與一個外顯的 (explicit)、第一個代表物件的引數被宣告,而此引數是在呼" -"叫時隱性地 (implicitly) 被提供。如同在 Smalltak 中,class 都是物件,這為 " +"method 函式與一個外顯的 (explicit)、第一個代表物件的引數被宣告,而此引數是在" +"呼叫時隱性地 (implicitly) 被提供。如同在 Smalltak 中,class 都是物件,這為 " "import 及重新命名提供了語意。不像 C++ 和 Modula-3,Pyhon 內建的型別可以被使用" "者以 base class 用於其他擴充 (extension)。另外,如同在 C++ 中,大多數有著特別" "語法的內建運算子(算術運算子、下標等)都可以為了 class 實例而被重新定義。" @@ -85,13 +86,13 @@ msgstr "" #: ../../tutorial/classes.rst:34 msgid "" "(Lacking universally accepted terminology to talk about classes, I will make " -"occasional use of Smalltalk and C++ terms. I would use Modula-3 terms, since " -"its object-oriented semantics are closer to those of Python than C++, but I " -"expect that few readers have heard of it.)" +"occasional use of Smalltalk and C++ terms. I would use Modula-3 terms, " +"since its object-oriented semantics are closer to those of Python than C++, " +"but I expect that few readers have heard of it.)" msgstr "" -"(由於缺乏普遍能接受的術語來討論 class,我偶爾會使用 Smalltalk 和 C++ 的術語。" -"我會使用 Modula-3 的術語,因為它比 C++ 更接近 Python 的物件導向語意,但我預期" -"比較少的讀者會聽過它。)" +"(由於缺乏普遍能接受的術語來討論 class,我偶爾會使用 Smalltalk 和 C++ 的術" +"語。我會使用 Modula-3 的術語,因為它比 C++ 更接近 Python 的物件導向語意,但我" +"預期比較少的讀者會聽過它。)" #: ../../tutorial/classes.rst:43 msgid "A Word About Names and Objects" @@ -103,23 +104,23 @@ msgid "" "bound to the same object. This is known as aliasing in other languages. " "This is usually not appreciated on a first glance at Python, and can be " "safely ignored when dealing with immutable basic types (numbers, strings, " -"tuples). However, aliasing has a possibly surprising effect on the semantics " -"of Python code involving mutable objects such as lists, dictionaries, and " -"most other types. This is usually used to the benefit of the program, since " -"aliases behave like pointers in some respects. For example, passing an " -"object is cheap since only a pointer is passed by the implementation; and if " -"a function modifies an object passed as an argument, the caller will see the " -"change --- this eliminates the need for two different argument passing " -"mechanisms as in Pascal." +"tuples). However, aliasing has a possibly surprising effect on the " +"semantics of Python code involving mutable objects such as lists, " +"dictionaries, and most other types. This is usually used to the benefit of " +"the program, since aliases behave like pointers in some respects. For " +"example, passing an object is cheap since only a pointer is passed by the " +"implementation; and if a function modifies an object passed as an argument, " +"the caller will see the change --- this eliminates the need for two " +"different argument passing mechanisms as in Pascal." msgstr "" "物件有個體性 (individuality),且多個名稱(在多個作用域 (scope) )可以被連結到" "相同的物件。這在其他語言中被稱為別名 (aliasing)。初次接觸 Python 時通常不會注" "意這件事,而在處理不可變的基本型別(數值、字串、tuple)時,它也可以安全地被忽" "略。然而,別名在含有可變物件(如 list(串列)、dictionary(字典)、和大多數其" -"他的型別)的 Python 程式碼語意中,可能會有意外的效果。這通常有利於程式,因為別" -"名在某些方面表現得像指標 (pointer)。舉例來說,在實作時傳遞一個物件是便宜的,因" -"為只有指標被傳遞;假如函式修改了一個作為引數傳遞的物件,呼叫函式者 (caller) 能" -"夠見到這些改變——這消除了在 Pascal 中兩個相異引數傳遞機制的需求。" +"他的型別)的 Python 程式碼語意中,可能會有意外的效果。這通常有利於程式,因為" +"別名在某些方面表現得像指標 (pointer)。舉例來說,在實作時傳遞一個物件是便宜" +"的,因為只有指標被傳遞;假如函式修改了一個作為引數傳遞的物件,呼叫函式者 " +"(caller) 能夠見到這些改變——這消除了在 Pascal 中兩個相異引數傳遞機制的需求。" #: ../../tutorial/classes.rst:61 msgid "Python Scopes and Namespaces" @@ -127,16 +128,16 @@ msgstr "Python 作用域 (Scope) 及命名空間 (Namespace)" #: ../../tutorial/classes.rst:63 msgid "" -"Before introducing classes, I first have to tell you something about Python's " -"scope rules. Class definitions play some neat tricks with namespaces, and " -"you need to know how scopes and namespaces work to fully understand what's " -"going on. Incidentally, knowledge about this subject is useful for any " -"advanced Python programmer." +"Before introducing classes, I first have to tell you something about " +"Python's scope rules. Class definitions play some neat tricks with " +"namespaces, and you need to know how scopes and namespaces work to fully " +"understand what's going on. Incidentally, knowledge about this subject is " +"useful for any advanced Python programmer." msgstr "" "在介紹 class 之前,我必須先告訴你一些關於 Python 作用域的規則。Class " -"definition(類別定義)以命名空間展現了一些俐落的技巧,而你需要了解作用域和命名" -"空間的運作才能完整理解正在發生的事情。順帶一提,關於這個主題的知識對任何進階" -"的 Python 程式設計師都是很有用的。" +"definition(類別定義)以命名空間展現了一些俐落的技巧,而你需要了解作用域和命" +"名空間的運作才能完整理解正在發生的事情。順帶一提,關於這個主題的知識對任何進" +"階的 Python 程式設計師都是很有用的。" #: ../../tutorial/classes.rst:69 msgid "Let's begin with some definitions." @@ -160,25 +161,25 @@ msgstr "" "dictionary 被實作,但通常不會以任何方式被察覺(除了性能),且它可能會在未來改" "變。命名空間的例子有:內建名稱的集合(包含如 :func:`abs` 的函式,和內建的例外" "名稱);模組中的全域 (global) 名稱;和在函式調用中的區域 (local) 名稱。某種意" -"義上,物件中的屬性集合也會形成一個命名空間。關於命名空間的重要一點是,不同命名" -"空間中的名稱之間絕對沒有關係;舉例來說,兩個不一樣的模組都可以定義一個 " +"義上,物件中的屬性集合也會形成一個命名空間。關於命名空間的重要一點是,不同命" +"名空間中的名稱之間絕對沒有關係;舉例來說,兩個不一樣的模組都可以定義一個 " "``maximize`` 函式而不會混淆——模組的使用者必須為它加上前綴 (prefix) 模組名稱。" #: ../../tutorial/classes.rst:82 msgid "" "By the way, I use the word *attribute* for any name following a dot --- for " -"example, in the expression ``z.real``, ``real`` is an attribute of the object " -"``z``. Strictly speaking, references to names in modules are attribute " -"references: in the expression ``modname.funcname``, ``modname`` is a module " -"object and ``funcname`` is an attribute of it. In this case there happens to " -"be a straightforward mapping between the module's attributes and the global " -"names defined in the module: they share the same namespace! [#]_" +"example, in the expression ``z.real``, ``real`` is an attribute of the " +"object ``z``. Strictly speaking, references to names in modules are " +"attribute references: in the expression ``modname.funcname``, ``modname`` is " +"a module object and ``funcname`` is an attribute of it. In this case there " +"happens to be a straightforward mapping between the module's attributes and " +"the global names defined in the module: they share the same namespace! [#]_" msgstr "" "順帶一提,我使用\\ *屬性 (attribute)* 這個字,統稱句號 (dot) 後面的任何名稱——" -"例如,運算式中的 ``z.real``,\\ ``real`` 是物件 ``z`` 的一個屬性。嚴格來說,模" -"組中名稱的參照都是屬性參照:在運算式 ``modname.funcname`` 中,\\ ``modname`` " -"是模組物件而 ``funcname`` 是它的屬性。在這種情況下,模組的屬性和模組中定義的全" -"域名稱碰巧有一個直接的對映:他們共享了相同的命名空間![#]_" +"例如,運算式中的 ``z.real``,\\ ``real`` 是物件 ``z`` 的一個屬性。嚴格來說," +"模組中名稱的參照都是屬性參照:在運算式 ``modname.funcname`` 中,\\ " +"``modname`` 是模組物件而 ``funcname`` 是它的屬性。在這種情況下,模組的屬性和" +"模組中定義的全域名稱碰巧有一個直接的對映:他們共享了相同的命名空間![#]_" #: ../../tutorial/classes.rst:90 msgid "" @@ -188,10 +189,10 @@ msgid "" "the :keyword:`del` statement. For example, ``del modname.the_answer`` will " "remove the attribute :attr:`the_answer` from the object named by ``modname``." msgstr "" -"屬性可以是唯讀的或可寫的。在後者的情況下,對屬性的賦值是可能的。模組屬性是可寫" -"的:你可以寫 ``modname.the_answer = 42``。可寫屬性也可以用 :keyword:`del` 陳述" -"式刪除。例如,\\ ``del modname.the_answer`` 將從名為 ``modname`` 的物件中刪除" -"屬性 :attr:`the_answer`\\ 。" +"屬性可以是唯讀的或可寫的。在後者的情況下,對屬性的賦值是可能的。模組屬性是可" +"寫的:你可以寫 ``modname.the_answer = 42``。可寫屬性也可以用 :keyword:`del` " +"陳述式刪除。例如,\\ ``del modname.the_answer`` 將從名為 ``modname`` 的物件中" +"刪除屬性 :attr:`the_answer`\\ 。" #: ../../tutorial/classes.rst:96 msgid "" @@ -199,18 +200,19 @@ msgid "" "The namespace containing the built-in names is created when the Python " "interpreter starts up, and is never deleted. The global namespace for a " "module is created when the module definition is read in; normally, module " -"namespaces also last until the interpreter quits. The statements executed by " -"the top-level invocation of the interpreter, either read from a script file " -"or interactively, are considered part of a module called :mod:`__main__`, so " -"they have their own global namespace. (The built-in names actually also live " -"in a module; this is called :mod:`builtins`.)" -msgstr "" -"命名空間在不同的時刻被建立,並且有不同的壽命。當 Python 直譯器啟動時,含有內建" -"名稱的命名空間會被建立,並且永遠不會被刪除。當模組定義被讀入時,模組的全域命名" -"空間會被建立;一般情況下,模組的命名空間也會持續到直譯器結束。被直譯器的頂層調" -"用 (top-level invocation) 執行的陳述式,不論是從腳本檔案讀取的或是互動模式中" -"的,會被視為一個稱為 :mod:`__main__` 的模組的一部分,因此它們具有自己的全域命" -"名空間。(內建名稱實際上也存在一個模組中,它被稱為 :mod:`builtins`\\ 。)" +"namespaces also last until the interpreter quits. The statements executed " +"by the top-level invocation of the interpreter, either read from a script " +"file or interactively, are considered part of a module called :mod:" +"`__main__`, so they have their own global namespace. (The built-in names " +"actually also live in a module; this is called :mod:`builtins`.)" +msgstr "" +"命名空間在不同的時刻被建立,並且有不同的壽命。當 Python 直譯器啟動時,含有內" +"建名稱的命名空間會被建立,並且永遠不會被刪除。當模組定義被讀入時,模組的全域" +"命名空間會被建立;一般情況下,模組的命名空間也會持續到直譯器結束。被直譯器的" +"頂層調用 (top-level invocation) 執行的陳述式,不論是從腳本檔案讀取的或是互動" +"模式中的,會被視為一個稱為 :mod:`__main__` 的模組的一部分,因此它們具有自己的" +"全域命名空間。(內建名稱實際上也存在一個模組中,它被稱為 :mod:`builtins`" +"\\ 。)" #: ../../tutorial/classes.rst:106 msgid "" @@ -220,8 +222,8 @@ msgid "" "describe what actually happens.) Of course, recursive invocations each have " "their own local namespace." msgstr "" -"函式的區域命名空間是在呼叫函式時建立的,而當函式返回,或引發了未在函式中處理的" -"例外時,此命名空間將會被刪除。(實際上,忘記是描述實際發生的事情的更好方" +"函式的區域命名空間是在呼叫函式時建立的,而當函式返回,或引發了未在函式中處理" +"的例外時,此命名空間將會被刪除。(實際上,忘記是描述實際發生的事情的更好方" "法。) 當然,每個遞迴調用 (recursive invocation) 都有自己的區域命名空間。" #: ../../tutorial/classes.rst:112 @@ -230,8 +232,8 @@ msgid "" "directly accessible. \"Directly accessible\" here means that an unqualified " "reference to a name attempts to find the name in the namespace." msgstr "" -"*作用域*\\ 是 Python 程式中的一個文本區域 (textual region),在此區域,命名空間" -"是可直接存取的。這裡的「可直接存取的」意思是,對一個名稱的非限定參照 " +"*作用域*\\ 是 Python 程式中的一個文本區域 (textual region),在此區域,命名空" +"間是可直接存取的。這裡的「可直接存取的」意思是,對一個名稱的非限定參照 " "(unqualified reference) 可以在命名空間內嘗試尋找該名稱。" #: ../../tutorial/classes.rst:116 @@ -240,8 +242,8 @@ msgid "" "time during execution, there are 3 or 4 nested scopes whose namespaces are " "directly accessible:" msgstr "" -"儘管作用域是靜態地被決定,但它們是動態地被使用的。在執行期間內的任何時間點,都" -"會有 3 或 4 個巢狀的作用域,其命名空間是可以被直接存取的:" +"儘管作用域是靜態地被決定,但它們是動態地被使用的。在執行期間內的任何時間點," +"都會有 3 或 4 個巢狀的作用域,其命名空間是可以被直接存取的:" #: ../../tutorial/classes.rst:120 msgid "the innermost scope, which is searched first, contains the local names" @@ -252,8 +254,8 @@ msgid "" "the scopes of any enclosing functions, which are searched starting with the " "nearest enclosing scope, contains non-local, but also non-global names" msgstr "" -"任何外圍函式 (enclosing function) 的作用域,會從最近的外圍作用域開始搜尋,它包" -"含了非區域 (non-local) 和非全域 (non-global) 的名稱" +"任何外圍函式 (enclosing function) 的作用域,會從最近的外圍作用域開始搜尋,它" +"包含了非區域 (non-local) 和非全域 (non-global) 的名稱" #: ../../tutorial/classes.rst:123 msgid "the next-to-last scope contains the current module's global names" @@ -261,23 +263,25 @@ msgstr "倒數第二個作用域,包含當前模組的全域名稱" #: ../../tutorial/classes.rst:124 msgid "" -"the outermost scope (searched last) is the namespace containing built-in names" +"the outermost scope (searched last) is the namespace containing built-in " +"names" msgstr "最外面的作用域(最後搜尋),是包含內建名稱的命名空間" #: ../../tutorial/classes.rst:126 msgid "" -"If a name is declared global, then all references and assignments go directly " -"to the middle scope containing the module's global names. To rebind " -"variables found outside of the innermost scope, the :keyword:`nonlocal` " -"statement can be used; if not declared nonlocal, those variables are read-" -"only (an attempt to write to such a variable will simply create a *new* local " -"variable in the innermost scope, leaving the identically named outer variable " -"unchanged)." +"If a name is declared global, then all references and assignments go " +"directly to the middle scope containing the module's global names. To " +"rebind variables found outside of the innermost scope, the :keyword:" +"`nonlocal` statement can be used; if not declared nonlocal, those variables " +"are read-only (an attempt to write to such a variable will simply create a " +"*new* local variable in the innermost scope, leaving the identically named " +"outer variable unchanged)." msgstr "" -"如果一個名稱被宣告為全域,則所有的參照和賦值將直接轉到包含模組全域名稱的中間作" -"用域。要重新連結最內層作用域以外找到的變數,可以使用 :keyword:`nonlocal` 陳述" -"式;如果那些變數沒有被宣告為 nonlocal,則它們會是唯讀的(嘗試寫入這樣的變數只" -"會在最內層的作用域內建立一個\\ *新的*\\ 區域變數,同名的外部變數則維持不變)。" +"如果一個名稱被宣告為全域,則所有的參照和賦值將直接轉到包含模組全域名稱的中間" +"作用域。要重新連結最內層作用域以外找到的變數,可以使用 :keyword:`nonlocal` 陳" +"述式;如果那些變數沒有被宣告為 nonlocal,則它們會是唯讀的(嘗試寫入這樣的變數" +"只會在最內層的作用域內建立一個\\ *新的*\\ 區域變數,同名的外部變數則維持不" +"變)。" #: ../../tutorial/classes.rst:133 msgid "" @@ -286,53 +290,53 @@ msgid "" "namespace as the global scope: the module's namespace. Class definitions " "place yet another namespace in the local scope." msgstr "" -"通常,區域作用域會參照(文本的)當前函式的區域名稱。在函式外部,區域作用域與全" -"域作用域參照相同的命名空間:模組的命名空間。然而,Class definition 會在區域作" -"用域中放置另一個命名空間。" +"通常,區域作用域會參照(文本的)當前函式的區域名稱。在函式外部,區域作用域與" +"全域作用域參照相同的命名空間:模組的命名空間。然而,Class definition 會在區域" +"作用域中放置另一個命名空間。" #: ../../tutorial/classes.rst:138 msgid "" "It is important to realize that scopes are determined textually: the global " -"scope of a function defined in a module is that module's namespace, no matter " -"from where or by what alias the function is called. On the other hand, the " -"actual search for names is done dynamically, at run time --- however, the " -"language definition is evolving towards static name resolution, at \"compile" -"\" time, so don't rely on dynamic name resolution! (In fact, local variables " -"are already determined statically.)" -msgstr "" -"務必要了解,作用域是按文本被決定的:在模組中定義的函式,其全域作用域便是該模組" -"的命名空間,無論函式是從何處或以什麼別名被呼叫。另一方面,對名稱的實際搜尋是在" -"執行時期 (run time) 動態完成的——但是,語言定義的發展,正朝向在「編譯」時期 " -"(compile time) 的靜態名稱解析 (static name resolution),所以不要太依賴動態名稱" -"解析 (dynamic name resolution)! (事實上,局部變數已經是靜態地被決定。)" +"scope of a function defined in a module is that module's namespace, no " +"matter from where or by what alias the function is called. On the other " +"hand, the actual search for names is done dynamically, at run time --- " +"however, the language definition is evolving towards static name resolution, " +"at \"compile\" time, so don't rely on dynamic name resolution! (In fact, " +"local variables are already determined statically.)" +msgstr "" +"務必要了解,作用域是按文本被決定的:在模組中定義的函式,其全域作用域便是該模" +"組的命名空間,無論函式是從何處或以什麼別名被呼叫。另一方面,對名稱的實際搜尋" +"是在執行時期 (run time) 動態完成的——但是,語言定義的發展,正朝向在「編譯」時" +"期 (compile time) 的靜態名稱解析 (static name resolution),所以不要太依賴動態" +"名稱解析 (dynamic name resolution)! (事實上,局部變數已經是靜態地被決定。)" #: ../../tutorial/classes.rst:146 msgid "" "A special quirk of Python is that -- if no :keyword:`global` or :keyword:" "`nonlocal` statement is in effect -- assignments to names always go into the " "innermost scope. Assignments do not copy data --- they just bind names to " -"objects. The same is true for deletions: the statement ``del x`` removes the " -"binding of ``x`` from the namespace referenced by the local scope. In fact, " -"all operations that introduce new names use the local scope: in particular, :" -"keyword:`import` statements and function definitions bind the module or " -"function name in the local scope." -msgstr "" -"一個 Python 的特殊癖好是——假如沒有 :keyword:`global` 或 :keyword:`nonlocal` 陳" -"述式的效果——名稱的賦值 (assignment) 都會指向最內層作用域。賦值不會複製資料——它" -"們只會把名稱連結至物件。刪除也是一樣:陳述式 ``del x`` 會從區域作用域參照的命" -"名空間移除 ``x`` 的連結。事實上,引入新名稱的所有運算都使用區域作用域:特別" -"是 :keyword:`import` 陳述式和函式定義,會連結區域作用域內的模組或函式名稱。" +"objects. The same is true for deletions: the statement ``del x`` removes " +"the binding of ``x`` from the namespace referenced by the local scope. In " +"fact, all operations that introduce new names use the local scope: in " +"particular, :keyword:`import` statements and function definitions bind the " +"module or function name in the local scope." +msgstr "" +"一個 Python 的特殊癖好是——假如沒有 :keyword:`global` 或 :keyword:`nonlocal` " +"陳述式的效果——名稱的賦值 (assignment) 都會指向最內層作用域。賦值不會複製資料" +"——它們只會把名稱連結至物件。刪除也是一樣:陳述式 ``del x`` 會從區域作用域參照" +"的命名空間移除 ``x`` 的連結。事實上,引入新名稱的所有運算都使用區域作用域:特" +"別是 :keyword:`import` 陳述式和函式定義,會連結區域作用域內的模組或函式名稱。" #: ../../tutorial/classes.rst:154 msgid "" "The :keyword:`global` statement can be used to indicate that particular " "variables live in the global scope and should be rebound there; the :keyword:" -"`nonlocal` statement indicates that particular variables live in an enclosing " -"scope and should be rebound there." +"`nonlocal` statement indicates that particular variables live in an " +"enclosing scope and should be rebound there." msgstr "" -":keyword:`global` 陳述式可以用來表示特定變數存活在全域作用域,應該被重新綁定到" -"那裡;\\ :keyword:`nonlocal` 陳述式表示特定變數存活在外圍作用域內,應該被重新" -"綁定到那裡。" +":keyword:`global` 陳述式可以用來表示特定變數存活在全域作用域,應該被重新綁定" +"到那裡;\\ :keyword:`nonlocal` 陳述式表示特定變數存活在外圍作用域內,應該被重" +"新綁定到那裡。" #: ../../tutorial/classes.rst:162 msgid "Scopes and Namespaces Example" @@ -341,8 +345,8 @@ msgstr "作用域和命名空間的範例" #: ../../tutorial/classes.rst:164 msgid "" "This is an example demonstrating how to reference the different scopes and " -"namespaces, and how :keyword:`global` and :keyword:`nonlocal` affect variable " -"binding::" +"namespaces, and how :keyword:`global` and :keyword:`nonlocal` affect " +"variable binding::" msgstr "" "這是一個範例,演示如何參照不同的作用域和命名空間,以及 :keyword:`global` 和 :" "keyword:`nonlocal` 如何影響變數的綁定:\n" @@ -393,14 +397,14 @@ msgstr "" #: ../../tutorial/classes.rst:232 msgid "" -"Class definitions, like function definitions (:keyword:`def` statements) must " -"be executed before they have any effect. (You could conceivably place a " -"class definition in a branch of an :keyword:`if` statement, or inside a " +"Class definitions, like function definitions (:keyword:`def` statements) " +"must be executed before they have any effect. (You could conceivably place " +"a class definition in a branch of an :keyword:`if` statement, or inside a " "function.)" msgstr "" -"Class definition,如同函式定義(\\ :keyword:`def` 陳述式),必須在它們有任何效" -"果前先執行。(你可以想像把 class definition 放在一個 :keyword:`if` 陳述式的分" -"支,或在函式裡。)" +"Class definition,如同函式定義(\\ :keyword:`def` 陳述式),必須在它們有任何" +"效果前先執行。(你可以想像把 class definition 放在一個 :keyword:`if` 陳述式的" +"分支,或在函式裡。)" #: ../../tutorial/classes.rst:236 msgid "" @@ -411,19 +415,19 @@ msgid "" "conventions for methods --- again, this is explained later." msgstr "" "在實作時,class definition 內的陳述式通常會是函式定義,但其他陳述式也是允許" -"的,有時很有用——我們稍後會回到這裡。Class 中的函式定義通常會有一個獨特的引數列" -"表形式,取決於 method 的呼叫慣例——再一次地,這將會在稍後解釋。" +"的,有時很有用——我們稍後會回到這裡。Class 中的函式定義通常會有一個獨特的引數" +"列表形式,取決於 method 的呼叫慣例——再一次地,這將會在稍後解釋。" #: ../../tutorial/classes.rst:242 msgid "" "When a class definition is entered, a new namespace is created, and used as " -"the local scope --- thus, all assignments to local variables go into this new " -"namespace. In particular, function definitions bind the name of the new " +"the local scope --- thus, all assignments to local variables go into this " +"new namespace. In particular, function definitions bind the name of the new " "function here." msgstr "" "當進入 class definition,一個新的命名空間將會被建立,並且作為區域作用域——因" -"此,所有區域變數的賦值將進入這個新的命名空間。特別是,函式定義會在這裡連結新函" -"式的名稱。" +"此,所有區域變數的賦值將進入這個新的命名空間。特別是,函式定義會在這裡連結新" +"函式的名稱。" #: ../../tutorial/classes.rst:247 msgid "" @@ -435,11 +439,11 @@ msgid "" "here to the class name given in the class definition header (:class:" "`ClassName` in the example)." msgstr "" -"正常地(從結尾處)離開 class definition 時,一個 *class 物件*\\ 會被建立。基本" -"上這是一個包裝器 (wrapper),裝著 class definition 建立的命名空間內容;我們將在" -"下一節中更加了解 class 物件。原始的區域作用域(在進入 class definition 之前已" -"生效的作用域)會恢復,在此 class 物件會被連結到 class definition 標頭中給出的 " -"class 名稱(在範例中為 :class:`ClassName`\\ )。" +"正常地(從結尾處)離開 class definition 時,一個 *class 物件*\\ 會被建立。基" +"本上這是一個包裝器 (wrapper),裝著 class definition 建立的命名空間內容;我們" +"將在下一節中更加了解 class 物件。原始的區域作用域(在進入 class definition 之" +"前已生效的作用域)會恢復,在此 class 物件會被連結到 class definition 標頭中給" +"出的 class 名稱(在範例中為 :class:`ClassName`\\ )。" #: ../../tutorial/classes.rst:259 msgid "Class Objects" @@ -457,11 +461,11 @@ msgstr "" msgid "" "*Attribute references* use the standard syntax used for all attribute " "references in Python: ``obj.name``. Valid attribute names are all the names " -"that were in the class's namespace when the class object was created. So, if " -"the class definition looked like this::" +"that were in the class's namespace when the class object was created. So, " +"if the class definition looked like this::" msgstr "" -"*屬性參照*\\ 使用 Python 中所有屬性參照的標準語法:\\ ``obj.name``。有效的屬性" -"名稱是 class 物件被建立時,class 的命名空間中所有的名稱。所以,如果 class " +"*屬性參照*\\ 使用 Python 中所有屬性參照的標準語法:\\ ``obj.name``。有效的屬" +"性名稱是 class 物件被建立時,class 的命名空間中所有的名稱。所以,如果 class " "definition 看起來像這樣:\n" "\n" "::" @@ -474,10 +478,10 @@ msgid "" "assignment. :attr:`__doc__` is also a valid attribute, returning the " "docstring belonging to the class: ``\"A simple example class\"``." msgstr "" -"那麼 ``MyClass.i`` 和 ``MyClass.f`` 都是有效的屬性參照,會分別回傳一個整數和一" -"個函式物件。Class 屬性也可以被指派 (assign),所以您可以透過賦值改變 ``MyClass." -"i`` 的值。\\ :attr:`__doc__` 也是一個有效的屬性,會回傳屬於該 class 的說明字" -"串 (docstring):\\ ``\"A simple example class\"``。" +"那麼 ``MyClass.i`` 和 ``MyClass.f`` 都是有效的屬性參照,會分別回傳一個整數和" +"一個函式物件。Class 屬性也可以被指派 (assign),所以您可以透過賦值改變 " +"``MyClass.i`` 的值。\\ :attr:`__doc__` 也是一個有效的屬性,會回傳屬於該 " +"class 的說明字串 (docstring):\\ ``\"A simple example class\"``。" #: ../../tutorial/classes.rst:282 msgid "" @@ -485,8 +489,8 @@ msgid "" "object is a parameterless function that returns a new instance of the class. " "For example (assuming the above class)::" msgstr "" -"Class *實例化*\\ 使用了函式記法 (function notation)。就好像 class 物件是一個沒" -"有參數的函式,它回傳一個新的 class 實例。例如(假設是上述的 class):\n" +"Class *實例化*\\ 使用了函式記法 (function notation)。就好像 class 物件是一個" +"沒有參數的函式,它回傳一個新的 class 實例。例如(假設是上述的 class):\n" "\n" "::" @@ -503,8 +507,8 @@ msgid "" "specific initial state. Therefore a class may define a special method named :" "meth:`__init__`, like this::" msgstr "" -"實例化運算(「呼叫」一個 class 物件)會建立一個空的物件。許多 class 喜歡在建立" -"物件時有著自訂的特定實例初始狀態。因此,class 可以定義一個名為 :meth:" +"實例化運算(「呼叫」一個 class 物件)會建立一個空的物件。許多 class 喜歡在建" +"立物件時有著自訂的特定實例初始狀態。因此,class 可以定義一個名為 :meth:" "`__init__` 的特別 method,像這樣:\n" "\n" "::" @@ -512,11 +516,12 @@ msgstr "" #: ../../tutorial/classes.rst:299 msgid "" "When a class defines an :meth:`__init__` method, class instantiation " -"automatically invokes :meth:`__init__` for the newly-created class instance. " -"So in this example, a new, initialized instance can be obtained by::" +"automatically invokes :meth:`__init__` for the newly-created class " +"instance. So in this example, a new, initialized instance can be obtained " +"by::" msgstr "" -"當 class 定義了 :meth:`__init__` method,class 實例化會為新建的 class 實例自動" -"調用 :meth:`__init__`。所以在這個範例中,一個新的、初始化的實例可以如此獲" +"當 class 定義了 :meth:`__init__` method,class 實例化會為新建的 class 實例自" +"動調用 :meth:`__init__`。所以在這個範例中,一個新的、初始化的實例可以如此獲" "得:\n" "\n" "::" @@ -542,8 +547,8 @@ msgid "" "instance objects are attribute references. There are two kinds of valid " "attribute names: data attributes and methods." msgstr "" -"現在,我們可以如何處理實例物件?實例物件能理解的唯一運算就是屬性參照。有兩種有" -"效的屬性名稱:資料屬性 (data attribute) 和 method。" +"現在,我們可以如何處理實例物件?實例物件能理解的唯一運算就是屬性參照。有兩種" +"有效的屬性名稱:資料屬性 (data attribute) 和 method。" #: ../../tutorial/classes.rst:328 msgid "" @@ -551,7 +556,8 @@ msgid "" "\"data members\" in C++. Data attributes need not be declared; like local " "variables, they spring into existence when they are first assigned to. For " "example, if ``x`` is the instance of :class:`MyClass` created above, the " -"following piece of code will print the value ``16``, without leaving a trace::" +"following piece of code will print the value ``16``, without leaving a " +"trace::" msgstr "" "*資料屬性*\\ 對應 Smalltalk 中的「實例變數」,以及 C++ 中的「資料成員」。資料" "屬性不需要被宣告;和區域變數一樣,它們在第一次被賦值時就會立即存在。例如,如" @@ -572,18 +578,18 @@ msgid "" msgstr "" "實例的另一種屬性參照是 *method*\\ 。Method 是一個「屬於」物件的函式。(在 " "Python 中,術語 method 並不是 class 實例所獨有的:其他物件型別也可以有 " -"method。例如,list 物件具有稱為 append、insert、remove、sort 等 method。但是," -"在下面的討論中,我們將用術語 method 來專門表示 class 實例物件的 method,除非另" -"有明確說明。)" +"method。例如,list 物件具有稱為 append、insert、remove、sort 等 method。但" +"是,在下面的討論中,我們將用術語 method 來專門表示 class 實例物件的 method," +"除非另有明確說明。)" #: ../../tutorial/classes.rst:349 msgid "" -"Valid method names of an instance object depend on its class. By definition, " -"all attributes of a class that are function objects define corresponding " -"methods of its instances. So in our example, ``x.f`` is a valid method " -"reference, since ``MyClass.f`` is a function, but ``x.i`` is not, since " -"``MyClass.i`` is not. But ``x.f`` is not the same thing as ``MyClass.f`` --- " -"it is a *method object*, not a function object." +"Valid method names of an instance object depend on its class. By " +"definition, all attributes of a class that are function objects define " +"corresponding methods of its instances. So in our example, ``x.f`` is a " +"valid method reference, since ``MyClass.f`` is a function, but ``x.i`` is " +"not, since ``MyClass.i`` is not. But ``x.f`` is not the same thing as " +"``MyClass.f`` --- it is a *method object*, not a function object." msgstr "" "實例物件的有效 method 名稱取決於其 class。根據定義,一個 class 中所有的函式物" "件屬性,就定義了實例的對應 method。所以在我們的例子中,\\ ``x.f`` 是一個有效" @@ -609,9 +615,9 @@ msgid "" "is a method object, and can be stored away and called at a later time. For " "example::" msgstr "" -"在 :class:`MyClass` 的例子中,這將回傳字串 ``’hello world’``。然而,並沒有必要" -"立即呼叫一個 method:\\ ``x.f`` 是一個 method 物件,並且可以被儲藏起來,之後再" -"被呼叫。舉例來說:\n" +"在 :class:`MyClass` 的例子中,這將回傳字串 ``’hello world’``。然而,並沒有必" +"要立即呼叫一個 method:\\ ``x.f`` 是一個 method 物件,並且可以被儲藏起來,之" +"後再被呼叫。舉例來說:\n" "\n" "::" @@ -625,7 +631,8 @@ msgid "" "f()`` was called without an argument above, even though the function " "definition for :meth:`f` specified an argument. What happened to the " "argument? Surely Python raises an exception when a function that requires an " -"argument is called without any --- even if the argument isn't actually used..." +"argument is called without any --- even if the argument isn't actually " +"used..." msgstr "" "當一個 method 被呼叫時究竟會發生什麼事?你可能已經注意到 ``x.f()`` 被呼叫時沒" "有任何的引數,儘管 :meth:`f` 的函式定義有指定一個引數。這個引數發生了什麼事?" @@ -634,17 +641,18 @@ msgstr "" #: ../../tutorial/classes.rst:382 msgid "" -"Actually, you may have guessed the answer: the special thing about methods is " -"that the instance object is passed as the first argument of the function. In " -"our example, the call ``x.f()`` is exactly equivalent to ``MyClass.f(x)``. " -"In general, calling a method with a list of *n* arguments is equivalent to " -"calling the corresponding function with an argument list that is created by " -"inserting the method's instance object before the first argument." +"Actually, you may have guessed the answer: the special thing about methods " +"is that the instance object is passed as the first argument of the " +"function. In our example, the call ``x.f()`` is exactly equivalent to " +"``MyClass.f(x)``. In general, calling a method with a list of *n* arguments " +"is equivalent to calling the corresponding function with an argument list " +"that is created by inserting the method's instance object before the first " +"argument." msgstr "" "事實上,你可能已經猜到了答案:method 的特殊之處在於,實例物件會作為函式中的第" -"一個引數被傳遞。在我們的例子中,\\ ``x.f()`` 這個呼叫等同於 ``MyClass.f(x)``。" -"一般來說,呼叫一個有 *n* 個引數的 method,等同於呼叫一個對應函式,其引數列表 " -"(argument list) 被建立時,會在第一個引數前插入該 method 的實例物件。" +"一個引數被傳遞。在我們的例子中,\\ ``x.f()`` 這個呼叫等同於 ``MyClass." +"f(x)``。一般來說,呼叫一個有 *n* 個引數的 method,等同於呼叫一個對應函式,其" +"引數列表 (argument list) 被建立時,會在第一個引數前插入該 method 的實例物件。" #: ../../tutorial/classes.rst:389 msgid "" @@ -658,12 +666,12 @@ msgid "" "from the instance object and the argument list, and the function object is " "called with this new argument list." msgstr "" -"如果你仍然不了解 method 怎麼運作,看一眼實作可能會清楚一些事。當一個實例的非資" -"料屬性被參照時,該實例的 class 會被搜尋。如果該名稱是一個有效的 class 屬性,而" -"且是一個函式物件,則一個 method 物件會被建立,建立的方法是藉由打包(指向)該實" -"例物件及剛被找到的函式物件,形成一個抽象的物件:這就是 method 物件。當 method " -"物件帶著一個引數列表被呼叫,則一個新的引數列表會從實例物件和該引數列表被建構," -"而該函式物件會以這個新的引數列表被呼叫。" +"如果你仍然不了解 method 怎麼運作,看一眼實作可能會清楚一些事。當一個實例的非" +"資料屬性被參照時,該實例的 class 會被搜尋。如果該名稱是一個有效的 class 屬" +"性,而且是一個函式物件,則一個 method 物件會被建立,建立的方法是藉由打包(指" +"向)該實例物件及剛被找到的函式物件,形成一個抽象的物件:這就是 method 物件。" +"當 method 物件帶著一個引數列表被呼叫,則一個新的引數列表會從實例物件和該引數" +"列表被建構,而該函式物件會以這個新的引數列表被呼叫。" #: ../../tutorial/classes.rst:403 msgid "Class and Instance Variables" @@ -672,11 +680,11 @@ msgstr "Class 及實例變數" #: ../../tutorial/classes.rst:405 msgid "" "Generally speaking, instance variables are for data unique to each instance " -"and class variables are for attributes and methods shared by all instances of " -"the class::" +"and class variables are for attributes and methods shared by all instances " +"of the class::" msgstr "" -"一般來說,實例變數用於每一個實例的獨特資料,而 class 變數用於該 class 的所有實" -"例共享的屬性和 method:\n" +"一般來說,實例變數用於每一個實例的獨特資料,而 class 變數用於該 class 的所有" +"實例共享的屬性和 method:\n" "\n" "::" @@ -684,9 +692,9 @@ msgstr "" msgid "" "As discussed in :ref:`tut-object`, shared data can have possibly surprising " "effects with involving :term:`mutable` objects such as lists and " -"dictionaries. For example, the *tricks* list in the following code should not " -"be used as a class variable because just a single list would be shared by all " -"*Dog* instances::" +"dictionaries. For example, the *tricks* list in the following code should " +"not be used as a class variable because just a single list would be shared " +"by all *Dog* instances::" msgstr "" "如同在\\ :ref:`tut-object`\\ 的討論,共享的資料若涉及 :term:`mutable` 物件," "如 list 和 dictionary,可能會產生意外的影響。舉例來說,下列程式碼的 *tricks* " @@ -715,23 +723,23 @@ msgstr "" "\n" "::" -#: ../../tutorial/classes.rst:485 +#: ../../tutorial/classes.rst:493 msgid "" "Data attributes may be referenced by methods as well as by ordinary users " "(\"clients\") of an object. In other words, classes are not usable to " "implement pure abstract data types. In fact, nothing in Python makes it " -"possible to enforce data hiding --- it is all based upon convention. (On the " -"other hand, the Python implementation, written in C, can completely hide " -"implementation details and control access to an object if necessary; this can " -"be used by extensions to Python written in C.)" +"possible to enforce data hiding --- it is all based upon convention. (On " +"the other hand, the Python implementation, written in C, can completely hide " +"implementation details and control access to an object if necessary; this " +"can be used by extensions to Python written in C.)" msgstr "" "資料屬性可能被 method 或是被物件的一般使用者(「客戶端」)所參照。也就是說," -"class 不可用於實作純粹抽象的資料型別。事實上,在 Python 中沒有任何可能的方法," -"可強制隱藏資料——這都是基於慣例。(另一方面,以 C 編寫的 Python 實作可以完全隱" -"藏實作細節並且在必要時控制物件的存取;這可以被以 C 編寫的 Python 擴充所使" +"class 不可用於實作純粹抽象的資料型別。事實上,在 Python 中沒有任何可能的方" +"法,可強制隱藏資料——這都是基於慣例。(另一方面,以 C 編寫的 Python 實作可以完" +"全隱藏實作細節並且在必要時控制物件的存取;這可以被以 C 編寫的 Python 擴充所使" "用。)" -#: ../../tutorial/classes.rst:493 +#: ../../tutorial/classes.rst:501 msgid "" "Clients should use data attributes with care --- clients may mess up " "invariants maintained by the methods by stamping on their data attributes. " @@ -741,38 +749,39 @@ msgid "" msgstr "" "客戶端應該小心使用資料屬性——客戶端可能會因為覆寫他們的資料屬性,而破壞了被 " "method 維護的不變性。注意,客戶端可以增加他們自己的資料屬性到實例物件,但不影" -"響 method 的有效性,只要避免名稱衝突即可——再一次提醒,命名慣例可以在這裡節省很" -"多麻煩。" +"響 method 的有效性,只要避免名稱衝突即可——再一次提醒,命名慣例可以在這裡節省" +"很多麻煩。" -#: ../../tutorial/classes.rst:499 +#: ../../tutorial/classes.rst:507 msgid "" "There is no shorthand for referencing data attributes (or other methods!) " "from within methods. I find that this actually increases the readability of " "methods: there is no chance of confusing local variables and instance " "variables when glancing through a method." msgstr "" -"在 method 中參照資料屬性(或其他 method!)是沒有簡寫的。我發現這實際上增加了 " -"method 的可閱讀性:在瀏覽 method 時,絕不會混淆區域變數和實例變數。" +"在 method 中參照資料屬性(或其他 method!)是沒有簡寫的。我發現這實際上增加" +"了 method 的可閱讀性:在瀏覽 method 時,絕不會混淆區域變數和實例變數。" -#: ../../tutorial/classes.rst:504 +#: ../../tutorial/classes.rst:512 msgid "" "Often, the first argument of a method is called ``self``. This is nothing " "more than a convention: the name ``self`` has absolutely no special meaning " -"to Python. Note, however, that by not following the convention your code may " -"be less readable to other Python programmers, and it is also conceivable that " -"a *class browser* program might be written that relies upon such a convention." +"to Python. Note, however, that by not following the convention your code " +"may be less readable to other Python programmers, and it is also conceivable " +"that a *class browser* program might be written that relies upon such a " +"convention." msgstr "" "通常,方法的第一個引數稱為 ``self``。這僅僅只是一個慣例:\\ ``self`` 這個名字" -"對 Python 來說完全沒有特別的意義。但請注意,如果不遵循慣例,你的程式碼可能對其" -"他 Python 程式設計師來說可讀性較低,此外,也可以想像一個可能因信任此慣例而編寫" -"的 *class 瀏覽器 (browser)* 程式。" +"對 Python 來說完全沒有特別的意義。但請注意,如果不遵循慣例,你的程式碼可能對" +"其他 Python 程式設計師來說可讀性較低,此外,也可以想像一個可能因信任此慣例而" +"編寫的 *class 瀏覽器 (browser)* 程式。" -#: ../../tutorial/classes.rst:510 +#: ../../tutorial/classes.rst:518 msgid "" "Any function object that is a class attribute defines a method for instances " -"of that class. It is not necessary that the function definition is textually " -"enclosed in the class definition: assigning a function object to a local " -"variable in the class is also ok. For example::" +"of that class. It is not necessary that the function definition is " +"textually enclosed in the class definition: assigning a function object to a " +"local variable in the class is also ok. For example::" msgstr "" "任何一個作為 class 屬性的函式物件都為該 class 的實例定義了一個相應的 method。" "函式定義不一定要包含在 class definition 的文本中:將函式物件指定給 class 中的" @@ -780,18 +789,18 @@ msgstr "" "\n" "::" -#: ../../tutorial/classes.rst:527 +#: ../../tutorial/classes.rst:535 msgid "" "Now ``f``, ``g`` and ``h`` are all attributes of class :class:`C` that refer " "to function objects, and consequently they are all methods of instances of :" "class:`C` --- ``h`` being exactly equivalent to ``g``. Note that this " "practice usually only serves to confuse the reader of a program." msgstr "" -"現在 ``f``、\\ ``g`` 和 ``h`` 都是 class :class:`C` 的屬性,並指向函式物件,所" -"以他們都是class :class:`C` 實例的 method —— ``h`` 與 ``g`` 是完全一樣的。請注" -"意,這種做法通常只會使該程式的讀者感到困惑。" +"現在 ``f``、\\ ``g`` 和 ``h`` 都是 class :class:`C` 的屬性,並指向函式物件," +"所以他們都是class :class:`C` 實例的 method —— ``h`` 與 ``g`` 是完全一樣的。請" +"注意,這種做法通常只會使該程式的讀者感到困惑。" -#: ../../tutorial/classes.rst:532 +#: ../../tutorial/classes.rst:540 msgid "" "Methods may call other methods by using method attributes of the ``self`` " "argument::" @@ -800,7 +809,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/classes.rst:546 +#: ../../tutorial/classes.rst:554 msgid "" "Methods may reference global names in the same way as ordinary functions. " "The global scope associated with a method is the module containing its " @@ -816,10 +825,10 @@ msgstr "" "是包含其定義的模組。(class 永遠不會被用作全域作用域。)雖然人們很少有在 " "method 中使用全域資料的充分理由,但全域作用域仍有許多合法的使用:比方說,被 " "import 至全域作用域的函式和模組,可以被 method 以及在該作用域中定義的函式和 " -"class 所使用。通常,包含 method 的 class,它本身就是被定義在這個全域作用域,在" -"下一節,我們將看到 method 想要參照自己的 class 的一些好原因。" +"class 所使用。通常,包含 method 的 class,它本身就是被定義在這個全域作用域," +"在下一節,我們將看到 method 想要參照自己的 class 的一些好原因。" -#: ../../tutorial/classes.rst:556 +#: ../../tutorial/classes.rst:564 msgid "" "Each value is an object, and therefore has a *class* (also called its " "*type*). It is stored as ``object.__class__``." @@ -827,11 +836,11 @@ msgstr "" "每個值都是一個物件,因此都具有一個 *class*\\ ,也可以稱為它的 *type(型別)*" "\\ 。它以 ``object.__class__`` 被儲存。" -#: ../../tutorial/classes.rst:563 +#: ../../tutorial/classes.rst:571 msgid "Inheritance" msgstr "繼承 (Inheritance)" -#: ../../tutorial/classes.rst:565 +#: ../../tutorial/classes.rst:573 msgid "" "Of course, a language feature would not be worthy of the name \"class\" " "without supporting inheritance. The syntax for a derived class definition " @@ -842,12 +851,12 @@ msgstr "" "\n" "::" -#: ../../tutorial/classes.rst:576 +#: ../../tutorial/classes.rst:584 msgid "" "The name :class:`BaseClassName` must be defined in a scope containing the " "derived class definition. In place of a base class name, other arbitrary " -"expressions are also allowed. This can be useful, for example, when the base " -"class is defined in another module::" +"expressions are also allowed. This can be useful, for example, when the " +"base class is defined in another module::" msgstr "" "名稱 :class:`BaseClassName` 被定義的作用域必須是包含 derived class 定義的作用" "域。要代替 base class(基底類別)的名稱,用其他任意的運算式也是被允許的。這會" @@ -855,7 +864,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/classes.rst:583 +#: ../../tutorial/classes.rst:591 msgid "" "Execution of a derived class definition proceeds the same as for a base " "class. When the class object is constructed, the base class is remembered. " @@ -864,12 +873,12 @@ msgid "" "rule is applied recursively if the base class itself is derived from some " "other class." msgstr "" -"執行 derived class 定義的過程,與執行 base class 相同。當 class 物件被建構時," -"base class 會被記住。這是用於解析屬性參照:如果一個要求的屬性無法在該 class 中" -"找到,則會繼續在 base class 中搜尋。假如該 base class 本身也是衍生自其他 " -"class,則這個規則會遞迴地被應用。" +"執行 derived class 定義的過程,與執行 base class 相同。當 class 物件被建構" +"時,base class 會被記住。這是用於解析屬性參照:如果一個要求的屬性無法在該 " +"class 中找到,則會繼續在 base class 中搜尋。假如該 base class 本身也是衍生自" +"其他 class,則這個規則會遞迴地被應用。" -#: ../../tutorial/classes.rst:589 +#: ../../tutorial/classes.rst:597 msgid "" "There's nothing special about instantiation of derived classes: " "``DerivedClassName()`` creates a new instance of the class. Method " @@ -877,30 +886,30 @@ msgid "" "searched, descending down the chain of base classes if necessary, and the " "method reference is valid if this yields a function object." msgstr "" -"關於 derived class 的實例化並沒有特別之處:\\ ``DerivedClassName()`` 會建立該 " -"class 的一個新實例。Method 的參照被解析如下:對應的 class 屬性會被搜尋,如果需" -"要,沿著 base class 的繼承鍊往下走,如果這產生了一個函式物件,則該 method 的參" -"照是有效的。" +"關於 derived class 的實例化並沒有特別之處:\\ ``DerivedClassName()`` 會建立" +"該 class 的一個新實例。Method 的參照被解析如下:對應的 class 屬性會被搜尋,如" +"果需要,沿著 base class 的繼承鍊往下走,如果這產生了一個函式物件,則該 " +"method 的參照是有效的。" -#: ../../tutorial/classes.rst:595 +#: ../../tutorial/classes.rst:603 msgid "" "Derived classes may override methods of their base classes. Because methods " "have no special privileges when calling other methods of the same object, a " "method of a base class that calls another method defined in the same base " -"class may end up calling a method of a derived class that overrides it. (For " -"C++ programmers: all methods in Python are effectively ``virtual``.)" +"class may end up calling a method of a derived class that overrides it. " +"(For C++ programmers: all methods in Python are effectively ``virtual``.)" msgstr "" "Derived class 可以覆寫其 base class 的 method。因為 method 在呼叫同一個物件的" -"其他 method 時沒有特別的特權,所以當 base class 的一個 method 在呼叫相同 base " -"class 中定義的另一個 method 時,最終可能會呼叫到一個覆寫它的 derived class 中" -"的 method。(給 C++ 程式設計師:Python 中所有 method 實際上都是 " +"其他 method 時沒有特別的特權,所以當 base class 的一個 method 在呼叫相同 " +"base class 中定義的另一個 method 時,最終可能會呼叫到一個覆寫它的 derived " +"class 中的 method。(給 C++ 程式設計師:Python 中所有 method 實際上都是 " "``virtual``。)" -#: ../../tutorial/classes.rst:601 +#: ../../tutorial/classes.rst:609 msgid "" "An overriding method in a derived class may in fact want to extend rather " -"than simply replace the base class method of the same name. There is a simple " -"way to call the base class method directly: just call ``BaseClassName." +"than simply replace the base class method of the same name. There is a " +"simple way to call the base class method directly: just call ``BaseClassName." "methodname(self, arguments)``. This is occasionally useful to clients as " "well. (Note that this only works if the base class is accessible as " "``BaseClassName`` in the global scope.)" @@ -911,11 +920,11 @@ msgstr "" "用。(請注意,只有在 base class 在全域作用域可以用 ``BaseClassName`` 被存取" "時,這方法才有效。)" -#: ../../tutorial/classes.rst:608 +#: ../../tutorial/classes.rst:616 msgid "Python has two built-in functions that work with inheritance:" msgstr "Python 有兩個內建函式可以用於繼承:" -#: ../../tutorial/classes.rst:610 +#: ../../tutorial/classes.rst:618 msgid "" "Use :func:`isinstance` to check an instance's type: ``isinstance(obj, int)`` " "will be ``True`` only if ``obj.__class__`` is :class:`int` or some class " @@ -925,7 +934,7 @@ msgstr "" "在 ``obj.__class__`` 是 :class:`int` 或衍伸自 :class:`int` 時,結果才會是 " "``True``。" -#: ../../tutorial/classes.rst:614 +#: ../../tutorial/classes.rst:622 msgid "" "Use :func:`issubclass` to check class inheritance: ``issubclass(bool, int)`` " "is ``True`` since :class:`bool` is a subclass of :class:`int`. However, " @@ -937,11 +946,11 @@ msgstr "" "``issubclass(float, int)`` 是 ``False``,因為 :class:`float` 並不是 :class:" "`int` 的 subclass。" -#: ../../tutorial/classes.rst:624 +#: ../../tutorial/classes.rst:632 msgid "Multiple Inheritance" msgstr "多重繼承" -#: ../../tutorial/classes.rst:626 +#: ../../tutorial/classes.rst:634 msgid "" "Python supports a form of multiple inheritance as well. A class definition " "with multiple base classes looks like this::" @@ -951,23 +960,23 @@ msgstr "" "\n" "::" -#: ../../tutorial/classes.rst:636 +#: ../../tutorial/classes.rst:644 msgid "" "For most purposes, in the simplest cases, you can think of the search for " "attributes inherited from a parent class as depth-first, left-to-right, not " -"searching twice in the same class where there is an overlap in the hierarchy. " -"Thus, if an attribute is not found in :class:`DerivedClassName`, it is " -"searched for in :class:`Base1`, then (recursively) in the base classes of :" -"class:`Base1`, and if it was not found there, it was searched for in :class:" -"`Base2`, and so on." +"searching twice in the same class where there is an overlap in the " +"hierarchy. Thus, if an attribute is not found in :class:`DerivedClassName`, " +"it is searched for in :class:`Base1`, then (recursively) in the base classes " +"of :class:`Base1`, and if it was not found there, it was searched for in :" +"class:`Base2`, and so on." msgstr "" "在大多數情況下,最簡單的例子裡,你可以這樣思考,對於繼承自 parent class(父類" "別)的屬性,其搜尋規則為:深度優先、從左到右、在階層裡重疊的相同 class 中不重" "複搜尋。因此,假如有一個屬性在 :class:`DerivedClassName` 沒有被找到,則在 :" -"class:`Base1` 搜尋它,接著(遞迴地)在 :class:`Base1` 的 base class 中搜尋,假" -"如在那裡又沒有找到的話,會在 :class:`Base2` 搜尋,依此類推。" +"class:`Base1` 搜尋它,接著(遞迴地)在 :class:`Base1` 的 base class 中搜尋," +"假如在那裡又沒有找到的話,會在 :class:`Base2` 搜尋,依此類推。" -#: ../../tutorial/classes.rst:643 +#: ../../tutorial/classes.rst:651 msgid "" "In fact, it is slightly more complex than that; the method resolution order " "changes dynamically to support cooperative calls to :func:`super`. This " @@ -975,11 +984,11 @@ msgid "" "method and is more powerful than the super call found in single-inheritance " "languages." msgstr "" -"事實上,它稍微複雜一些;method 的解析順序是動態地變化,以支援對 :func:`super` " -"的合作呼叫。這個方式在其他的多重繼承語言中,稱為呼叫下一個方法 (call-next-" -"method),且比在單一繼承語言中的 super call(超級呼叫)來得更強大。" +"事實上,它稍微複雜一些;method 的解析順序是動態地變化,以支援對 :func:" +"`super` 的合作呼叫。這個方式在其他的多重繼承語言中,稱為呼叫下一個方法 (call-" +"next-method),且比在單一繼承語言中的 super call(超級呼叫)來得更強大。" -#: ../../tutorial/classes.rst:649 +#: ../../tutorial/classes.rst:657 msgid "" "Dynamic ordering is necessary because all cases of multiple inheritance " "exhibit one or more diamond relationships (where at least one of the parent " @@ -988,61 +997,61 @@ msgid "" "multiple inheritance provides more than one path to reach :class:`object`. " "To keep the base classes from being accessed more than once, the dynamic " "algorithm linearizes the search order in a way that preserves the left-to-" -"right ordering specified in each class, that calls each parent only once, and " -"that is monotonic (meaning that a class can be subclassed without affecting " -"the precedence order of its parents). Taken together, these properties make " -"it possible to design reliable and extensible classes with multiple " -"inheritance. For more detail, see https://www.python.org/download/" +"right ordering specified in each class, that calls each parent only once, " +"and that is monotonic (meaning that a class can be subclassed without " +"affecting the precedence order of its parents). Taken together, these " +"properties make it possible to design reliable and extensible classes with " +"multiple inheritance. For more detail, see https://www.python.org/download/" "releases/2.3/mro/." msgstr "" "動態排序是必要的,因為多重繼承的所有情況都表現一或多的菱形關係(其中至少一個 " "parent class 可以從最底層 class 透過多個路徑存取)。例如,所有的 class 都繼承" -"自 :class:`object`\\ ,因此任何多重繼承的情況都提供了多個到達 :class:`object` " -"的路徑。為了避免 base class 被多次存取,動態演算法以這些方式將搜尋順序線性化 " -"(linearize):保留每個 class 中規定的從左到右的順序、對每個 parent 只會呼叫一" -"次、使用單調的 (monotonic) 方式(意思是,一個 class 可以被 subclassed(子類別" -"化),而不會影響其 parent 的搜尋優先順序)。總之,這些特性使設計出可靠又可擴" -"充、具有多重繼承的 class 成為可能。更多資訊,請見 https://www.python.org/" -"download/releases/2.3/mro/。" - -#: ../../tutorial/classes.rst:666 +"自 :class:`object`\\ ,因此任何多重繼承的情況都提供了多個到達 :class:" +"`object` 的路徑。為了避免 base class 被多次存取,動態演算法以這些方式將搜尋順" +"序線性化 (linearize):保留每個 class 中規定的從左到右的順序、對每個 parent 只" +"會呼叫一次、使用單調的 (monotonic) 方式(意思是,一個 class 可以被 " +"subclassed(子類別化),而不會影響其 parent 的搜尋優先順序)。總之,這些特性" +"使設計出可靠又可擴充、具有多重繼承的 class 成為可能。更多資訊,請見 https://" +"www.python.org/download/releases/2.3/mro/。" + +#: ../../tutorial/classes.rst:674 msgid "Private Variables" msgstr "私有變數" -#: ../../tutorial/classes.rst:668 +#: ../../tutorial/classes.rst:676 msgid "" "\"Private\" instance variables that cannot be accessed except from inside an " "object don't exist in Python. However, there is a convention that is " "followed by most Python code: a name prefixed with an underscore (e.g. " -"``_spam``) should be treated as a non-public part of the API (whether it is a " -"function, a method or a data member). It should be considered an " +"``_spam``) should be treated as a non-public part of the API (whether it is " +"a function, a method or a data member). It should be considered an " "implementation detail and subject to change without notice." msgstr "" -"「私有」(private) 實例變數,指的是不在物件內部便無法存取的變數,這在 Python 中" -"是不存在的。但是,大多數 Python 的程式碼都遵守一個慣例:前綴為一個底線的名稱" -"(如:\\ ``_spam``)應被視為 API (應用程式介面)的非公有 (non-public) 部分" -"(無論它是函式、方法或是資料成員)。這被視為一個實作細節,如有調整,亦不另行通" -"知。" +"「私有」(private) 實例變數,指的是不在物件內部便無法存取的變數,這在 Python " +"中是不存在的。但是,大多數 Python 的程式碼都遵守一個慣例:前綴為一個底線的名" +"稱(如:\\ ``_spam``)應被視為 API (應用程式介面)的非公有 (non-public) 部分" +"(無論它是函式、方法或是資料成員)。這被視為一個實作細節,如有調整,亦不另行" +"通知。" -#: ../../tutorial/classes.rst:675 +#: ../../tutorial/classes.rst:686 msgid "" "Since there is a valid use-case for class-private members (namely to avoid " "name clashes of names with names defined by subclasses), there is limited " -"support for such a mechanism, called :dfn:`name mangling`. Any identifier of " -"the form ``__spam`` (at least two leading underscores, at most one trailing " -"underscore) is textually replaced with ``_classname__spam``, where " -"``classname`` is the current class name with leading underscore(s) stripped. " -"This mangling is done without regard to the syntactic position of the " -"identifier, as long as it occurs within the definition of a class." +"support for such a mechanism, called :dfn:`name mangling`. Any identifier " +"of the form ``__spam`` (at least two leading underscores, at most one " +"trailing underscore) is textually replaced with ``_classname__spam``, where " +"``classname`` is the current class name with leading underscore(s) " +"stripped. This mangling is done without regard to the syntactic position of " +"the identifier, as long as it occurs within the definition of a class." msgstr "" "既然 class 私有的成員已有一個有效的用例(即避免名稱與 subclass 定義的名稱衝" "突),這種機制也存在另一個有限的支援,稱為 :dfn:`name mangling`\\ (名稱修" -"飾)。任何格式為 ``__spam``\\ (至少兩個前導下底線,最多一個尾隨下底線)的物件" -"名稱 (identifier) 會被文本地被替換為 ``_classname__spam``,在此 ``classname`` " -"就是去掉前導下底線的當前 class 名稱。只要這個修飾是在 class 的定義之中發生,它" -"就會在不考慮該物件名稱的語法位置的情況下完成。" +"飾)。任何格式為 ``__spam``\\ (至少兩個前導下底線,最多一個尾隨下底線)的物" +"件名稱 (identifier) 會被文本地被替換為 ``_classname__spam``,在此 " +"``classname`` 就是去掉前導下底線的當前 class 名稱。只要這個修飾是在 class 的" +"定義之中發生,它就會在不考慮該物件名稱的語法位置的情況下完成。" -#: ../../tutorial/classes.rst:684 +#: ../../tutorial/classes.rst:695 msgid "" "Name mangling is helpful for letting subclasses override methods without " "breaking intraclass method calls. For example::" @@ -1052,27 +1061,28 @@ msgstr "" "\n" "::" -#: ../../tutorial/classes.rst:701 +#: ../../tutorial/classes.rst:717 msgid "" "The above example would work even if ``MappingSubclass`` were to introduce a " -"``__update`` identifier since it is replaced with ``_Mapping__update`` in the " -"``Mapping`` class and ``_MappingSubclass__update`` in the " +"``__update`` identifier since it is replaced with ``_Mapping__update`` in " +"the ``Mapping`` class and ``_MappingSubclass__update`` in the " "``MappingSubclass`` class respectively." msgstr "" "在上例中,就算在 ``MappingSubclass`` 當中加入 ``__update`` 識別符,也能順利運" "作,因為在 ``Mapping`` class 中,它會被替換為 ``_Mapping__update``,而在 " "``MappingSubclass`` class 中,它會被替換為 ``_MappingSubclass__update``。" -#: ../../tutorial/classes.rst:706 +#: ../../tutorial/classes.rst:722 msgid "" -"Note that the mangling rules are designed mostly to avoid accidents; it still " -"is possible to access or modify a variable that is considered private. This " -"can even be useful in special circumstances, such as in the debugger." +"Note that the mangling rules are designed mostly to avoid accidents; it " +"still is possible to access or modify a variable that is considered " +"private. This can even be useful in special circumstances, such as in the " +"debugger." msgstr "" -"請注意,修飾規則是被設計來避免意外;它仍可能存取或修改一個被視為私有的變數。這" -"在特殊情況下甚至可能很有用,例如在除錯器 (debugger)。" +"請注意,修飾規則是被設計來避免意外;它仍可能存取或修改一個被視為私有的變數。" +"這在特殊情況下甚至可能很有用,例如在除錯器 (debugger)。" -#: ../../tutorial/classes.rst:710 +#: ../../tutorial/classes.rst:726 msgid "" "Notice that code passed to ``exec()`` or ``eval()`` does not consider the " "classname of the invoking class to be the current class; this is similar to " @@ -1082,40 +1092,41 @@ msgid "" "referencing ``__dict__`` directly." msgstr "" "另外也注意,傳遞給 ``exec()`` 或 ``eval()`` 的程式碼不會把調用 class 的名稱視" -"為當前的 class;這和 ``global`` 陳述式的效果類似,該效果同樣僅限於整體被位元組" -"編譯後 (byte-compiled) 的程式碼。同樣的限制適用於 ``getattr()``," +"為當前的 class;這和 ``global`` 陳述式的效果類似,該效果同樣僅限於整體被位元" +"組編譯後 (byte-compiled) 的程式碼。同樣的限制適用於 ``getattr()``," "``setattr()`` 和 ``delattr()``,以及直接參照 ``__dict__`` 時。" -#: ../../tutorial/classes.rst:721 +#: ../../tutorial/classes.rst:737 msgid "Odds and Ends" msgstr "補充說明" -#: ../../tutorial/classes.rst:723 +#: ../../tutorial/classes.rst:739 msgid "" "Sometimes it is useful to have a data type similar to the Pascal \"record\" " "or C \"struct\", bundling together a few named data items. An empty class " "definition will do nicely::" msgstr "" "如果有一種資料型別,類似於 Pascal 的「record」或 C 的「struct」,可以將一些有" -"名稱的資料項目捆綁在一起,有時候這會很有用。其實一個空白的 class definition 就" -"可以勝任:\n" +"名稱的資料項目捆綁在一起,有時候這會很有用。其實一個空白的 class definition " +"就可以勝任:\n" "\n" "::" -#: ../../tutorial/classes.rst:737 +#: ../../tutorial/classes.rst:753 msgid "" -"A piece of Python code that expects a particular abstract data type can often " -"be passed a class that emulates the methods of that data type instead. For " -"instance, if you have a function that formats some data from a file object, " -"you can define a class with methods :meth:`read` and :meth:`!readline` that " -"get the data from a string buffer instead, and pass it as an argument." +"A piece of Python code that expects a particular abstract data type can " +"often be passed a class that emulates the methods of that data type " +"instead. For instance, if you have a function that formats some data from a " +"file object, you can define a class with methods :meth:`read` and :meth:`!" +"readline` that get the data from a string buffer instead, and pass it as an " +"argument." msgstr "" "用來處理特殊抽象資料型別的一段 Python 程式碼,經常能以傳遞一個 class 來替代," -"此 class 模擬該資料型別的多種 method。例如,如果你有一個函式,它會從一個檔案物" -"件來格式化某些資料,你也可以定義一個有 :meth:`read` 和 :meth:`!readline` " +"此 class 模擬該資料型別的多種 method。例如,如果你有一個函式,它會從一個檔案" +"物件來格式化某些資料,你也可以定義一個有 :meth:`read` 和 :meth:`!readline` " "method 的 class 作為替代方式,從字串緩衝區取得資料,並將其作為引數來傳遞。" -#: ../../tutorial/classes.rst:748 +#: ../../tutorial/classes.rst:764 msgid "" "Instance method objects have attributes, too: ``m.__self__`` is the instance " "object with the method :meth:`m`, and ``m.__func__`` is the function object " @@ -1124,11 +1135,11 @@ msgstr "" "實例的 method 物件也具有屬性:``m.__self__`` 就是帶有 method :meth:`m` 的實例" "物件,而 ``m.__func__`` 則是該 method 所對應的函式物件。" -#: ../../tutorial/classes.rst:756 +#: ../../tutorial/classes.rst:772 msgid "Iterators" msgstr "疊代器 (Iterator)" -#: ../../tutorial/classes.rst:758 +#: ../../tutorial/classes.rst:774 msgid "" "By now you have probably noticed that most container objects can be looped " "over using a :keyword:`for` statement::" @@ -1138,29 +1149,29 @@ msgstr "" "\n" "::" -#: ../../tutorial/classes.rst:772 -msgid "" -"This style of access is clear, concise, and convenient. The use of iterators " -"pervades and unifies Python. Behind the scenes, the :keyword:`for` statement " -"calls :func:`iter` on the container object. The function returns an iterator " -"object that defines the method :meth:`~iterator.__next__` which accesses " -"elements in the container one at a time. When there are no more elements, :" -"meth:`~iterator.__next__` raises a :exc:`StopIteration` exception which tells " -"the :keyword:`!for` loop to terminate. You can call the :meth:`~iterator." -"__next__` method using the :func:`next` built-in function; this example shows " -"how it all works::" -msgstr "" -"這種存取風格清晰、簡潔且方便。疊代器的使用在 Python 中處處可見且用法一致。在幕" -"後,\\ :keyword:`for` 陳述式會在容器物件上呼叫 :func:`iter`\\ 。該函式回傳一個" -"疊代器物件,此物件定義了 :meth:`~iterator.__next__` method,而此 method 會逐一" -"存取容器中的元素。當元素用盡時,\\ :meth:`~iterator.__next__` 將引發 :exc:" -"`StopIteration` 例外,來通知 :keyword:`!for` 終止迴圈。你可以使用內建函式 :" -"func:`next` 來呼叫 :meth:`~iterator.__next__` method;這個例子展示了它的運作方" -"式:\n" +#: ../../tutorial/classes.rst:788 +msgid "" +"This style of access is clear, concise, and convenient. The use of " +"iterators pervades and unifies Python. Behind the scenes, the :keyword:" +"`for` statement calls :func:`iter` on the container object. The function " +"returns an iterator object that defines the method :meth:`~iterator." +"__next__` which accesses elements in the container one at a time. When " +"there are no more elements, :meth:`~iterator.__next__` raises a :exc:" +"`StopIteration` exception which tells the :keyword:`!for` loop to " +"terminate. You can call the :meth:`~iterator.__next__` method using the :" +"func:`next` built-in function; this example shows how it all works::" +msgstr "" +"這種存取風格清晰、簡潔且方便。疊代器的使用在 Python 中處處可見且用法一致。在" +"幕後,\\ :keyword:`for` 陳述式會在容器物件上呼叫 :func:`iter`\\ 。該函式回傳" +"一個疊代器物件,此物件定義了 :meth:`~iterator.__next__` method,而此 method " +"會逐一存取容器中的元素。當元素用盡時,\\ :meth:`~iterator.__next__` 將引發 :" +"exc:`StopIteration` 例外,來通知 :keyword:`!for` 終止迴圈。你可以使用內建函" +"式 :func:`next` 來呼叫 :meth:`~iterator.__next__` method;這個例子展示了它的" +"運作方式:\n" "\n" "::" -#: ../../tutorial/classes.rst:797 +#: ../../tutorial/classes.rst:813 msgid "" "Having seen the mechanics behind the iterator protocol, it is easy to add " "iterator behavior to your classes. Define an :meth:`__iter__` method which " @@ -1168,17 +1179,17 @@ msgid "" "defines :meth:`__next__`, then :meth:`__iter__` can just return ``self``::" msgstr "" "看過疊代器協定的幕後機制後,在你的 class 加入疊代器的行為就很容易了。定義一" -"個 :meth:`__iter__` method 來回傳一個帶有 :meth:`~iterator.__next__` method 的" -"物件。如果 class 已定義了 :meth:`__next__`\\ ,則 :meth:`__iter__` 可以只回傳 " -"``self``:\n" +"個 :meth:`__iter__` method 來回傳一個帶有 :meth:`~iterator.__next__` method " +"的物件。如果 class 已定義了 :meth:`__next__`\\ ,則 :meth:`__iter__` 可以只回" +"傳 ``self``:\n" "\n" "::" -#: ../../tutorial/classes.rst:834 +#: ../../tutorial/classes.rst:850 msgid "Generators" msgstr "產生器 (Generator)" -#: ../../tutorial/classes.rst:836 +#: ../../tutorial/classes.rst:852 msgid "" ":term:`Generators ` are a simple and powerful tool for creating " "iterators. They are written like regular functions but use the :keyword:" @@ -1188,13 +1199,13 @@ msgid "" "that generators can be trivially easy to create::" msgstr "" ":term:`產生器 `\\ 是一個用於建立疊代器的簡單而強大的工具。它們的寫" -"法和常規的函式一樣,但當它們要回傳資料時,會使用 :keyword:`yield` 陳述式。每次" -"在產生器上呼叫 :func:`next` 時,它會從上次離開的位置恢復執行(它會記得所有資料" -"值以及上一個被執行的陳述式)。以下範例顯示,建立產生器可以相當地容易:\n" +"法和常規的函式一樣,但當它們要回傳資料時,會使用 :keyword:`yield` 陳述式。每" +"次在產生器上呼叫 :func:`next` 時,它會從上次離開的位置恢復執行(它會記得所有" +"資料值以及上一個被執行的陳述式)。以下範例顯示,建立產生器可以相當地容易:\n" "\n" "::" -#: ../../tutorial/classes.rst:857 +#: ../../tutorial/classes.rst:873 msgid "" "Anything that can be done with generators can also be done with class-based " "iterators as described in the previous section. What makes generators so " @@ -1205,18 +1216,18 @@ msgstr "" "描述。而讓產生器的程式碼更為精簡的原因是,\\ :meth:`__iter__` 和 :meth:" "`~generator.__next__` method 會自動被建立。" -#: ../../tutorial/classes.rst:862 +#: ../../tutorial/classes.rst:878 msgid "" "Another key feature is that the local variables and execution state are " "automatically saved between calls. This made the function easier to write " "and much more clear than an approach using instance variables like ``self." "index`` and ``self.data``." msgstr "" -"另一個關鍵的特性在於,區域變數和執行狀態會在每次呼叫之間自動被儲存。這使得該函" -"式比使用 ``self.index`` 和 ``self.data`` 這種實例變數的方式更容易編寫且更為清" -"晰。" +"另一個關鍵的特性在於,區域變數和執行狀態會在每次呼叫之間自動被儲存。這使得該" +"函式比使用 ``self.index`` 和 ``self.data`` 這種實例變數的方式更容易編寫且更為" +"清晰。" -#: ../../tutorial/classes.rst:867 +#: ../../tutorial/classes.rst:883 msgid "" "In addition to automatic method creation and saving program state, when " "generators terminate, they automatically raise :exc:`StopIteration`. In " @@ -1224,13 +1235,14 @@ msgid "" "effort than writing a regular function." msgstr "" "除了會自動建立 method 和儲存程式狀態,當產生器終止時,它們還會自動引發 :exc:" -"`StopIteration`\\ 。這些特性結合在一起,使建立疊代器能與編寫常規函式一樣容易。" +"`StopIteration`\\ 。這些特性結合在一起,使建立疊代器能與編寫常規函式一樣容" +"易。" -#: ../../tutorial/classes.rst:876 +#: ../../tutorial/classes.rst:892 msgid "Generator Expressions" msgstr "產生器運算式" -#: ../../tutorial/classes.rst:878 +#: ../../tutorial/classes.rst:894 msgid "" "Some simple generators can be coded succinctly as expressions using a syntax " "similar to list comprehensions but with parentheses instead of square " @@ -1241,22 +1253,22 @@ msgid "" msgstr "" "某些簡單的產生器可以寫成如運算式一般的簡潔程式碼,所用的語法類似 list " "comprehension(串列綜合運算),但外層為括號而非方括號。這種運算式被設計用於產" -"生器將立即被外圍函式 (enclosing function) 所使用的情況。產生器運算式與完整的產" -"生器定義相比,程式碼較精簡但功能較少,也比等效的 list comprehension 更為節省記" -"憶體。" +"生器將立即被外圍函式 (enclosing function) 所使用的情況。產生器運算式與完整的" +"產生器定義相比,程式碼較精簡但功能較少,也比等效的 list comprehension 更為節" +"省記憶體。" -#: ../../tutorial/classes.rst:885 +#: ../../tutorial/classes.rst:901 msgid "Examples::" msgstr "" "例如:\n" "\n" "::" -#: ../../tutorial/classes.rst:909 +#: ../../tutorial/classes.rst:922 msgid "Footnotes" msgstr "註解" -#: ../../tutorial/classes.rst:910 +#: ../../tutorial/classes.rst:923 msgid "" "Except for one thing. Module objects have a secret read-only attribute " "called :attr:`~object.__dict__` which returns the dictionary used to " @@ -1265,7 +1277,7 @@ msgid "" "abstraction of namespace implementation, and should be restricted to things " "like post-mortem debuggers." msgstr "" -"有一個例外。模組物件有一個秘密的唯讀屬性,稱為 :attr:`~object.__dict__`\\ ,它" -"回傳用於實作模組命名空間的 dictionary;\\ :attr:`~object.__dict__` 這個名稱是" -"一個屬性但不是全域名稱。顯然,使用此屬性將違反命名空間實作的抽象化,而應該僅限" -"用於事後除錯器 (post-mortem debugger) 之類的東西。" +"有一個例外。模組物件有一個秘密的唯讀屬性,稱為 :attr:`~object.__dict__`\\ ," +"它回傳用於實作模組命名空間的 dictionary;\\ :attr:`~object.__dict__` 這個名稱" +"是一個屬性但不是全域名稱。顯然,使用此屬性將違反命名空間實作的抽象化,而應該" +"僅限用於事後除錯器 (post-mortem debugger) 之類的東西。" diff --git a/tutorial/floatingpoint.po b/tutorial/floatingpoint.po index d360b39aa1..a2bcd52486 100644 --- a/tutorial/floatingpoint.po +++ b/tutorial/floatingpoint.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-15 13:12+0000\n" +"POT-Creation-Date: 2021-10-07 00:10+0000\n" "PO-Revision-Date: 2021-06-28 18:50+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -299,12 +299,13 @@ msgstr "" #: ../../tutorial/floatingpoint.rst:160 msgid "" "If you are a heavy user of floating point operations you should take a look " -"at the Numerical Python package and many other packages for mathematical and " +"at the NumPy package and many other packages for mathematical and " "statistical operations supplied by the SciPy project. See ." msgstr "" -"如果你是浮點運算的重度使用者,你應該看一下 Numerical Python (NumPy) 套件,以及由 SciPy " -"專案提供的許多用於數學和統計學運算的其他套件。請參閱 。" +"如果你是浮點運算的重度使用者,你應該看一下 NumPy 套件,以" +"及由 SciPy 專案提供的許多用於數學和統計學運算的其他套件。請參閱 。" #: ../../tutorial/floatingpoint.rst:164 msgid "" diff --git a/tutorial/modules.po b/tutorial/modules.po index 3ba1ddb33b..f25850d60b 100644 --- a/tutorial/modules.po +++ b/tutorial/modules.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-13 00:11+0000\n" +"POT-Creation-Date: 2021-09-24 00:11+0000\n" "PO-Revision-Date: 2021-06-06 22:22+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -299,10 +299,12 @@ msgstr "" "夾名稱)。" #: ../../tutorial/modules.rst:194 -msgid "The installation-dependent default." -msgstr "安裝相關的預設值。" +msgid "" +"The installation-dependent default (by convention including a ``site-" +"packages`` directory, handled by the :mod:`site` module)." +msgstr "" -#: ../../tutorial/modules.rst:197 +#: ../../tutorial/modules.rst:198 msgid "" "On file systems which support symlinks, the directory containing the input " "script is calculated after the symlink is followed. In other words the " @@ -312,7 +314,7 @@ msgstr "" "後才被計算的。換言之,包含符號連結的資料夾\\ **並沒有**\\ 增加到模組的搜尋路" "徑中。" -#: ../../tutorial/modules.rst:201 +#: ../../tutorial/modules.rst:202 msgid "" "After initialization, Python programs can modify :data:`sys.path`. The " "directory containing the script being run is placed at the beginning of the " @@ -326,11 +328,11 @@ msgstr "" "而不是函式庫資料夾中相同名稱的模組。除非是有意要做這樣的替換,否則這是一個錯" "誤。 請參見\\ :ref:`tut-standardmodules`\\ 以瞭解更多資訊。" -#: ../../tutorial/modules.rst:212 +#: ../../tutorial/modules.rst:213 msgid "\"Compiled\" Python files" msgstr "「編譯」Python 檔案" -#: ../../tutorial/modules.rst:214 +#: ../../tutorial/modules.rst:215 msgid "" "To speed up loading modules, Python caches the compiled version of each " "module in the ``__pycache__`` directory under the name :file:`module." @@ -346,7 +348,7 @@ msgstr "" "spam.py 的編譯版本將被暫存為 ``__pycache__/spam.cpython-33.pyc``\\ 。此命名準" "則可以讓來自不同版本的編譯模組和 Python 的不同版本同時共存。" -#: ../../tutorial/modules.rst:222 +#: ../../tutorial/modules.rst:223 msgid "" "Python checks the modification date of the source against the compiled " "version to see if it's out of date and needs to be recompiled. This is a " @@ -358,7 +360,7 @@ msgstr "" "完全自動的過程。另外,編譯後的模組獨立於平台,因此不同架構的作業系統之間可以" "共用同一函式庫。" -#: ../../tutorial/modules.rst:227 +#: ../../tutorial/modules.rst:228 msgid "" "Python does not check the cache in two circumstances. First, it always " "recompiles and does not store the result for the module that's loaded " @@ -371,11 +373,11 @@ msgstr "" "列載入的模組的結果。第二,如果沒有源模組,則不會檢查快取。要支援非源模組(僅" "編譯)的發布,編譯後的模組必須位於原始資料夾中,並且不能有源模組。" -#: ../../tutorial/modules.rst:234 +#: ../../tutorial/modules.rst:235 msgid "Some tips for experts:" msgstr "一些給專家的秘訣:" -#: ../../tutorial/modules.rst:236 +#: ../../tutorial/modules.rst:237 msgid "" "You can use the :option:`-O` or :option:`-OO` switches on the Python command " "to reduce the size of a compiled module. The ``-O`` switch removes assert " @@ -391,7 +393,7 @@ msgstr "" "只有在您知道自己在做什麼時,才應使用此參數。「已優化」模組有 ``opt-`` 標記," "且通常較小。未來的版本可能會改變優化的效果。" -#: ../../tutorial/modules.rst:244 +#: ../../tutorial/modules.rst:245 msgid "" "A program doesn't run any faster when it is read from a ``.pyc`` file than " "when it is read from a ``.py`` file; the only thing that's faster about ``." @@ -400,23 +402,23 @@ msgstr "" "讀取 ``.pyc`` 檔案時,程式的執行速度並不會比讀取 ``.py`` 檔案快。唯一比較快的" "地方是載入的速度。" -#: ../../tutorial/modules.rst:248 +#: ../../tutorial/modules.rst:249 msgid "" "The module :mod:`compileall` can create .pyc files for all modules in a " "directory." msgstr "模組 :mod:`compileall` 可以為資料夾中的所有模組創建 .pyc 檔。" -#: ../../tutorial/modules.rst:251 +#: ../../tutorial/modules.rst:252 msgid "" "There is more detail on this process, including a flow chart of the " "decisions, in :pep:`3147`." msgstr "更多的細節,包括決策流程圖,請參考\\ :pep:`3147`\\ 。" -#: ../../tutorial/modules.rst:258 +#: ../../tutorial/modules.rst:259 msgid "Standard Modules" msgstr "標準模組" -#: ../../tutorial/modules.rst:262 +#: ../../tutorial/modules.rst:263 msgid "" "Python comes with a library of standard modules, described in a separate " "document, the Python Library Reference (\"Library Reference\" hereafter). " @@ -440,13 +442,13 @@ msgstr "" "\n" "::" -#: ../../tutorial/modules.rst:285 +#: ../../tutorial/modules.rst:286 msgid "" "These two variables are only defined if the interpreter is in interactive " "mode." msgstr "只有直譯器在互動模式時,才需要定義這兩個變數。" -#: ../../tutorial/modules.rst:287 +#: ../../tutorial/modules.rst:288 msgid "" "The variable ``sys.path`` is a list of strings that determines the " "interpreter's search path for modules. It is initialized to a default path " @@ -460,11 +462,11 @@ msgstr "" "\n" "::" -#: ../../tutorial/modules.rst:300 +#: ../../tutorial/modules.rst:301 msgid "The :func:`dir` Function" msgstr ":func:`dir` 函式" -#: ../../tutorial/modules.rst:302 +#: ../../tutorial/modules.rst:303 msgid "" "The built-in function :func:`dir` is used to find out which names a module " "defines. It returns a sorted list of strings::" @@ -474,7 +476,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/modules.rst:331 +#: ../../tutorial/modules.rst:332 msgid "" "Without arguments, :func:`dir` lists the names you have defined currently::" msgstr "" @@ -482,12 +484,12 @@ msgstr "" "\n" "::" -#: ../../tutorial/modules.rst:339 +#: ../../tutorial/modules.rst:340 msgid "" "Note that it lists all types of names: variables, modules, functions, etc." msgstr "請注意,它列出所有類型的名稱:變數、模組、函式等。" -#: ../../tutorial/modules.rst:343 +#: ../../tutorial/modules.rst:344 msgid "" ":func:`dir` does not list the names of built-in functions and variables. If " "you want a list of those, they are defined in the standard module :mod:" @@ -498,11 +500,11 @@ msgstr "" "\n" "::" -#: ../../tutorial/modules.rst:382 +#: ../../tutorial/modules.rst:383 msgid "Packages" msgstr "套件 (Package)" -#: ../../tutorial/modules.rst:384 +#: ../../tutorial/modules.rst:385 msgid "" "Packages are a way of structuring Python's module namespace by using " "\"dotted module names\". For example, the module name :mod:`A.B` designates " @@ -517,7 +519,7 @@ msgstr "" "的作者不需擔心與其他模組的全域變數名稱重複,點分隔模組名稱的使用,也讓多模組" "套件(像 NumPy 或 Pillow)的作者們不須擔心其他套件的模組名稱。" -#: ../../tutorial/modules.rst:392 +#: ../../tutorial/modules.rst:393 msgid "" "Suppose you want to design a collection of modules (a \"package\") for the " "uniform handling of sound files and sound data. There are many different " @@ -539,13 +541,13 @@ msgstr "" "一系列無止盡的模組來執行這些作業。以下是你的套件可能的架構(以階層式檔案系統" "的方式表示):" -#: ../../tutorial/modules.rst:429 +#: ../../tutorial/modules.rst:430 msgid "" "When importing the package, Python searches through the directories on ``sys." "path`` looking for the package subdirectory." msgstr "Import 套件時,Python 會搜尋 ``sys.path`` 裡的目錄,尋找套件的子目錄。" -#: ../../tutorial/modules.rst:432 +#: ../../tutorial/modules.rst:433 msgid "" "The :file:`__init__.py` files are required to make Python treat directories " "containing the file as packages. This prevents directories with a common " @@ -559,7 +561,7 @@ msgstr "" "尋路徑中的有效模組。在最簡單的情況,\\ :file:`__init__.py` 可以只是一個空白檔" "案;但它也可以執行套件的初始化程式碼,或設置 ``__all__`` 變數,之後會詳述。" -#: ../../tutorial/modules.rst:439 +#: ../../tutorial/modules.rst:440 msgid "" "Users of the package can import individual modules from the package, for " "example::" @@ -568,7 +570,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/modules.rst:444 +#: ../../tutorial/modules.rst:445 msgid "" "This loads the submodule :mod:`sound.effects.echo`. It must be referenced " "with its full name. ::" @@ -577,14 +579,14 @@ msgstr "" "\n" "::" -#: ../../tutorial/modules.rst:449 +#: ../../tutorial/modules.rst:450 msgid "An alternative way of importing the submodule is::" msgstr "" "另一種 import 子模組的方法是:\n" "\n" "::" -#: ../../tutorial/modules.rst:453 +#: ../../tutorial/modules.rst:454 msgid "" "This also loads the submodule :mod:`echo`, and makes it available without " "its package prefix, so it can be used as follows::" @@ -594,7 +596,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/modules.rst:458 +#: ../../tutorial/modules.rst:459 msgid "" "Yet another variation is to import the desired function or variable " "directly::" @@ -603,7 +605,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/modules.rst:462 +#: ../../tutorial/modules.rst:463 msgid "" "Again, this loads the submodule :mod:`echo`, but this makes its function :" "func:`echofilter` directly available::" @@ -613,7 +615,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/modules.rst:467 +#: ../../tutorial/modules.rst:468 msgid "" "Note that when using ``from package import item``, the item can be either a " "submodule (or subpackage) of the package, or some other name defined in the " @@ -627,7 +629,7 @@ msgstr "" "陳述式首先測試套件中有沒有定義該 item;如果沒有,則會假設它是模組,並嘗試載" "入。如果還是找不到 item,則會引發 :exc:`ImportError` 例外。" -#: ../../tutorial/modules.rst:474 +#: ../../tutorial/modules.rst:475 msgid "" "Contrarily, when using syntax like ``import item.subitem.subsubitem``, each " "item except for the last must be a package; the last item can be a module or " @@ -638,11 +640,11 @@ msgstr "" "一項都必須是套件;最後一項可以是模組或套件,但不能是前一項中定義的 class、函" "式或變數。" -#: ../../tutorial/modules.rst:483 +#: ../../tutorial/modules.rst:484 msgid "Importing \\* From a Package" msgstr "從套件中 import \\*" -#: ../../tutorial/modules.rst:487 +#: ../../tutorial/modules.rst:488 msgid "" "Now what happens when the user writes ``from sound.effects import *``? " "Ideally, one would hope that this somehow goes out to the filesystem, finds " @@ -655,7 +657,7 @@ msgstr "" "會花費較長的時間,且 import 子模組的過程可能會有不必要的副作用,這些副作用只" "有在明確地 import 子模組時才會發生。" -#: ../../tutorial/modules.rst:493 +#: ../../tutorial/modules.rst:494 msgid "" "The only solution is for the package author to provide an explicit index of " "the package. The :keyword:`import` statement uses the following convention: " @@ -676,7 +678,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/modules.rst:505 +#: ../../tutorial/modules.rst:506 msgid "" "This would mean that ``from sound.effects import *`` would import the three " "named submodules of the :mod:`sound` package." @@ -684,7 +686,7 @@ msgstr "" "意思是,\\ ``from sound.effects import *`` 將會 import :mod:`sound` 套件中," "這三個被提名的子模組。" -#: ../../tutorial/modules.rst:508 +#: ../../tutorial/modules.rst:509 msgid "" "If ``__all__`` is not defined, the statement ``from sound.effects import *`` " "does *not* import all submodules from the package :mod:`sound.effects` into " @@ -705,7 +707,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/modules.rst:521 +#: ../../tutorial/modules.rst:522 msgid "" "In this example, the :mod:`echo` and :mod:`surround` modules are imported in " "the current namespace because they are defined in the :mod:`sound.effects` " @@ -716,7 +718,7 @@ msgstr "" "`surround` 模組被 import 進當前的命名空間,因為它們是在 :mod:`sound.effects` " "套件裡定義的。(當 ``__all__`` 有被定義時,這規則也有效。)" -#: ../../tutorial/modules.rst:526 +#: ../../tutorial/modules.rst:527 msgid "" "Although certain modules are designed to export only names that follow " "certain patterns when you use ``import *``, it is still considered bad " @@ -725,7 +727,7 @@ msgstr "" "雖然,有些特定模組的設計,讓你使用 ``import *`` 時,該模組只會輸出遵循特定樣" "式的名稱,但在正式環境 (production) 的程式碼中這仍然被視為是不良習慣。" -#: ../../tutorial/modules.rst:530 +#: ../../tutorial/modules.rst:531 msgid "" "Remember, there is nothing wrong with using ``from package import " "specific_submodule``! In fact, this is the recommended notation unless the " @@ -735,11 +737,11 @@ msgstr "" "記住,使用 ``from package import specific_submodule`` 不會有任何問題!實際" "上,這是推薦用法,除非 import 的模組需要用到的子模組和其他套件的子模組同名。" -#: ../../tutorial/modules.rst:537 +#: ../../tutorial/modules.rst:538 msgid "Intra-package References" msgstr "套件內引用" -#: ../../tutorial/modules.rst:539 +#: ../../tutorial/modules.rst:540 msgid "" "When packages are structured into subpackages (as with the :mod:`sound` " "package in the example), you can use absolute imports to refer to submodules " @@ -752,7 +754,7 @@ msgstr "" "filters.vocoder` 模組中使用 :mod:`sound.effects` 中的 :mod:`echo` 模組時,可" "以用 ``from sound.effects import echo``\\ 。" -#: ../../tutorial/modules.rst:545 +#: ../../tutorial/modules.rst:546 msgid "" "You can also write relative imports, with the ``from module import name`` " "form of import statement. These imports use leading dots to indicate the " @@ -765,7 +767,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/modules.rst:554 +#: ../../tutorial/modules.rst:555 msgid "" "Note that relative imports are based on the name of the current module. " "Since the name of the main module is always ``\"__main__\"``, modules " @@ -776,11 +778,11 @@ msgstr "" "\"__main__\"``\\ ,所以如果一個模組預期被用作 Python 應用程式的主模組,那它必" "須永遠使用絕對 import。" -#: ../../tutorial/modules.rst:560 +#: ../../tutorial/modules.rst:561 msgid "Packages in Multiple Directories" msgstr "多目錄中的套件" -#: ../../tutorial/modules.rst:562 +#: ../../tutorial/modules.rst:563 msgid "" "Packages support one more special attribute, :attr:`__path__`. This is " "initialized to be a list containing the name of the directory holding the " @@ -793,17 +795,17 @@ msgstr "" "執行之前。這個變數可以被修改,但這樣做會影響將來對套件內的模組和子套件的搜" "尋。" -#: ../../tutorial/modules.rst:568 +#: ../../tutorial/modules.rst:569 msgid "" "While this feature is not often needed, it can be used to extend the set of " "modules found in a package." msgstr "雖然這個特色不太常被需要,但它可用於擴充套件中的模組集合。" -#: ../../tutorial/modules.rst:573 +#: ../../tutorial/modules.rst:574 msgid "Footnotes" msgstr "註解" -#: ../../tutorial/modules.rst:574 +#: ../../tutorial/modules.rst:575 msgid "" "In fact function definitions are also 'statements' that are 'executed'; the " "execution of a module-level function definition enters the function name in " @@ -811,3 +813,6 @@ msgid "" msgstr "" "實際上,函式定義也是「被執行」的「陳述式」;在執行模組階層的函式定義時,會輸" "入函式名稱到模組的全域符號表。" + +#~ msgid "The installation-dependent default." +#~ msgstr "安裝相關的預設值。" diff --git a/using/cmdline.po b/using/cmdline.po index 60c2cc64d5..94a188fdd3 100644 --- a/using/cmdline.po +++ b/using/cmdline.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-13 00:11+0000\n" +"POT-Creation-Date: 2021-09-29 00:11+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-" @@ -422,8 +422,8 @@ msgstr "" msgid "" "Hash randomization is intended to provide protection against a denial-of-" "service caused by carefully-chosen inputs that exploit the worst case " -"performance of a dict construction, O(n^2) complexity. See http://www.ocert." -"org/advisories/ocert-2011-003.html for details." +"performance of a dict construction, O(n\\ :sup:`2`) complexity. See http://" +"www.ocert.org/advisories/ocert-2011-003.html for details." msgstr "" #: ../../using/cmdline.rst:328 @@ -797,7 +797,7 @@ msgstr "" #: ../../using/cmdline.rst:623 msgid "" "If this is set, Python ignores case in :keyword:`import` statements. This " -"only works on Windows and OS X." +"only works on Windows and macOS." msgstr "" #: ../../using/cmdline.rst:629 @@ -884,8 +884,7 @@ msgstr "" #: ../../using/cmdline.rst:705 msgid "" "If this environment variable is set, ``sys.argv[0]`` will be set to its " -"value instead of the value got through the C runtime. Only works on Mac OS " -"X." +"value instead of the value got through the C runtime. Only works on macOS." msgstr "" #: ../../using/cmdline.rst:711 diff --git a/using/mac.po b/using/mac.po index c2a3845fb1..571a456b7d 100644 --- a/using/mac.po +++ b/using/mac.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-20 18:08+0800\n" +"POT-Creation-Date: 2021-09-24 00:11+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-" @@ -22,8 +22,8 @@ msgstr "" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../using/mac.rst:6 -msgid "Using Python on a Macintosh" -msgstr "在麥金塔系統使用Python" +msgid "Using Python on a Mac" +msgstr "在 Mac 系統使用Python" #: ../../using/mac.rst:0 msgid "Author" @@ -35,26 +35,26 @@ msgstr "Bob Savage " #: ../../using/mac.rst:11 msgid "" -"Python on a Macintosh running Mac OS X is in principle very similar to " -"Python on any other Unix platform, but there are a number of additional " -"features such as the IDE and the Package Manager that are worth pointing out." +"Python on a Mac running macOS is in principle very similar to Python on any " +"other Unix platform, but there are a number of additional features such as " +"the IDE and the Package Manager that are worth pointing out." msgstr "" -"Python 執行在麥金塔系統的 Mac OS X 和執行在其他 Unix 平台上原理非常相似,\\ " -"但有一些值得提出的是在 Mac OS X 上增加其他額外的功能例如 IDE 與 套件管理。" +"Python 執行在 Mac 的 macOS 和執行在其他 Unix 平台上原理非常相似,\\ " +"但值得一提的是在 macOS 上有其他額外的功能,例如 IDE 與 套件管理。" #: ../../using/mac.rst:18 msgid "Getting and Installing MacPython" -msgstr "取得和安裝MacPython" +msgstr "取得和安裝 MacPython" #: ../../using/mac.rst:20 msgid "" -"Mac OS X 10.8 comes with Python 2.7 pre-installed by Apple. If you wish, " -"you are invited to install the most recent version of Python 3 from the " -"Python website (https://www.python.org). A current \"universal binary\" " -"build of Python, which runs natively on the Mac's new Intel and legacy PPC " -"CPU's, is available there." +"macOS since version 10.8 comes with Python 2.7 pre-installed by Apple. If " +"you wish, you are invited to install the most recent version of Python 3 " +"from the Python website (https://www.python.org). A current \"universal " +"binary\" build of Python, which runs natively on the Mac's new Intel and " +"legacy PPC CPU's, is available there." msgstr "" -"Apple 在 Mac OS X 10.8 預設安裝 Python 2.7。\\ 但你也可以到 Python website " +"Apple 在 macOS 10.8 預設安裝 Python 2.7。\\ 但你也可以到 Python website " "(https://www.python.org )更新至最新的 Python 3。\\ Python 建立在\"通用二進" "位\"上,\\ 使 Python 能以本地程序的形式運行在使用英特爾微處理器與 PowerPC 麥" "金塔電腦上。\\" @@ -109,7 +109,7 @@ msgstr "如何執行Python腳本" #: ../../using/mac.rst:57 msgid "" -"Your best way to get started with Python on Mac OS X is through the IDLE " +"Your best way to get started with Python on macOS is through the IDLE " "integrated development environment, see section :ref:`ide` and use the Help " "menu when the IDE is running." msgstr "" @@ -117,14 +117,14 @@ msgstr "" #: ../../using/mac.rst:61 msgid "" "If you want to run Python scripts from the Terminal window command line or " -"from the Finder you first need an editor to create your script. Mac OS X " -"comes with a number of standard Unix command line editors, :program:`vim` " -"and :program:`emacs` among them. If you want a more Mac-like editor, :" -"program:`BBEdit` or :program:`TextWrangler` from Bare Bones Software (see " -"http://www.barebones.com/products/bbedit/index.html) are good choices, as " -"is :program:`TextMate` (see https://macromates.com/). Other editors include :" -"program:`Gvim` (http://macvim-dev.github.io/macvim/) and :program:`Aquamacs` " -"(http://aquamacs.org/)." +"from the Finder you first need an editor to create your script. macOS comes " +"with a number of standard Unix command line editors, :program:`vim` and :" +"program:`emacs` among them. If you want a more Mac-like editor, :program:" +"`BBEdit` or :program:`TextWrangler` from Bare Bones Software (see http://www." +"barebones.com/products/bbedit/index.html) are good choices, as is :program:" +"`TextMate` (see https://macromates.com/). Other editors include :program:" +"`Gvim` (http://macvim-dev.github.io/macvim/) and :program:`Aquamacs` (http://" +"aquamacs.org/)." msgstr "" #: ../../using/mac.rst:71 @@ -156,8 +156,8 @@ msgstr "透過使用者圖形介面執行腳本" #: ../../using/mac.rst:90 msgid "" -"With older versions of Python, there is one Mac OS X quirk that you need to " -"be aware of: programs that talk to the Aqua window manager (in other words, " +"With older versions of Python, there is one macOS quirk that you need to be " +"aware of: programs that talk to the Aqua window manager (in other words, " "anything that has a GUI) need to be run in a special way. Use :program:" "`pythonw` instead of :program:`python` to start such scripts." msgstr "" @@ -173,7 +173,7 @@ msgstr "設定" #: ../../using/mac.rst:101 msgid "" -"Python on OS X honors all standard Unix environment variables such as :" +"Python on macOS honors all standard Unix environment variables such as :" "envvar:`PYTHONPATH`, but setting these variables for programs started from " "the Finder is non-standard as the Finder does not read your :file:`.profile` " "or :file:`.cshrc` at startup. You need to create a file :file:`~/.MacOSX/" @@ -245,14 +245,14 @@ msgstr "" #: ../../using/mac.rst:150 msgid "" "*wxPython* is another popular cross-platform GUI toolkit that runs natively " -"on Mac OS X. Packages and documentation are available from https://www." -"wxpython.org." +"on macOS. Packages and documentation are available from https://www.wxpython." +"org." msgstr "" #: ../../using/mac.rst:153 msgid "" "*PyQt* is another popular cross-platform GUI toolkit that runs natively on " -"Mac OS X. More information can be found at https://riverbankcomputing.com/" +"macOS. More information can be found at https://riverbankcomputing.com/" "software/pyqt/intro." msgstr "" diff --git a/whatsnew/2.0.po b/whatsnew/2.0.po index c593feb7ad..02a2fe52fd 100644 --- a/whatsnew/2.0.po +++ b/whatsnew/2.0.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-20 18:08+0800\n" +"POT-Creation-Date: 2021-09-29 00:11+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-" @@ -989,7 +989,7 @@ msgid "" "limiting the size of source files. In particular, this affected the maximum " "size of literal lists and dictionaries in Python source; occasionally people " "who are generating Python code would run into this limit. A patch by " -"Charles G. Waldman raises the limit from ``2^16`` to ``2^{32}``." +"Charles G. Waldman raises the limit from ``2**16`` to ``2**32``." msgstr "" #: ../../whatsnew/2.0.rst:796 diff --git a/whatsnew/2.7.po b/whatsnew/2.7.po index 391324d7de..03ce3b2666 100644 --- a/whatsnew/2.7.po +++ b/whatsnew/2.7.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-20 18:08+0800\n" +"POT-Creation-Date: 2021-09-29 00:11+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-" @@ -993,14 +993,14 @@ msgstr "" #: ../../whatsnew/2.7.rst:956 msgid "" -"Long integers are now stored internally either in base 2**15 or in base " -"2**30, the base being determined at build time. Previously, they were " -"always stored in base 2**15. Using base 2**30 gives significant performance " -"improvements on 64-bit machines, but benchmark results on 32-bit machines " -"have been mixed. Therefore, the default is to use base 2**30 on 64-bit " -"machines and base 2**15 on 32-bit machines; on Unix, there's a new configure " -"option :option:`!--enable-big-digits` that can be used to override this " -"default." +"Long integers are now stored internally either in base ``2**15`` or in base " +"``2**30``, the base being determined at build time. Previously, they were " +"always stored in base ``2**15``. Using base ``2**30`` gives significant " +"performance improvements on 64-bit machines, but benchmark results on 32-bit " +"machines have been mixed. Therefore, the default is to use base ``2**30`` " +"on 64-bit machines and base ``2**15`` on 32-bit machines; on Unix, there's a " +"new configure option :option:`!--enable-big-digits` that can be used to " +"override this default." msgstr "" #: ../../whatsnew/2.7.rst:965 diff --git a/whatsnew/3.1.po b/whatsnew/3.1.po index 0aaeb0e5fb..9228268abb 100644 --- a/whatsnew/3.1.po +++ b/whatsnew/3.1.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.7\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-06-26 18:54+0800\n" +"POT-Creation-Date: 2021-09-29 00:11+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-" @@ -597,13 +597,14 @@ msgstr "" #: ../../whatsnew/3.1.rst:477 msgid "" -"Integers are now stored internally either in base 2**15 or in base 2**30, " -"the base being determined at build time. Previously, they were always " -"stored in base 2**15. Using base 2**30 gives significant performance " -"improvements on 64-bit machines, but benchmark results on 32-bit machines " -"have been mixed. Therefore, the default is to use base 2**30 on 64-bit " -"machines and base 2**15 on 32-bit machines; on Unix, there's a new configure " -"option ``--enable-big-digits`` that can be used to override this default." +"Integers are now stored internally either in base ``2**15`` or in base " +"``2**30``, the base being determined at build time. Previously, they were " +"always stored in base ``2**15``. Using base ``2**30`` gives significant " +"performance improvements on 64-bit machines, but benchmark results on 32-bit " +"machines have been mixed. Therefore, the default is to use base ``2**30`` " +"on 64-bit machines and base ``2**15`` on 32-bit machines; on Unix, there's a " +"new configure option ``--enable-big-digits`` that can be used to override " +"this default." msgstr "" #: ../../whatsnew/3.1.rst:486